mIRC Homepage
Posted By: raZOR on JOIN question - 16/12/06 01:41 AM
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
Posted By: sparta Re: on JOIN question - 16/12/06 02:10 AM
Try this smile
Code:
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.. smile
Posted By: RusselB Re: on JOIN question - 16/12/06 02:13 AM
Try this
Code:
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.
Posted By: raZOR Re: on JOIN question - 16/12/06 03:14 PM
Originally Posted By: sparta
Try this smile
Code:
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.. smile


this doesnt work if i specify chan name smirk
(coz i dont want it on all)
Posted By: sparta Re: on JOIN question - 16/12/06 03:31 PM
replace $chan(#) with your channel, then it should work

or you could use:
Code:
raw 366:*:{
  if ($chan(#) == #your_channel) && (nt !isin $gettok($chan(#).mode,1,32)) && ($nick($2,0,a) == 1) { mode $2 +nt }
}
Posted By: raZOR Re: on JOIN question - 16/12/06 04:13 PM
doesnt work in any of those cases frown

think ill try with Russels solution
Posted By: RoCk Re: on JOIN question - 16/12/06 04:31 PM
If you need to specify channels you could set a variable

/set %protectmode #chan1,#chan2,#chan3

Code:
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.
Posted By: raZOR Re: on JOIN question - 17/12/06 07:41 PM
thanks to all smile
Posted By: SICORPS Re: on JOIN question - 30/12/06 05:55 AM
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) }
}
© mIRC Discussion Forums