Setting a variable when I send a tell?

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

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Setting a variable when I send a tell?

Post by ieatacid » Wed Jan 21, 2004 8:39 pm

What I want to do is something like this:

/if (I send a tell to someone saying "a certain phrase")
/varset IToldThem 1

Just not sure on the syntax to do that. Any help is appreciated.

Goofmester1
a hill giant
a hill giant
Posts: 241
Joined: Thu Nov 06, 2003 4:26 am

Post by Goofmester1 » Thu Jan 22, 2004 6:14 am

Try this

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText) 

  /if "@ChatText"~~"varsetcommand" { 
   /varset IToldThem 1 
} 

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Post by wilso132 » Thu Jan 22, 2004 1:21 pm

Or if you want to be able for them to say, for example:
"varset 5"

You, could try this.

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText) 

  /if "@ChatText"~~"varset" { 
   /varset IToldThem $right(1, @ChatText)
} 
That would only work for #'s 0-9, because of the $right(1,... but I'm guessing that should be what you're looking for.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Thu Jan 22, 2004 1:34 pm

Thanks, that worked nicely : )