Conversion of a sub

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

Moderator: MacroQuest Developers

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

Conversion of a sub

Post by Goofmester1 » Mon Jun 14, 2004 12:47 pm

I have tried several variations of this sub to get it converted 100% and am having no luck..

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText)

   /if "@ChatText"~~"assist" {
      /target @Sender
      /assist
}
After searching for some time the best possible one I found was

Code: Select all

Sub Event_Chat(string ChatType,string Sender,string ChatText)

    /if (${ChatText}.Equal[assist]}) {
        /target ${Sender} 
        /delay 1s 
        /assist 
        /delay 1s 
      }
The problem is if there is any other word in the sentence then it ignores the tell since it is not equal.. I can't seem to find the way to get it to ignore the rest and just look for the word assist in a sentence.

Azum
a hill giant
a hill giant
Posts: 229
Joined: Wed Jun 04, 2003 5:04 am

Re: Conversion of a sub

Post by Azum » Mon Jun 14, 2004 1:16 pm

Code: Select all

/if (${ChatText.Find[assist]}) {


wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Mon Jun 14, 2004 4:03 pm

Code: Select all

/if (${ChatText}.Equal[assist]}) {
is incorrect.

Code: Select all

/if (${ChatText.Equal[assist]}) {
Would be the right way of using this method, if only looking for the word assist, or if you want to find the word assist in the chat text use the method in the post above.

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

Post by Goofmester1 » Mon Jun 14, 2004 7:45 pm

Thanks alot