|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
how to delay IF statement in JOIN event?
coz i want my bot to ON JOIN check channel modes, and if some mode isnt there that it sets it.
but
on @*:JOIN:#:{ doesnt work coz on JOIN youre not opped
on *:JOIN:#:{ if ($me isop $chan) { same thing...
and timers dont work with IF
IceCapped
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
Try this 
raw 366:*:{
if (nt !isin $gettok($chan(#).mode,1,32)) && ($nick($2,0,a) == 1) { mode $2 +nt }
}
replace nt with the mode you want to be set.. 
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Try this on me:*:join:#:{
set %me.join $true
}
on *:op:#:{
if $me == $opnick && %me.join {
unset %me.join
;check for proper modes and set/unset anything that is wrong
}
}
You'll have to code the section for the actual checking of the modes yourself.
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
Try this 
raw 366:*:{
if (nt !isin $gettok($chan(#).mode,1,32)) && ($nick($2,0,a) == 1) { mode $2 +nt }
}
replace nt with the mode you want to be set.. this doesnt work if i specify chan name  (coz i dont want it on all)
IceCapped
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
replace $chan(#) with your channel, then it should work or you could use:
raw 366:*:{
if ($chan(#) == #your_channel) && (nt !isin $gettok($chan(#).mode,1,32)) && ($nick($2,0,a) == 1) { mode $2 +nt }
}
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
doesnt work in any of those cases  think ill try with Russels solution
Last edited by raZOR; 16/12/06 04:17 PM.
IceCapped
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
If you need to specify channels you could set a variable /set %protectmode #chan1,#chan2,#chan3
on me:*:JOIN:%protectmode: {
set -e $+(%,mejoin.,#) $true
}
on *:OP:%protectmode: {
if (($opnick != $me) || ($eval($+(%,mejoin.,#),2))) return
unset $+(%,mejoin.,#)
.timerCheckChanModes. $+ # 1 30 CheckChanModes #
}
alias CheckChanModes {
if ($me !isop $1) return
if (n !isincs $gettok($chan($1).mode,1,32)) mode $1 +n
}
~ Edit ~ Added a timer and alias.
Last edited by RoCk; 16/12/06 04:42 PM.
|
|
|
|
Joined: Apr 2005
Posts: 1,009
Hoopy frood
|
OP
Hoopy frood
Joined: Apr 2005
Posts: 1,009 |
thanks to all 
IceCapped
|
|
|
|
Joined: Dec 2006
Posts: 9
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Dec 2006
Posts: 9 |
and timers dont work with IF
just to make something clear timer do work whit if, IF use properly. in this exemple if your bot is op it will check if there is anymode and if there is none it will set +ntl 11 see:
on *:OP:#:{ if ($opnick == $me) && ($chan($chan).mode == $null) { inc -u20 %x | timer.set. $+ $chan 1 %x if $me isop $chan && $chan($chan).mode == $null mode $chan +ntl $calc($nick($chan,0) + 10) } }
|
|
|
|
|