Unban scipt for bot (!ub)

By Un1qu3 on Dec 10, 2011

Screenshots

This is snippet for bot to delete a specific ban on chan via command. Use it as: "!ub ban-mask".
Ex: !ub !ident@*.com

; unban script by un1qu3
on @*:text:!ub *:#:{
  if ($nick == ur nick) {
    if ($2 isban #) {
      mode # -b $2
    }
  }

Comments

Sign in to comment.
Jethro   -  Dec 11, 2011

You may use the && operator to save yourself an if statement:

on @*:text:!ub *:#:{
  if ($nick == ur nick) && ($2 isban #) {
    mode # -b $2
  }
}
 Respond  
Jethro   -  Dec 10, 2011

lol I thought you said "Personal rabbit." Then when I looked at it closely, I realized it was a typo. :P

 Respond  
Frenetic   -  Dec 10, 2011

Yeah Jethro, Personal habbit. Lol.

 Respond  
Un1qu3   -  Dec 10, 2011

@Jethro
I edit it but anyway there is conditional for nick who can use command :D

 Respond  
Jethro   -  Dec 10, 2011

Frenetic, compacting the code does not actually shorten it. You basically stacked it up in one line. I won't advise people to practice MSL in that fashion. It makes hard to debug and, mind you, ugly and disorganized.

 Respond  
Jethro   -  Dec 10, 2011

You have to make sure the $2 is banned in the channel, otherwise people can enter garbage to mess with it:

on @*:text:!ub *:#:{
  if ($2 isban #) {
    mode # -b $2
  }
}
 Respond  
Frenetic   -  Dec 10, 2011
on *:TEXT:!ub*:#: { if ($nick == YourNick)  { mode $chan -b $2 } }

Can shorten it.

 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.