Simple auto kick-ban for Bot

By Ahmed Zaggoudi on Apr 26, 2011

Simple auto kick-ban For bot
this snippet does not work with nicks without status
Only works woth @Op | %HalfOp | +Voice
SyntaX = !ban [reason]
EnjoY :D

#####Auto kick-ban | Put in your remote (Alt +R)
on *:TEXT:!ban *:#:{
  if ($nick == $nick) { halt }
  if ($me ishop $chan || $me isop $chan) {
    if ($$2 ishop $chan || $$2 isop $chan) { halt }
    elseif ($nick !ishop $chan || $nick !isop $chan) && ($$2 ison $chan && $$3 isnum) {
      set %reason. [ $+ [ $$2 ] ] $4-
      if (%reason. [ $+ [ $$2 ] ] == $null) { set %reason. [ $+ [ $$2 ] ] No Reason }
      inc %kcount
      ban -ku $+ $calc($3 * 60) $chan $$2 2 10Reason: %reason. [ $+ [ $$2 ] ] 1¤3 $$3 Minute Ban 1¤6 Requested By: $nick 1¤12 Noobs Pwnt: %kcount
      unset %reason. [ $+ [ $$2 ] ]
    }
  }
}
on *:TEXT:!banhelp:#: {
  if ($nick == $nick) { halt }
  if ($me isop $chan) {       notice $nick *** SYNTAX [TEMPBAN]: !ban <nick> <minutes> [reason] }
  if ($nick isop $chan) {       notice $nick *** SYNTAX [TEMPBAN]: !ban <nick> <minutes> [reason] }
  if ($nick ishop $chan) {       notice $nick *** SYNTAX [TEMPBAN]: !ban <nick> <minutes> [reason] }
  if ($nick isvoice $chan) {       notice $nick *** SYNTAX [TEMPBAN]: !ban <nick> <minutes> [reason] }  
  if ($nick isvoice $chan) {       notice $nick *** SYNTAX [TEMPBAN]: !ban <nick> <minutes> [reason] }    
  if ($nick == $nick) {       notice $nick Sorry, but you are not op/halfop/voice in this channel }      
}  

on *:TEXT:!ban:#: {
  if ($nick == $nick) {       notice $nick Sorry, but you are not op/halfop/voice in this channel to use that command }        
}

Comments

Sign in to comment.
Epic   -  May 02, 2011

:p its all about trying something once or twice then usually someone gives a better option, happens to me all the time ._.

 Respond  
Ahmed Zaggoudi   -  Apr 27, 2011

It's good idea to use ($nick isreg $chan) Epic Jethro_

 Respond  
Ahmed Zaggoudi   -  Apr 27, 2011

I should avoid repetition :

if ($me isop $chan) { notice $nick SYNTAX [TEMPBAN]: !ban [reason] }
if ($nick isop $chan) { notice $nick
SYNTAX [TEMPBAN]: !ban [reason] }
if ($nick ishop $chan) { notice $nick SYNTAX [TEMPBAN]: !ban [reason] }
if ($nick isvoice $chan) { notice $nick
SYNTAX [TEMPBAN]: !ban [reason] }
if ($nick isvoice $chan) { notice $nick *** SYNTAX [TEMPBAN]: !ban [reason] }
if ($nick == $nick) { notice $nick Sorry, but you are not op/halfop/voice in this channel }

 Respond  
Jethro   -  Apr 26, 2011

Epid has a point:

if ($nick !isreg $chan) {
    notice $nick *** SYNTAX [TEMPBAN]: !ban <nick> <minutes> [reason]
  }
  else { 
    notice $nick Sorry, but you are not op/halfop/voice in this channel
  }

You have the same command for !ban. Only the first text event will trigger. You either need to incorporate that into one event or use a different trigger to bypass that. The code routine in your first text event is rather redundant and needing some improvement.

 Respond  
Epic   -  Apr 26, 2011

on the ban help couldnt you make it easier if you just did if ($nick isreg $chan) or ($nick !isreg $chan)? i think thtd be simpler if it worked but idk if "isreg" is proper name for it :s

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.