on *:TEXT:!blacklist*:#:{ if ($2) { write BlackList.txt $iif($2 ison $active,$address($2,2),$2) write BlackListReason.txt $2- notice $nick [Blacklist] Successfully written $2 to blacklist. Reason: $3- | I have globally banned $address($2,2) for reason: $3- if ($2 ison $active) { if (($me !isop $active) && ($me !ishop $active)) || (*Q* iswmcs $chan($active).mode) || (($me ishop $chan(%x)) && ($nick($chan(%x),%y) isop $chan(%x))) echo -st I cannot kick $1 from $active $+ ! else ban -ku1800 $active $1 2 [Blacklisted] Reason: $iif($2,$2-,Unspecified) $kickc } } else { write BlackList.txt $iif($2 ison $active,$address($2,2),$2) write BlackListReason.txt Null notice $nick [Blacklist] Successfully written $2 to blacklist. No reason specified. if ($2 ison $active) { if (($me !isop $active) && ($me !ishop $active)) || (*Q* iswmcs $chan($active).mode) || (($me ishop $chan(%x)) && ($nick($chan(%x),%y) isop $chan(%x))) echo -st I cannot kick $1 from $active $+ ! else ban -ku1800 $active $2 2 [Blacklisted] Reason: $iif($3,$3-,Unspecified) $kickc } } } on *:TEXT:!unblacklist*:#:{ if (!$2) { notice $nick [Blacklist] Error: Invalid syntax. Use: !unblacklist
. | halt } if ($read(Blacklist.txt,w,$address($2,2))) || ($read(Blacklist.txt,w,$2)) || ($read(Blacklist.txt,w,$($+(%Address.,$2),2))) { notice $nick [Blacklist] $2 was found on the blacklist on line $readn $+ . Match: $read(BlackList.txt,$readn) $+ . notice $nick [Blacklist] Blacklist reason: $iif($read(BlackListReason.txt,$readn) == Null,Unspecified,$read(BlackListReason.txt,$readn)) | /yes set %B $readn } else echo -ta [Blacklist] Sorry: $1 was not found on the blacklist. } alias yes { if (%B) { set -u600 %r $read(BlackList.txt,%B) set -u600 %rr $read(BlackListReason.txt,%B) echo -ta [Blacklist] Deleting: $read(BlackList.txt,%B) With reason: $iif($read(BlackListReason.txt,%B) == Null,Unspecified,$read(BlackListReason.txt,%B)) from the blacklist. write -dl [ $+ [ %B ] ] BlackList.txt write -dl [ $+ [ %B ] ] BlackListReason.txt unset %B GlobalUnban $iif($chr(64) !isin $read(BlackList.txt,%B),$address($v2,2),$v2) } else echo -ta [Blacklist] Error: No blacklist set to delete. Try /bldel
. } on *:TEXT:!bllist*:#:{ msg $nick [Blacklist] Blacklisted user list $+([,,$lines(BlackList.txt),/,$lines(BlackListReason.txt),]:) (Latest first) if ($lines(BlackList.txt) == 0) notice $nick [Blacklist] None. else { var %la = $lines(BlackList.txt) var %lc = $lines(BlackList.txt) while (%lc >= 1) { notice $nick $+([,$calc((%la - %lc) + 1),]) User: $read(BlackList.txt,%lc) Reason: $iif($read(BlackListReason.txt,%lc) == Null,Unspecified,$read(BlackListReason.txt,%lc)) dec %lc } } } on *:TEXT:!blistinfo*:#:{ { var %x = 1, %z = 0, %w = 0 while (%x <= $chan(0)) { var %y = 1 while (%y <= $nick($chan(%x),0)) { if ($read(Blacklist.txt,w,$nick($chan(%x),%y))) || ($read(Blacklist.txt,w,$address($nick($chan(%x),%y),2))) { var %q = $readn inc %z notice $nick /!\ Blacklist match: Channel: $chan(%x) Nick: $nick($chan(%x),%y) Match: $ifmatch if ($me !isop $chan(%x)) && ($me !ishop $chan(%x)) || (*Q* iswmcs $chan($chan(%x)).mode) || (($me ishop $chan(%x)) && ($nick($chan(%x),%y) isop $chan(%x))) echo -s I cannot kick $nick($chan(%x),%y) from $chan(%x) $+ ! else ban -ku300 $chan(%x) $nick($chan(%x),%y) 2 [Blacklisted] Reason: $iif($read(BlackListReason.txt,%q) == Null,Unspecified,$read(BlackListReason.txt,%q)) } inc %w inc %y } inc %x } notice $nick Finished checking %w users on $chan(0) $+ $iif($chan(0) == 1,channel,channels) $+ , blacklists found: %z } on *:TEXT:!globalunban*:#:{ if (!$1) halt var %x = 1, %z = 0 while (%x <= $chan(0)) { if ($me isop $chan(%x)) || ($me ishop $chan(%x)) mode $chan(%x) -b $2 inc %x } notice $nick Globally unbanned $2 } on *:TEXT:!blistcomms*:#:{ msg $nick [Blacklist] Blacklists found: $+([,,$lines(BlackList.txt),/,$lines(BlackListReason.txt),].) msg $nick [Blacklist] Commands: !blcklist
, !unblacklist
, !Bllist. }