mIRC Home    About    Download    Register    News    Help

Print Thread
#166885 16/12/06 01:41 AM
Joined: Apr 2005
Posts: 1,008
R
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Apr 2005
Posts: 1,008
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

raZOR #166887 16/12/06 02:10 AM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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

raZOR #166888 16/12/06 02:13 AM
Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
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.

sparta #166910 16/12/06 03:14 PM
Joined: Apr 2005
Posts: 1,008
R
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Apr 2005
Posts: 1,008
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)

raZOR #166913 16/12/06 03:31 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
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 }
}

sparta #166916 16/12/06 04:13 PM
Joined: Apr 2005
Posts: 1,008
R
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Apr 2005
Posts: 1,008
doesnt work in any of those cases frown

think ill try with Russels solution

Last edited by raZOR; 16/12/06 04:17 PM.
raZOR #166917 16/12/06 04:31 PM
Joined: Dec 2002
Posts: 1,995
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 1,995
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.

Last edited by RoCk; 16/12/06 04:42 PM.
RoCk #166974 17/12/06 07:41 PM
Joined: Apr 2005
Posts: 1,008
R
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Apr 2005
Posts: 1,008
thanks to all smile

raZOR #167769 30/12/06 05:55 AM
S
SICORPS
SICORPS
S
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) }
}


Link Copied to Clipboard