Simple shitlist popup:
add shitlisted hostmask
del shitlisted hostmask
look at the list of shitlisted hostmasks
delete all shitlisted hostmasks
maybe a good feature: on unload the script deletes itself and the shitlist table from memory and from mircdir.
Very easy to use.
Doesn't allow adding a hostmask to shitlist if there is 10 or more users found matching the mask..
#############################
# Script : Shitlist #
# Author : Shitbreak #
# Network : QuakeNet #
# Channel : #Servicebot #
# Year : 2008 #
#############################
on *:load:{
echo 2 -a * You have succesfully loaded shitlist script by shitbreak.
echo 2 -a * Checking for the shitlist table...
if (!$hget(shitlist)) {
echo 2 -a * Shitlist table does not exist.
hmake shitlist
echo 2 -a * Made the table shitlist.
}
if ($exists(shitlist.hsh)) {
hload shitlist shitlist.hsh
echo 2 -a * Loaded shitlist table.
}
if (!$exists(shitlist.hsh)) {
hsave shitlist shitlist.hsh
echo 2 -a * Shitlist table was not found from $mircdir $+ : It is now saved there.
}
}
on *:unload:{
echo 2 -a * Thank you for using the shitlist snippet.
if ($hget(shitlist)) { .hfree shitlist }
if ($exists(shitlist.hsh)) { .remove shitlist.hsh }
.remove $+(",$script,")
echo 2 -a * Shitlist is now removed and the script. Shitlist table is already removed from memory.
}
on *:start:{
echo 2 -a * Checking for the shitlist table...
if (!$hget(shitlist)) {
echo 2 -a * Shitlist table does not exist.
hmake shitlist
echo 2 -a * Made the table shitlist.
}
if ($exists(shitlist.hsh)) {
hload shitlist shitlist.hsh
echo 2 -a * Loaded shitlist table from $mircdir $+ .
}
if (!$exists(shitlist.hsh)) {
hsave shitlist shitlist.hsh
echo 2 -a * Shitlist table was not found from $mircdir $+ : It is now saved there.
}
}
on *:disconnect:{
if (!$hget(shitlist)) {
echo 2 -a * Shitlist table not loaded, we are not saving it.
}
if ($hget(shitlist)) {
hsave shitlist shitlist.hsh
echo 2 -a * Shitlist table is now saved to $mircdir
}
}
on *:exit:{
if ($hget(shitlist)) { hsave shitlist shitlist.hsh }
}
menu channel {
...Shitlist by shitbreak
..Add user:{
set %mask $$?="Hostname for the user"
if ($hget(shitlist,%mask)) { echo 2 -a * Error adding mask %mask to the shitlist: Mask is already shitlisted. }
if (!$hget(shitlist,%mask)) {
if ($ial(%mask,0) >= 10) { echo 2 -a * Error adding mask %mask to the shitlist: There are too many ( $+ $ial(%mask,0) $+ ) users matching the mask. }
if ($ial(%mask,0) < 10) {
set %reason $$?"Reason to be shitlisted?" | hadd shitlist %mask Shitlisted: %reason | echo 2 -a * Added mask %mask to the shitlist. | kickchannels %mask %reason }
}
}
..Del user:{
var %mask $$?"Mask to be removed from shitlist"
if (!$hget(shitlist,%mask)) { echo 2 -a * Error removing mask %mask from the shitlist: That mask is not shitlisted. }
if ($hget(shitlist,%mask)) { hdel shitlist %mask | echo 2 -a * Mask %mask was succesfully removed from shitlist. }
}
..Shitlist list:{
if ($hfind(shitlist,*,0,w) == 0) { echo 2 -a * Error: Shitlist is empty. }
if ($hfind(shitlist,*,0,w) > 0) {
var %i = 1
while (%i <= $hfind(shitlist,*,0,w)) {
echo -a ID: ( $+ %i $+ ) Mask: $hfind(shitlist,*,%i,w) Reason: $hget(shitlist,$hfind(shitlist,*,%i,w))
inc %i
}
}
}
..Delete all shitlist entries:{
if ($hfind(shitlist,*,0,w) == 0) { echo 2 -a * Error deleting all shitlisted masks: The shitlist is empty. }
if ($hfind(shitlist,*,0,w) > 0) {
echo 2 -a $hfind(shitlist,*,0,w) shitlisted entries will be removed.
var %i = $hfind(shitlist,*,0,w)
while (%i) {
if ($hfind(shitlist,*,%i,w)) { var %rm = $hfind(shitlist,*,%i,w) | hdel shitlist $hfind(shitlist,*,%i,w) | echo 2 -a Removed shitlist entry: %rm }
dec %i
}
}
}
}
alias kickchannels {
if ($ial($1,0) == 0) { echo 2 -a * There are no masks mathing $1 on any channels. }
if ($ial($1,0) > 0) {
var %i $chan(0)
while (%i) {
var %x $nick($chan(%i),0)
while (%x) {
if ($1 iswm $address($nick($chan(%i),%x),5)) && ($me isop $chan(%i)) { mode $chan(%i) -o+b $nick($chan(%i),%x) $1 | kick $chan(%i) $nick($chan(%i),%x) Shitlisted: $2- | echo -a * ( $+ $date $+ ) ( $+ $time $+ ) $+ : Kicked shitlisted user ' $+ $nick($chan(%i),%x) $+ ' from $chan(%i) $+ . }
dec %x
}
dec %i
}
}
}
on *:join:#:{
if ($hfind(shitlist,*,0,w) > 0) {
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
}
}
}