global blacklist

Paste Your small code(s) here, ex. small aliases, identifiers

global blacklist

Postby PuNkTuReD » Sun Jan 04, 2009 9:12 am

simple global blacklist for a bot

!blacklist add/del/list nick/mask

** nick when adding
** mask when deleting

will ban the nick on any channel you are op on

* remember to replace YOUR_NICK with "your nick"
* on line 2

if ($nick == YOUR_NICK) {


Code: Select all
on *:text:*:*: {
if ($nick == YOUR_NICK) {
  if ($strip($1) == !blacklist) {
    if ($2 == $null) { msg $chan  Usage:  $1 add/del/show <nick> }
    if ($2 == add) { set  -u5 %bannick $3 | globalban | .msg $chan Blacklisting $address($3,2) | write blacklist.txt $address($3,2) }
    if ($2 == del) { set %bannick $3 | globalunban | .msg $chan Deleting $3 | write -dw $+ * $+ $3 $+ * blacklist.txt }
    if ($2 == list) { showblacklist }
    }
  }
}
alias showblacklist {
  var %a = $lines(blacklist.txt)
  while (%a) {
    .msg $chan %a $read(blacklist.txt, %a)
    dec %a
  }
}
alias globalban {
  var %a = $chan(0)
  while (%a) {
    if ($me isop $chan(%a)) { mode $chan(%a) +b $address($($+(%,bannick),2),2) Global BlackList | dec %a }
    else { dec %a }
  }
}
alias globalunban {
  var %a = $chan(0)
  while (%a) {
    if ($me isop $chan(%a)) { mode $chan(%a) -b $($+(%,bannick),2) | dec %a }
    else { dec %a }
  }
}
PuNkTuReD
 

Return to Mirc Scripting Snippets

Who is online

Users browsing this forum: No registered users and 1 guest

cron