Casting Macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

icepick912
orc pawn
orc pawn
Posts: 14
Joined: Tue Jan 21, 2003 4:07 pm

Casting Macro

Post by icepick912 » Tue Dec 09, 2003 1:46 am

Code: Select all

#define owner "Ownername" 

/declare SpellSlot global
/declare v2 global

/varset v2 == 0 

_____________________________________

|Sub event chat routine

Sub Event_Chat(ChatType,Sender,ChatText)  

/if @Sender=="owner" {

   /if "@ChatText"==Heal { 
      /varset SpellSlot == $char(gem,Chloroblast)
      /if n "@SpellSlot"=="0" {
         /memspell 4 Chloroblast
      }      
      :SpellWait
      /if n "@SpellSlot"=="0" {
         /goto :SpellWait
      } else /if n "@SpellSlot"=="-2"{
         /goto :SpellWait
      }
      /echo @SpellSlot
      /sit off 
      /target owner 
      /cast "@SpellSlot"
      /tell owner Healing $target(name) 
      /delay 4s 
      /varset v2 == 1 
      /varset SpellSlot == 0

   } 
Am Having problems assigining gem number to @spellslot not sure if im doin it right,it /echos as "==" thnx for help in advance.

koad
Plugins Czar
Posts: 127
Joined: Fri May 16, 2003 8:32 pm

Post by koad » Tue Dec 09, 2003 4:30 am

the /varset command does not expect or interpret == other than data, and since its the first param passed, its being considered the data you want to set.

Code: Select all

/varset SpellSlot == $char(gem,Chloroblast)
should be

Code: Select all

/varset SpellSlot $char(gem,Chloroblast)

icepick912
orc pawn
orc pawn
Posts: 14
Joined: Tue Jan 21, 2003 4:07 pm

Post by icepick912 » Tue Dec 09, 2003 8:59 am

Thnx for the tip, dont know where the hell i got the == from on varset, think i thoujght it was form the new formatt or whatever.

Code: Select all

/if @Sender=="owner" {

   /if "@ChatText"==Heal { 
      /varset SpellSlot $char(gem,Chloroblast)
      /if n "@SpellSlot"=="0" {
         /if "$char(state)"!="SIT" {
            /sit
         }
         /memspell 4 Chloroblast
      }  
      :SpellWait
      /if n "@SpellSlot"<"1" {
         /varset SpellSlot $char(gem,Chloroblast)
         /goto :SpellWait
      }
      /sit off 
      /target owner 
      /cast @SpellSlot
      /tell owner Healing $target(name) 
      /delay 4s 
      /varset v2 1 
      /varset SpellSlot 0

   } 
Thats the final workin code i got, cept i also want to make it to where the shaman bot can take parameters, like i would say to the bot...

"mem 4 Chloroblast"

And the bot would do just that, but do it in a very dynamic way, like it would take the params of p0 and have the code set up something like

Code: Select all

/"@Param0" "@Param1" "@Param2"
and he would do exacly what i was telling him, but im not sure how to do that outside of having it when you start a macro, like /macro shamanpet "Param0" etc...
Mabey i could try

Code: Select all

/if "@ChatText"=="mem" {
   /memspell "@Param1" "@Param2"
}
That make any sense?

icepick912
orc pawn
orc pawn
Posts: 14
Joined: Tue Jan 21, 2003 4:07 pm

Post by icepick912 » Wed Dec 10, 2003 12:29 am

Alright, got all workin now exept when i try to use a Parameter for a command it says cant parse, this is what i use...

Code: Select all

/declare PCommand0 global
/declare PCommand1 global
/declare PCommand2 global
/declare PCommand3 global
/declare PCommand4 global

Sub Event_Chat(ChatType,Sender,ChatText)  

/if @Sender=="owner" {

   /if "@ChatText"~~Command {
      /varset PCommand0 $arg(2,"@ChatText")
	  /varset PCommand1 $arg(3,"@ChatText")
	  /varset PCommand2 $arg(4,"@ChatText")
	  /varset PCommand3 $arg(5,"@ChatText")
	  /varset PCommand4 $arg(6,"@ChatText")
	  [b][u]/@PCommand0 @PCommand1 @PCommand2 @PCommand3 @PCommand4[/b][/u] 
|Havin Problems with the above line already tried /"@PCommand0" didnt work
   }
   
What this does is if i tell my pet to "Command memspell 1 chloroblast"

it returns ...

couldnt parse ' /@PCommand0 @PCommand1 @PCommand2 @PCommand3 @PCommand4'

Ive tried usin " marks around the commands that doesnt work, also tried various other things, any help would be appreciated, when i /echo the results it echos as /memspell 1 chloroblast, but i guess i did something wrong with the way i put the ParameterCommands as /@PCommand

Thnx for lookin[/b]