mIRC Home    About    Download    Register    News    Help

Print Thread
#180971 15/07/07 10:53 PM
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
I'm creating a bot using 'on text' events, and so far, everything has been working good. So far, I've only been using the nick of the person who types the !command, but now I want to use both their name, my name and other peoples name. What line of code would I use for > on 1:TEXT:*!slap*:#:/describe $chan slaps $nick for trying to slap < I can't figure out how to change it from '!slap' to '!slap nick' and have the nick be an actual nick, not the word. Also, I want the user whose name was put into the !slap command to be put at the end. After its all said and done, I want the dialog to read "my-nick slaps your-nick for trying to slap someones-nick"......I think thats how i want it. Thanks for the help in advance! smile

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
on *:text:!slap *:#yourchan: {
  if ($2 ison $chan) { describe $chan slaps $nick for trying to slap $2 }
}


Explanation:
$2 holds the second word. If there is no second word, it will not triger at all: The if statement "if (X ison Y)" will only be matched if X is a nick that is on channel Y.

Last edited by Horstl; 15/07/07 11:02 PM.
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
Thanks! the explanation was very helpful! smile


Link Copied to Clipboard