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