Quick Question

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

C247
orc pawn
orc pawn
Posts: 21
Joined: Tue Jan 27, 2004 9:09 pm

Quick Question

Post by C247 » Sat Jan 31, 2004 1:12 pm

Is there a code event that could make it so i would assist when i hear the main tank slash, bash, hit, crush, or pierce?

Code: Select all

#Event tankattacking "points of damage" 
Like #Event tankattacking "@Param0 hits/slashes/pierces/crushes/bashes/etc" is there a way i could do that for all of them?

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

Post by wilso132 » Sat Jan 31, 2004 1:51 pm

Code: Select all

#Event tankattacking "damage"
Then check the string for param0.

Will that not work?

C247
orc pawn
orc pawn
Posts: 21
Joined: Tue Jan 27, 2004 9:09 pm

Post by C247 » Sat Jan 31, 2004 4:30 pm

What do you mean by "Check the string for @param0"? is there a command?

Hehe, sorry, not quite familiar enough with this scripting stuffs.

:?

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

Post by wilso132 » Sat Jan 31, 2004 11:06 pm

When an event fires it will have in it a few parameters. Like in a chat event it will have parameters of who sent it, what they said, and what channel it was in.

I'm sure that chat line will send the whole line of text, and you could just search for the first word in the string. (As a matter of fact, you could probably get the exact code you're looking for out of some of the macros in the depot)

Edit:
Here's the command to search the string sent to the event, straight outta the manual:

Code: Select all

$instr(word,"string"|"@varname")
Returns the location of word inside string, returns -1 if not found