Page 1 of 1

Chat events

Posted: Thu Mar 17, 2005 11:03 pm
by Teh_Hidden
This is the closest I came to finding a solution for my problem.

Here is my issue: I'm working with this macro, modified into a .inc file (possibly incorectly, which could be the root of the problem). The code for the .inc file is

Code: Select all

Sub Twitch
:Twitch
   /if (${Twitching}==1) {
      /if (${Me.SpellReady[Sedulous Subversion]}) /call cast "Sedulous Subversion"
      /if (${Me.SpellReady[Covetous Subversion]}) /call cast "Covetous Subversion"
   }
   /doevents
   /delay 4
   /goto :Twitch
/return       

Sub Event_Chat(string ChatType,string Sender,string ChatText)
/if ((${ChatText.Equal[twitch]}) && (${ChatType.equal[twitchchannel])
   /varset Twitching 1
   /target ${Sender}
   /if (${Target.ID}) {
      /call Twitch
      }
   }
/if ((${ChatText.equal[FM]}) && (${ChatType.Equal[chat]})) {
   /varset Twitching 0   
   }
/return   

Sub Event_OOM
   /varset Twitching 0

/return
My problem is that I tried to modify the macro to respond to the word "twitch" in a channel. When I tried to do this, though, the macro would attempt to react to anything said in ANY chat channel.

The following are the events that I added to the macro, when trying to convert the twitch macro to a .inc.

Code: Select all

#Chat Chat
#Chat twitchchannel
#event
The error I get with this code is the following:

Code: Select all

Failed to parse /if command. Could not find command to execute.
twitchbot.inc@13 (Event_Chat(string ChatType,string Sender,string ChatText) /if ((${ChatText.Equal[twitch]})

Now, I'm sure that the reason for my mistakes is stupid, and the result of the fact that I'm a noob at coding. But any help would be appreciated. RTFM has gotten me this far, but unfortunately, I can't manage to get any further on my own.

Posted: Thu Mar 17, 2005 11:15 pm
by Lax
Re-read, and then follow the instructions for posting on MQ2::Macros::Help.

Particularly, steps 3 and on.