Taking Chat as Arguments, such at using it in a pet shaman

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

Taking Chat as Arguments, such at using it in a pet shaman

Post by icepick912 » Thu Dec 11, 2003 12:34 am

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") 
     /@PCommand0 @PCommand1 @PCommand2 @PCommand3 @PCommand4 
|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

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

Post by icepick912 » Thu Dec 18, 2003 1:38 am

Still no help? if i can get this workin, itll be alot easier then having to have a /if for every statement a master makes to his pet, that requires almost exact wording, if i could get this to work, then it would be like having a 1 ling if statement used to scontrol the pet, making the macro much smaller and more effecient.
and im all about efficiency

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Thu Dec 18, 2003 6:36 am

icepick912 wrote:Still no help? if i can get this workin, itll be alot easier then having to have a /if for every statement a master makes to his pet, that requires almost exact wording, if i could get this to work, then it would be like having a 1 ling if statement used to scontrol the pet, making the macro much smaller and more effecient.
and im all about efficiency
I suspect it would require changes to the parser to get this to work.

I remember looking in to this when I made genbot. I think I came to the conclusion that the ammount of work involved wasn't worth it. 95 percent of the commands you will give a bot are more than 1 liners anyway. You don't want to have to give the bot 4 commands where you could write 1 sub that does them all. SN is a good example of this. It will mem if needed, cast, handle fizzles and interupts, remem default spell set if needed, and sit down after a set durration if needed. This would be a nightmare using 1 line commands. With array's you don't really need multiple if statements anyway. Just an array of commands to match against.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack