mIRC Home    About    Download    Register    News    Help

Print Thread
#171360 23/02/07 05:00 AM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
Code:
on *:action:*:#:{
  if (slaps $me around a bit with a large trout isin $1-) {
    describe # message
  }
  elseif (slap isin $1) && ($me isin $2) {
    describe # message
  }
  elseif ($me isin $1-) {
    describe # mesage
  }
}


i cant make it respond when someone slaped me or someone mentioned my nick...

sigbin #171362 23/02/07 05:19 AM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
try this:
Code:
on *:action:#:{

you added a extra :* in your line

Code:
on *:action[color:#FF0000]:*[/color]:#:{

Bullseye #171367 23/02/07 10:10 AM
Joined: Feb 2007
Posts: 75
T
Babel fish
Offline
Babel fish
T
Joined: Feb 2007
Posts: 75
No, the command IS
Code:
on *:ACTION:*:#:{


I would use the following:
Code:
on *:action:*:#:{
  if (slaps isin $2-) && ($me isin $2-) && (trout isin $2-) {
    describe # message
    halt
  }
  elseif (slap isin $2-) && ($me isin $2-) {
    describe # message
    halt
  }
  elseif ($me isin $2-) {
    describe # mesage
    halt 
  }
}


Yeah, I just ordered your text a bit, putting the longest line at top and the smallest one at the bottom, now it will check for matches in order and halt the search if it comes to the desired match.

Another note, $1 will come out as the person's nickname as in * Trixar_za slaps St0NeR with a large trout, so you want to search for slap in $2 not $1 smile

Hope that helps smile


GigIRC Network Admin
irc.gigirc.com
Trixar_za #171372 23/02/07 12:04 PM
Joined: Jun 2004
Posts: 124
S
sigbin Offline OP
Vogon poet
OP Offline
Vogon poet
S
Joined: Jun 2004
Posts: 124
thankz to the both of you... =)

sigbin #171375 23/02/07 12:37 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
on *:action:$(slaps $me *):#:{ describe $chan message }


The above will suffice if you're trying to make some kind of 'anti-slap' script.

Trixar_za #171380 23/02/07 02:32 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Originally Posted By: Trixar_za
Another note, $1 will come out as the person's nickname as in * Trixar_za slaps St0NeR with a large trout, so you want to search for slap in $2 not $1 smile


That isn't true. $nick is the nick. $1 is the first word after the nick.

Also, there is no need to use a halt command when you're using IF/ELSEIF/ELSE. And, if you need to use a halt command for something, you should almost always be using RETURN instead of HALT.

Here's how you could do it if you really want 3 different messages:

Code:
on *:action:*:#: {
  if (slaps * $me * trout* iswm $1-) {
    describe $chan message
  }
  elseif (slaps * $me $+ * iswm $1-) {
    describe $chan message
  }
  elseif (slaps isin $1-) {
    describe $chan message
  }
}


Invision Support
#Invision on irc.irchighway.net
Riamus2 #171392 23/02/07 08:33 PM
Joined: Feb 2007
Posts: 75
T
Babel fish
Offline
Babel fish
T
Joined: Feb 2007
Posts: 75
You're right on both accounts. I seem to have a slight obsession with using halt :P

I tested it and found the error in my script, which was that the $2- should be $1-, but it does work.

Still think yours is better, runs the routine faster and more accurately than mine.


GigIRC Network Admin
irc.gigirc.com

Link Copied to Clipboard