Well this is my first snippet - in fact first anything - that I have posted here. I decided to give something back to the community that has helped me so much over the last couple of months.
This script creates a menu which will list all the recent bans that have occured in the channels you are HALFOP OR OP in, and when clicked will unban the address.
Preview:
I know this is a relatively clumsy script in how it is written. It was whipped up very quickly and I am aware that it could be made much shorter by while loops and hash tables, but to be quite frank - I just couldn't be bothered!
Load into remotes, then right click in a channel. As the bans occur, items will be added to the menu.
Comments and constructive criticism MUCH appreciated as this is my first (posted) script!
; Created by Chessnut
Menu channel,status {
Unban
.$read(recban.txt,1) $duration($calc($ctime - $read(recban.txt,2))) $read(recban.txt,3) $+ : $+ $read(recban.txt,4)
.$read(recban.txt,5) $duration($calc($ctime - $read(recban.txt,6))) $read(recban.txt,7) $+ : $+ $read(recban.txt,8)
.$read(recban.txt,9) $duration($calc($ctime - $read(recban.txt,10))) $read(recban.txt,11) $+ : $+ $read(recban.txt,12)
.$read(recban.txt,13) $duration($calc($ctime - $read(recban.txt,14))) $read(recban.txt,15) $+ : $+ $read(recban.txt,16)
.$read(recban.txt,17) $duration($calc($ctime - $read(recban.txt,18))) $read(recban.txt,19) $+ : $+ $read(recban.txt,20)
}
on *:LOAD:{
if ($lines(recban.txt) == 0) {
write -l1 recban.txt No bans since
write -l2 recban.txt $ctime
write -l3 recban.txt
write -l4 recban.txt
}
if ($lines(recban.txt) == 4) {
write -l5 recban.txt No bans since
write -l6 recban.txt $ctime
write -l7 recban.txt
write -l8 recban.txt
}
if ($lines(recban.txt) == 8) {
write -l9 recban.txt No bans since
write -l10 recban.txt $ctime
write -l11 recban.txt
write -l12 recban.txt
}
if ($lines(recban.txt) == 12) {
write -l13 recban.txt No bans since
write -l14 recban.txt $ctime
write -l15 recban.txt
write -l16 recban.txt
}
if ($lines(recban.txt) == 16) {
write -l17 recban.txt No bans since
write -l18 recban.txt $ctime
write -l19 recban.txt
write -l20 recban.txt
}
}
on *:BAN:#:{
if ($me isop $chan) || ($me ishop %chan) {
write -il1 recban.txt $banmask set by $nick
write -il2 recban.txt $ctime
write -il3 recban.txt ago in $chan
write -il4 recban.txt mode $chan -b $banmask
if ($lines(recban.txt) > 40) {
write -dl44 recban.txt
write -dl43 recban.txt
write -dl42 recban.txt
write -dl41 recban.txt
}
}
}
on *:UNBAN:#:{
if ($read(recban.txt, s, $banmask) != $null) {
set %recdel $readn
write -dl $+ [ $calc(%recdel + 3) ] recban.txt
write -dl $+ [ $calc(%recdel + 2) ] recban.txt
write -dl $+ [ $calc(%recdel + 1) ] recban.txt
write -dl $+ [ %recdel ] recban.txt
unset %recdel
if ($lines(recban.txt) == 0) {
write -l1 recban.txt No bans since
write -l2 recban.txt $ctime
write -l3 recban.txt
write -l4 recban.txt
}
if ($lines(recban.txt) == 4) {
write -l5 recban.txt No bans since
write -l6 recban.txt $ctime
write -l7 recban.txt
write -l8 recban.txt
}
if ($lines(recban.txt) == 8) {
write -l9 recban.txt No bans since
write -l10 recban.txt $ctime
write -l11 recban.txt
write -l12 recban.txt
}
if ($lines(recban.txt) == 12) {
write -l13 recban.txt No bans since
write -l14 recban.txt $ctime
write -l15 recban.txt
write -l16 recban.txt
}
if ($lines(recban.txt) == 16) {
write -l17 recban.txt No bans since
write -l18 recban.txt $ctime
write -l19 recban.txt
write -l20 recban.txt
}
}
}
I love this little beauty you can kick someone and then click in the channel and bang you can unban them right there just as quick as you you kicked them its great for wars with other ops which is about the only time I use it. Every now and again I have to useit in one of the TV rooms if SpamServ or ChanServ Goes Postal cuz peeps get torked when those bots go off the farm!!! Anyway I\'m givinh a 10/10 Keep up the good work.
very very good script, well written. good job. if you use mIRC however, if you double click the main channel screen, it retrieves the channel modes and bans set etc. you can edit, add, or remove bans, set topics etc from that. dunno if you were aware or not or if it is specific server only (IE Chanserv,Nickserv operating on them)
Please make the image shorter, with <a href=\"http://domain.com/image.jpg\"> <img src=\"http://domain.com/image.jpg\" width=\"x\" height=\"x\" border=\"0\"> to don`t stretch the hawkees design.
About the script, its ok, but i would use different techniques.