matthijs186

mIRC Blacklist command

Dec 23rd, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. ; Notes:
  2. ; - The blacklist.txt file is located in ./scripts/addons, you might want to change the location.
  3. ; - Put the 'blacklistcheck' alias in the first line of an event to prevent anyone in the blacklist from being able to use it.
  4.  
  5. on $1:TEXT:/^[!@](blacklist|bl)(\s|$)/Si:#:{
  6. if ($nick != op) { notice $nick Access denied. | halt }
  7. if (!$2) { notice $nick Syntax: !blacklist <add/del/view/empty> [<nick> [reason]] | halt }
  8. if ($2 == add) {
  9. if (!$3) { notice $nick Syntax: !blacklist add <nick> [reason] | halt }
  10. if ($3 isin $read(scripts\addons\blacklist.txt,w,* $+ $3 $+ *)) { notice $nick  $+ $3 $+  is already in the blacklist. Use !blacklist view. | halt }
  11. write scripts\addons\blacklist.txt $3-
  12. notice $nick Added  $+ $3 $+  to blacklist.
  13. }
  14. if ($2 == del) {
  15. if ($lines(scripts\addons\blacklist.txt) == 0) { notice $nick The blacklist is empty. | halt }
  16. 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 }
  17. if ($3 > $lines(scripts\addons\blacklist.txt)) { notice $nick There's nobody with the ID $3 on the blacklist. Use !blacklist view. | halt }
  18. var %i $gettok($read(scripts\addons\blacklist.txt,n,$3),1,32) | write -dl $+ $3 scripts\addons\blacklist.txt
  19. notice $nick Removed  $+ %i $+  from blacklist.
  20. }
  21. if ($2 == view) {
  22. if ($lines(scripts\addons\blacklist.txt) == 0) { notice $nick The blacklist is empty. | halt }
  23. notice $nick [ID] [nick] [reason]
  24. var %l $lines(scripts\addons\blacklist.txt) | var %c 1
  25. while (%c <= %l) {
  26. notice $nick %c $read(scripts\addons\blacklist.txt,n,%c)
  27. inc %c
  28. }
  29. }
  30. if ($2 == empty) {
  31. write -c scripts\addons\blacklist.txt
  32. notice $nick Blacklist cleaned.
  33. }
  34. halt
  35. }
  36. alias blacklistcheck {
  37. if ($nick isin $read(scripts\addons\blacklist.txt,w,* $+ $nick $+ *)) {
  38. if ($read(scripts\addons\blacklist.txt,s,$nick) == $null) {
  39. notice $nick You can't use this command! You're on my blacklist. Please contact my owner.
  40. halt
  41. }
  42. notice $nick You can't use this command! You're on my blacklist: $qt($read(scripts\addons\blacklist.txt,s,$nick)) $+ .
  43. halt
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment