Blacklist Upgraded

By ExternalIRC on Aug 08, 2011

This was upgraded from http://www.hawkee.com/snippet/7584/#c87346. He upgraded it from my computer so im Posting it on Hawkee. And You need to add your own nick to the var %nicks line :) Have fun and Enjoy it Btw i understand this was a rip but i intend to only post it as an upgrade for Dragon_Flare!

On *:Text:*:#:{
  var %nicks 
  tokenize 32 $Strip($1-)
  if ($nick isin %nicks && $nick isop $chan) {
    if ($1 == !Blacklist) { if ($2- == $null) { msg $chan Please specify a nick to be blacklisted $nick $+ . }
      else { writeini -n Blacklist. $+ $chan $+ .ini Blacklisted $2 $2 | msg $chan $2 added to Blacklist. $+ $chan $+ %userlist | mode $chan +b $address($2,1) | mode $chan +b $address($2,2) | mode $chan +b $address($2,3) | mode $chan +b $address($2,4) | mode $chan +b $address($2,5) | mode $chan +b $address($2,6) | mode $chan +b $address($2,7) | mode $chan +b $address($2,8) | mode $chan +b $address($2,9) | mode $chan +b $address($2,10) | kick $chan $2 Blacklisted! }
    }
    elseif ($1 == !Check) { if ($2- == $null) { msg $chan Please specify a nick to Check with the ini file $nick $+ . }
      else { if ($readini(Blacklist. $+ $chan $+ .ini, Blacklisted, $2-) == $null) {  msg $chan $2 is Not Blacklisted }
        else { if ($readini(Blacklist. $+ $chan $+ .ini, Blacklisted, $2-) == $2) { msg $chan $2 is Blacklisted $nick $+ . }
        } 
      }
      else msg $chan No.
    }
    else { Halt }
  }
}
On *:Join:#:{
  if ($readini(Blacklist. $+ $chan $+ .ini, Blacklisted, $nick) == $nick) { msg $chan $nick you are Blacklisted. | msg $chan Enforcing Blacklist. | mode $chan +b $address($nick,1) | mode $chan +b $address($nick,2) | mode $chan +b $address($nick,3) | mode $chan +b $address($nick,4) | mode $chan +b $address($nick,5) | mode $chan +b $address($nick,6) | mode $chan +b $address($nick,7) | mode $chan +b $address($nick,8) | mode $chan +b $address($nick,9) | mode $chan +b $address($nick,10) | kick $chan $readini(Blacklist. $+ $chan $+ .ini, Blacklisted, $nick) Blacklisted! }
}
Alias Blacklist {
  writeini -n Blacklist. $+ $chan $+ .ini Blacklisted $1 $1
  msg $chan $1 added to Blacklist. $+ $chan $+ .ini
  msg $chan Added By mIRC Client.
  mode $chan +b $address($1,2)
  kick $chan $1 Blacklisted.

Comments

Sign in to comment.
ExternalIRC   -  Aug 10, 2011

It was storing it like this in my ini file [ $nick ] = [ $nick ]

 Respond  
Jethro   -  Aug 09, 2011

jaytea has a valid point there. I reckon your experience with MSL outweighs my understanding toward it. :p I'm looking forward to what you have to say in the future.

P.S. I kinda recall the [ being seen as ~ when stored in an INI file before...

 Respond  
jaytea   -  Aug 09, 2011

ini files are not a good choice using them this way. One problem would be if a nick had [ ] in the nick such as nick[afk] or [gta]nick an such.

how do you figure this? he's using the nickname as an item name, not a [section] name. even if it were used as a section name, mIRC will now handle [] brackets in section names the same as any normal acceptable character.

One way I know to get around that is to replace [ ] with an underscore or dash if a user name has them in it.

again, not necessary on current versions of mIRC. even on older versions (before 7.*) mIRC would replace [ and ] in section names with a ~ when adding and retrieving data, so the only time there was an issue was when listing existing entries (how would you know if '~a' was actually '[a' or ']a'?).

$chan could quite easily contain characters that are invalid in filenames, though.

 Respond  
ExternalIRC   -  Aug 09, 2011

See i havent used hash tables or scripted them in about 1 year

 Respond  
Jethro   -  Aug 09, 2011

One way I know to get around that is to replace [ ] with an underscore or dash if a user name has them in it. However, it's troublesome; perhaps convert the use of ini to hash table if you know how.

 Respond  
napa182   -  Aug 09, 2011

ini files are not a good choice using them this way. One problem would be if a nick had [ ] in the nick such as nick[afk] or [gta]nick an such.

 Respond  
ExternalIRC   -  Aug 09, 2011

I didnt make the script i just had him make part of it and i just posted it on here as an upgrade

 Respond  
_Dean_   -  Aug 08, 2011

yes, im aware of that, i just forgot that each server has their own limit

 Respond  
Jethro   -  Aug 08, 2011

Specifically, $modespl returns the maximum allowance limited by your chat server. Some allow consecutive, multiple modes to be set six times or more. On the other hand, some servers restrict the $modespl to be as low as three modes at a time. To find out for certain how many modes your server allow, just enter: //echo -a $modespl

 Respond  
_Dean_   -  Aug 08, 2011

closing Bracket missed, by the way, i dont see a real reason to use 10 kind of bans...

another way to use the entire bans you can use

mode $chan $+(+,$str(b,$modespl)) $regsubex($str($chr(32),7),//g,$address($nick,\n))

$modespl using this method will only return 6 kind of bans, which i think its enough

 Respond  
Jethro   -  Aug 08, 2011

This script, I must say, is not well written and thought out. There are quite a few redundancies in the snippet.

It's based upon $nick, so if he or she changes their nicknames after being put on blacklist. The script won't detect them. I find it absurd to ban the offender's mask from 1 to 10. :/ Your ban list is going to get jammed very fast.

At any rate,

This:> mode $chan +b $address($nick,1)
mode $chan +b $address($nick,2)
mode $chan +b $address($nick,3)
mode $chan +b $address($nick,4)
mode $chan +b $address($nick,5)
mode $chan +b $address($nick,6)
mode $chan +b $address($nick,7)
mode $chan +b $address($nick,8)
mode $chan +b $address($nick,9)
mode $chan +b $address($nick,10)
kick $chan $readini(Blacklist. $+ $chan $+ .ini, Blacklisted, $nick) Blacklisted!can be shortened extensively to:

var %b = 1
while (%b <= 10) {
ban -k # $readini(Blacklist. $+ $chan $+ .ini, Blacklisted, $nick) %b Blacklisted!
inc %b
 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.