mIRC Homepage
Posted By: state on op ban help - 26/07/06 09:03 PM
how can i make this better for when im opped

Code:
on *:OP:#: { 
  mode #f +b  81.101.141.64
  mode #w +b  81.101.141.64
  mode #l +b  81.101.141.64

}



thanks
Posted By: DaveC Re: on op ban help - 26/07/06 11:24 PM
Define what "betterness" you would like to have?
Posted By: SCNDRL Re: on op ban help - 27/07/06 01:32 PM
replace
on *:OP:#: {
with
on me:OP:#: {
Posted By: Lpfix5 Re: on op ban help - 27/07/06 04:58 PM
Quote:
how can i make this better for when im opped

Code:
on *:OP:#: { 
  mode #f +b  81.101.141.64
  mode #w +b  81.101.141.64
  mode #l +b  81.101.141.64

}



thanks


considering you want to do a multi ban in different channels you might want to consider if statements... else youll keep getting the "Your not op in this channel" message

Code:
on ME:OP:#:{
  if $me isop #f { mode #f +b 81.101.141.64 } 
  if $me isop #w { mode #w +b 81.101.141.64 }
  if $me isop #l { mode #l +b 81.101.141.64 }
}


Why did I use all those if statements? well basically the script won't work if your not op on that specific chan now theres various ways you can go about it like a IF, Elseif and a Else but this routine is basic
Posted By: hixxy Re: on op ban help - 29/07/06 09:53 AM
Code:
on *:op:#f:{
  if ($opnick == $me) mode $chan +b 81.101.141.64
}
on *:op:#w:{
  if ($opnick == $me) mode $chan +b 81.101.141.64
}
on *:op:#l:{
  if ($opnick == $me) mode $chan +b 81.101.141.64
}
Posted By: Darwin_Koala Re: on op ban help - 29/07/06 10:34 PM
Perhaps even ......

Code:
 
on me:op:#f,#w,#l:{  
mode $chan +b 81.101.141.64
}
 


or

Code:
 
on me:op:#f:{  
Ban64 $chan
}
on me:op:#w:{  
Ban64 $chan
}
on me:op:#l:{  
Ban64 $chan
}

alias -l Ban64 mode $1 +b 81.101.141.64
 


However, depending on what the OP actually wanted, this may also work (in which case the alternative channels need to be checked to see if the OP is also opped in the other channels.:

Code:
 
on me:op:#f,#w,#l:{  
 if ($me isop #f) Ban64 #f 
 if ($me isop #w) Ban64 #w
 if ($me isop #l) Ban64 #l 
}
 alias -l Ban64 mode $1 +b 81.101.141.64



or even ....

Code:
 
on me:op:#f,#w,#l:{  
Ban64 #f 
Ban64 #w
Ban64 #l 
}
 alias -l Ban64 if ($me isop $1) mode $1 +b 81.101.141.64



All of these options reduce the amount of editing required if the IP changes, which reduces the likelihood of errors! May not seem like much when it is altogether like this, but as a script grows, it may become more important!


*untested

Cheers,

DK

*Edited to use "me" instead of "*" in the "ON"
*edited to include an additional option
© mIRC Discussion Forums