mIRC Home    About    Download    Register    News    Help

Print Thread
#166885 16/12/06 01:41 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
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
raZOR #166887 16/12/06 02:10 AM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
raZOR #166888 16/12/06 02:13 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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)


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


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #166916 16/12/06 04:13 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
doesnt work in any of those cases frown

think ill try with Russels solution

Last edited by raZOR; 16/12/06 04:17 PM.

IceCapped
raZOR #166917 16/12/06 04:31 PM
Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
thanks to all smile


IceCapped
raZOR #167769 30/12/06 05:55 AM
Joined: Dec 2006
Posts: 9
S
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
S
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) }
}


/ mIRC, PHP, Linux help and tutorial forum: www.SICORPS.org /

Link Copied to Clipboard