Timed Kick Ban Alias

By MagicRevealer09 on Apr 15, 2010

Just a simple script that will kick ban a user for a certain amount of minutes...

Syntax:

/tb

alias tb {
  ban -ku $+ $calc($2 * 60) $chan $1 2 BANNED! User has been banned from $chan for $2 minutes. Reason: $3-
}

Comments

Sign in to comment.
WorldDMT   -  Apr 16, 2010

yeah about "$me is op or halfop" so i edit the code and i added $nick(#,$me,oh) ;)

More
 Respond  
Jethro   -  Apr 15, 2010

Well, the reason I didn't mention the op check is that, almost 95% of the time (the remaining 5% is people forgot to get themselves as ops. :P) you're opped, or else you wouldn't have made this alias to kick and ban people, correct? ;)

But I suppose it wouldn't hurt to add it. =) Thanks WorldDMT for the suggestion. :D

Wait, I meant to say that I have to make sure myself is opped too...lol

if ($me isop #) {

But I'd kick or ban ops if they acted like a bunch of mischievous dickheads. :P

More
 Respond  
WorldDMT   -  Apr 15, 2010

@jethro_: check if $1 is OP or not

alias tb if ($nick(#,$me,oh) && $nick(#,$1,vr) && $2 isnum) ban -ku $+ $calc($2 * 60) # $1 2 BANNED! User has been banned from # for $2 minutes. $iif($3,Reason: $3-)
More
 Respond  
Jethro   -  Apr 15, 2010

alias tb { ban -ku $+ $calc($2 * 60) $chan $$1 2 BANNED! User has been banned from $chan for $2 minutes. Reason: $3- }This will make sure you have provided the $1 before the alias shall trigger, so that you won't get an error when you just enter /tb without the $1.

Or you can use a check:> alias tb { if ($1 ison $chan) { ban -ku $+ $calc($2 * 60) $chan $1 2 BANNED! User has been banned from $chan for $2 minutes. Reason: $3- } }This will ensure that you've specified a nick to ban and that he or she must be on channel and their names shall match. This will prevent unnecessary typos or misspellings before the alias triggers.

More
 Respond  
MagicRevealer09   -  Apr 15, 2010

@Jetro_ I kind of get it, could you quote the code?

More
 Respond  
Jethro   -  Apr 15, 2010

You should make your $1 a double $$1 to make sure it's supplied, or make a check to see if the user you want to ban is on the channel. This way you won't get an error for "* /ban:no such user 2" when you enter the command /tb.

More
 Respond  
MagicRevealer09   -  Apr 15, 2010

Improvments Welcome!

More
 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.