Just a little script i made to help making bans. You can ban someone, and set a time for how long they are banned for. When the time is up, the ban will be removed. You can specify your own message, or leave the message part blank, and the kick will have a generic kick message.
How to use:
/b | Bans nickname without auto removing the ban. Reason optional.
/b <s|second|seconds> | Bans nickname for N seconds and then removes the ban. Reason optional.
/b <m|minute|minutes> | Same as before, this time with minutes.
/b <h|hour|hours> | Same as before, this time with hours.
alias b {
if $2 == $null {
/mode $chan +b $address($$1, 2)
/kick $chan $$1 Banned from $chan
}
if ($3 == s) || ($3 == seconds) || ($3 == second) {
/mode $chan +b $address($$1, 2)
timer 1 $$2 /mode $chan -b $address($$1, 2)
if ($4- == $null) {
/kick $chan $$1 Banned from $chan for $$2 Seconds
}
if ($4- != $null) {
/kick $chan $$1 $4-
}
}
if ($3 == m) || ($3 == minutes) || ($3 == minute) {
/mode $chan +b $address($$1, 2)
set %minutes $calc( $$2 * 60)
timer 1 %minutes /mode $chan -b $address($$1, 2)
if ($4- == $null) {
/kick $chan $$1 Banned from $chan for $$2 Minutes
}
if ($4- != $null) {
/kick $chan $$1 $4-
}
/unset %minutes
}
if ($3 == h) || ($3 == hours) || ($3 == hour) {
/mode $chan +b $address($$1, 2)
set %hours $calc( $$2 * 3600)
timer 1 %hours /mode $chan -b $address($$1, 2)
if ($4- == $null) {
/kick $chan $$1 Banned from $chan for $$2 Hours
}
if ($4- != $null) {
/kick $chan $$1 $4-
}
/unset %hours
}
else {
/mode $chan +b $address($$1, 2)
/kick $chan $$1 $2-
}
}
Aucun50, this is not a competition. gooshie was pointing out what can be done to have the script made best suited for commanding purposes. We're definitely not trying to complicate codes for the worst, but to demonstrate various ways that can compose a script. Some people may find it useful or even helpful from codes made by others. The end result is more to gain, less to lose for all of us.
gooshie, your rant is granted, but we're all different in thinking in terms of writing out codes to perform required tasks. Some codes may seem unnecessary or awkward to some people, but to others they may seem like an "easy" button. Aside from the redundancy or iteration of scripting, it explains the reason why MSL is so versatile.
[rant] I never understood the idea of being an op and then having to message another opped bot to perform a action reserved for an op.. seems like juggling or something.. alot going on and going no where fast.. why end it at one event.. why not message bot and then have bot respond back to you then THAT action perform the actual action... maybe even have the two ops have an automated like discussion back and forth for like 3-4 lines each before the action takes place.. really like where does it end?... whats wrong with a simple popup in the nicklist to perform the action?.. nm.. [/rant]
alias kban {
var %t
if $regex($3,/^(s|seconds|second|m|minutes|minute|h|hours|hour)$/i) {
%t = $calc($2 * $replace($left($regml(1),1),s,1,m,60,h,3600))
ban -ku $+ %t # $1 2 $iif($4,$4-,Banned from # for $replace($duration(%t),sec,$chr(32) second,min,$chr(32) minute,hr,$chr(32) hour))
}
else ban -k # $$1 2 $iif($2,$2-,Banned from #)
}