chat commands

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Scriptless
orc pawn
orc pawn
Posts: 16
Joined: Fri Apr 23, 2004 4:20 pm

chat commands

Post by Scriptless » Thu Apr 29, 2004 5:55 pm

I have a couple of easy peasys that need some help.



Oldest was

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText) 


/if "@ChatText"=="snare" { 
/target @Sender 
/delay 1s 
/assist 
/delay 1s 
/call Cast "ensnare" 
} 

Last week was

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText) 


    /if (${String[@ChatText].Equal[snare]}) { 
        /target @Sender 
        /delay 1s 
        /assist 
        /delay 1s 
        /call Cast "ensnare" 
    }


My little diddys will check their selfbuff and cast them with ML's new spellcast.



All day I have been messing around and reading so far I've got

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText) 

         /bang head on desk

Zazoot
a hill giant
a hill giant
Posts: 163
Joined: Sat Feb 07, 2004 11:02 am

Post by Zazoot » Thu Apr 29, 2004 6:57 pm

can you do a fuzzy equal like the parm system had with ~~ ????????

that would make parsing chat commands easier and less suspicious if being snooped on

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Thu Apr 29, 2004 7:04 pm

If you want to do it that way, I would suggest using some of the following.

String.Find or String.Compare
All day I have been messing around and reading so far I've got


Code:
Sub Event_Chat(ChatType,Sender,ChatText)

/bang head on desk
Stop that, you'll hurt the desk. It's really quite a simple change and you will love it once you get to know it.

Code: Select all

@ChatText becomes ${ChatText}
@Sender becomes ${Sender}
@AnyOldVarType becomes ${AnyOldVarType}
The bonus to this? You don't have to tell MQ to treat @ChatText as a string because ${ChatText} IS of the String type. Sooo...

Code: Select all

/if (${String[@ChatText].Equal[snare]}) {
becomes
/if (${ChatText.Equal[snare]}) {
That gets you started. Read the Announcement sections for more.

Scriptless
orc pawn
orc pawn
Posts: 16
Joined: Fri Apr 23, 2004 4:20 pm

Thank you

Post by Scriptless » Sun May 02, 2004 5:38 am

/\ Title says it all.

Thanks, got my little diddys upgraded.