global blacklist

By PuNkTuReD on Dec 28, 2008

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) {

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 }
  }
}

Comments

Sign in to comment.
`Green   -  Dec 29, 2008

yeah they would. you are right lol :)

 Respond  
PuNkTuReD   -  Dec 29, 2008

there is but if you add this to a bot that uses something like

if ($nick == %owner) {

or user levels even, then i would have to add that into the bot

as there is thousands of bots and everyone uses a different method for recognising the owner, its easier to make a code this way.

also if $nick was used then anyone would be able to access the command
which is not recommended

 Respond  
`Green   -  Dec 28, 2008

lol i know that. that why i'mlost and i can't think of a way to do it with out using YOUR_NICK. there has to be a way. but /me is to lazy to even try

 Respond  
Aucun50   -  Dec 28, 2008

`Green if $me was used then it would return as the bots nick not yours, if you used $nick then it wouldn't make any scene "if ($nick == $nick)"?

 Respond  
`Green   -  Dec 28, 2008

then cant you use $nick?

i'm so lost on how it works. and i'm to lazy to test it :)

 Respond  
PuNkTuReD   -  Dec 28, 2008

not if its being used in a bot
$me would return the bots nick not yours

 Respond  
`Green   -  Dec 28, 2008

hmm. PunkTuReD can't you just use $me for YOUR_NICK

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.