mIRC Home    About    Download    Register    News    Help

Print Thread
IF ELSEIF ELSE #144732 14/03/06 12:21 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
code for my bot =)

Code:
 
on *:text:!request*:?:{
  if ($2 == $null) { /query $nick You need to specify channel. | halt }
  elseif (# isin $2) { /query $nick Your request has been relayed to my owners. | halt }
  else { /query $nick $2 unknown channel. | halt }
}
 


thing is that it wont work when user types !request #channel
altho i specified "if (# isin $2)"

any ideas?

6.16


IceCapped
Re: IF ELSEIF ELSE #144733 14/03/06 12:51 AM
Joined: Oct 2005
Posts: 122
O
onesikgypo Offline
Vogon poet
Offline
Vogon poet
O
Joined: Oct 2005
Posts: 122
if you use # in a script, mirc automatically assumes it is the channel where the text was said, instead use $chr(35)

Re: IF ELSEIF ELSE #144734 14/03/06 12:58 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
lol indeed

thanks very much laugh


IceCapped
Re: IF ELSEIF ELSE #144735 14/03/06 11:09 AM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
and instead of isin you may whane check (#* iswm $2) or the equivalent if (#$2 == $2)


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Re: IF ELSEIF ELSE #144736 14/03/06 11:32 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hey
thanks, great suggestion
just the thing i needed =)


IceCapped