Someone wanted me to make a shitlist snippet in a dialog.
The truth is I have never used dialogs, so don't be too cruel ;)
Rightclick in a channel window and select "shitlist by shitbreak" to open the shitlist dialog.
To enable the shitlist check "Enabled".
Any suggestions? Give me a comment or PM me on irc: I irc in QuakeNet network.
on *:load:{
if (!$hget(shitlist)) { hmake shitlist }
if ($exists(shitlist.hsh)) { hload shitlist shitlist.hsh }
echo -a * You have succesfully loaded the shitlist script made by shitbreak. Rightclick in a channel window and click "shitlist by shitbreak" to open the dialog. Hopefully you enjoy this snippet.
}
on *:disconnect:{
if ($hget(shitlist)) { hsave shitlist shitlist.hsh }
}
on *:exit:{
if ($hget(shitlist)) { hsave shitlist shitlist.hsh }
}
menu channel {
Shitlist by shitbreak:/dialog -m slist slist
}
dialog slist {
title "Shitlist by shitbreak"
size -1 -1 246 135
option dbu
list 1, 1 22 98 63, size
text "Shitlisted hostmasks", 2, 19 10 50 8
edit "", 3, 1 118 200 11
button "Refresh ", 4, 205 118 37 12
button "Edit", 5, 205 103 37 12, disable
button "Remove", 6, 205 88 37 12, disable
text "Set a reason or edit the reason", 7, 2 110 169 8
list 8, 103 22 46 63, size
text "Channels", 9, 105 11 50 8
text "Nicks", 11, 157 11 50 8
edit "", 12, 1 97 199 11
text "Hostmask - can be edited", 13, 3 89 169 8
button "Add", 14, 205 73 37 12
radio "Enabled", 15, 204 52 50 10
radio "Disabled", 16, 204 39 50 10
list 10, 154 22 46 63, size
}
on *:DIALOG:slist:init:*: shit_update
alias shit_update {
did -r slist 1
did -r slist 8
did -r slist 12
did -r slist 3
did -b slist 5
did -b slist 6
if (%shitlist) { did -c slist 15 | did -u slist 16 }
if (!%shitlist) { did -c slist 16 | did -u slist 15 }
if ($hfind(shitlist,*,0,w) > 0) {
var %i = 1
while (%i <= $hfind(shitlist,*,0,w)) {
did -a slist 1 $hfind(shitlist,*,%i,w)
inc %i
}
}
var %i = 1
while (%i <= $chan(0)) {
did -a slist 8 $chan(%i)
inc %i
}
}
alias slist { dialog -mod slist slist }
on *:dialog:slist:sclick:*:{
if ($did == 1) {
did -r slist 3
did -r slist 12
did -a slist 3 $hget(shitlist,$did(1).seltext)
did -a slist 12 $did(1).seltext
did -e slist 5
did -e slist 6
}
if ($did == 4) shit_update
if ($did == 10) {
did -r slist 12
did -a slist 12 $iif($address($did(10).seltext,5),$address($did(10).seltext,5),$+($did(10).seltext,*!*@*))
}
if ($did == 8) {
did -r slist 10
var %i = 1
while (%i <= $nick($did(8).seltext,0)) {
did -a slist 10 $nick($did(8).seltext,%i)
inc %i
}
}
if ($did == 12) && ($did(1).seltext != $null) {
did -e slist 5
}
if ($did == 15) {
did -c slist 15
did -u slist 16
set %shitlist 1
}
if ($did == 16) {
did -c slist 16
did -u slist 15
unset %shitlist
}
if ($did == 5) {
if ($did(slist,12) == $null) || ($did(slist,3) == $null) { noop $input(Mask or reason is not set,uho,Error) }
if ($did(slist,12) != $null) && ($did(slist,3) != $null) {
hdel shitlist $did(slist,1).seltext
hadd shitlist $did(slist,12) $did(slist,3)
var %mask $did(slist,12), %reason $did(slist,3)
shit_update
if ($ial(%mask,0) == 0) { echo 2 -a * There are no masks mathing %mask on any channels. }
if ($ial(%mask,0) > 0) && (%shitlist) {
echo -a Jatketaan 2
var %i $chan(0)
while (%i) {
var %x $nick($chan(%i),0)
while (%x) {
if (%mask iswm $address($nick($chan(%i),%x),5)) && ($me isop $chan(%i)) { mode $chan(%i) -o+b $nick($chan(%i),%x) %mask | kick $chan(%i) $nick($chan(%i),%x) Shitlisted: %reason | echo -a * ( $+ $date $+ ) ( $+ $time $+ ) $+ : Kicked shitlisted user ' $+ $nick($chan(%i),%x) $+ ' from $chan(%i) $+ . }
dec %x
}
dec %i
}
}
}
}
if ($did == 6) {
if ($did(1).seltext == $null) { noop $input(There was no mask to be removed,uho,Error) }
elseif ($did(1).seltext != $null) {
hdel shitlist $did(1).seltext
noop $input($did(1).seltext was removed from the shitlist,uho,shitlist)
shit_update
}
}
if ($did == 14) {
if ($did(slist,12) != $null) && ($did(slist,3).text != $null) {
hadd shitlist $did(slist,12) $did(slist,3)
noop $input($did(slist,12) shitlisted with reason: $did(slist,3),uho,Shitlist)
var %mask $did(slist,12), %reason $did(slist,3)
shit_update
if ($ial(%mask,0) == 0) { echo 2 -a * There are no masks mathing %mask on any channels. }
if ($ial(%mask,0) > 0) && (%shitlist) {
var %i $chan(0)
while (%i) {
var %x $nick($chan(%i),0)
while (%x) {
if (%mask iswm $address($nick($chan(%i),%x),5)) && ($me isop $chan(%i)) { mode $chan(%i) -o+b $nick($chan(%i),%x) %mask | kick $chan(%i) $nick($chan(%i),%x) Shitlisted: %reason | echo -a * ( $+ $date $+ ) ( $+ $time $+ ) $+ : Kicked shitlisted user ' $+ $nick($chan(%i),%x) $+ ' from $chan(%i) $+ . }
dec %x
}
dec %i
}
}
}
elseif ($did(slist,12) == $null) || ($did(slist,3) == $null) { noop $input(You forgot to set a reason or mask was missing,uho,Error) }
}
}
on *:join:#:{
if ($hfind(shitlist,*,0,w) > 0) && (%shitlist) {
var %i = $hfind(shitlist,*,0,w)
while (%i) {
if ($hfind(shitlist,*,%i,w) iswm $fulladdress) { mode $chan +b $hfind(shitlist,*,%i,w) | kick $chan $nick $hget(shitlist,$hfind(shitlist,*,%i,w)) | echo -a * ( $+ $date $+ ) ( $+ $time $+ ): Shitlisted user ' $+ $nick $+ ' joined $chan $+ . }
dec %i
}
}
}
What is a better place to get the needed comments; what\'s good, what needs to be improved, what ahould be added and so on than hawkee.com?
The script is not update for the previous blacklist script as this script uses dialogs, previous doesn\'t. I\'d rather delete the previous script and add this not \"update\" it.
I don\'t know why you post scripts here, if you don\'t do it because of feedback.