Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Notes:
- ; - The blacklist.txt file is located in ./scripts/addons, you might want to change the location.
- ; - Put the 'blacklistcheck' alias in the first line of an event to prevent anyone in the blacklist from being able to use it.
- on $1:TEXT:/^[!@](blacklist|bl)(\s|$)/Si:#:{
- if ($nick != op) { notice $nick Access denied. | halt }
- if (!$2) { notice $nick Syntax: !blacklist <add/del/view/empty> [<nick> [reason]] | halt }
- if ($2 == add) {
- if (!$3) { notice $nick Syntax: !blacklist add <nick> [reason] | halt }
- if ($3 isin $read(scripts\addons\blacklist.txt,w,* $+ $3 $+ *)) { notice $nick $+ $3 $+ is already in the blacklist. Use !blacklist view. | halt }
- write scripts\addons\blacklist.txt $3-
- notice $nick Added $+ $3 $+ to blacklist.
- }
- if ($2 == del) {
- if ($lines(scripts\addons\blacklist.txt) == 0) { notice $nick The blacklist is empty. | halt }
- if ((!$3) || ($3 !isnum)) { notice $nick Syntax: !blacklist del <ID> | notice $nick String <ID> is the ID given to a nick. Use !blacklist view. | halt }
- if ($3 > $lines(scripts\addons\blacklist.txt)) { notice $nick There's nobody with the ID $3 on the blacklist. Use !blacklist view. | halt }
- var %i $gettok($read(scripts\addons\blacklist.txt,n,$3),1,32) | write -dl $+ $3 scripts\addons\blacklist.txt
- notice $nick Removed $+ %i $+ from blacklist.
- }
- if ($2 == view) {
- if ($lines(scripts\addons\blacklist.txt) == 0) { notice $nick The blacklist is empty. | halt }
- notice $nick [ID] [nick] [reason]
- var %l $lines(scripts\addons\blacklist.txt) | var %c 1
- while (%c <= %l) {
- notice $nick %c $read(scripts\addons\blacklist.txt,n,%c)
- inc %c
- }
- }
- if ($2 == empty) {
- write -c scripts\addons\blacklist.txt
- notice $nick Blacklist cleaned.
- }
- halt
- }
- alias blacklistcheck {
- if ($nick isin $read(scripts\addons\blacklist.txt,w,* $+ $nick $+ *)) {
- if ($read(scripts\addons\blacklist.txt,s,$nick) == $null) {
- notice $nick You can't use this command! You're on my blacklist. Please contact my owner.
- halt
- }
- notice $nick You can't use this command! You're on my blacklist: $qt($read(scripts\addons\blacklist.txt,s,$nick)) $+ .
- halt
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment