mIRC Home    About    Download    Register    News    Help

Print Thread
D
Destro12
Destro12
D
A couple of years ago when I was mIRC, I had written a script that came out as an auto response whenever someone named me in their /me. For example they would type /me slaps Destro12 with a trout and then my auto response would kick in and say Destro12 dodges and slaps [insert nick] here with a trout instead.

Now for the life of me I cannot remember how I wrote the script and I was wondering if you all could help me with the commands I need. I have read through the mIRC FAQ and I am still not sure which combination of commands I need to make this work. Thanks a lot.

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Code:
on *:action:*trigger*:#channel: {
  if (something) { describe $chan response }
}


That's a basic idea of how it works. Your trigger can be whatever you want it to be. For example, "slaps" or "large trout" or whatever. The channel is the channel you want it to work in (or just # for all channels). The IF (something) part is any check you want to make. For example, seeing if ($me isin $chan). And your response is whatever you want it to be. You can use $nick to display the nick of the person you're responding to. Describe is how you script /me, so if you want an action, use that. If you want it to be a normal message, use msg instead.

Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
This is a little advanced with regex, but works best to match your name exactly within a sentence and recognizes the singular and plural slap(s) when someone slaps you with anything:
Code:
on $@*:action:$(/(slaps?(^| )\Q $+ $replacecs($me,\E,\E\\E\Q) $+ \E(?![^\w\s\!\.\?]).*)/iS):*:{
  describe $iif(#,#,$nick) dodges and $replace($regml(1),$me,$nick,slap,slaps,slapss,slaps)
}
You'll then relay to it and return the same slap to him or her. This code also works for both channel and PM.

Last edited by Tomao; 13/10/11 11:50 PM.

Link Copied to Clipboard