I got bored and decided to make this
if you type !BNick nickhere it will add the selected nick the the badnicks ini file and when someone goes to change your bot to a nick that is in the Badnick.ini it will not allow them to
if you want to change the name of the ini file change this part of the script
writeini Badnick.ini Badnicks $2 $2
Badnick.ini Badnicks
Leave
$2 $2 on the end of the script
On *:Text:!BNick*:#:{
writeini Badnick.ini Badnicks $2 $2
msg $chan 4,1 $+ $2 added To The BadNick ini File
}
On *:Text:!Nick*:#:{
%var = $readini(Badnick.ini,Badnicks,$2)
if %var = $2 { Msg $chan 4,1Failed Attempt By $nick With Command !Nick Reason: Inappropriate nick Failed Nick ( $2 ) }
else { msg $chan 4,1Authorized nick Changing nick to ( $2 ) | nick $2 }
}
Hash tables are stored locally in your RAM, not in the hard disk... unlike INI files. Therefore, they're practically faster, because our PCs can access RAM quicker. ini file is pretty decent for general settings. Anything other than that, use variables. If you need more organization, use hash tables. Again, variables, text Files, and INI Files are all stored on the computer's hard drive.
Aucun50 [quote] omfg no hash tables you nubs! TXT FILE WORKS HERE NO NEED FOR HASH TABLE FFS! IT'S A LIST WOW DOESN'T NEED TO BE IN ANY ORDER FFS! [/quote]
He is right Hash tables are not needed here it is just a list
Why have it on a hash table does it matter how it is scripted it works dont it
Silo [quote] Chill out, man. Horses for courses. I'm new to hash stuff, but it's way faster to process. [/quote]
Hash tables and Inis Are both good ways of scripting
I prefer the use of a hash table for this sort of operation:
on *:START:bn
on *:CONNECT:bn
on *:EXIT:hsave b b.hsh
alias -l bn {
if (!$hget(b)) { hmake b 100 }
if ($isfile($qt($scriptdirb.hsh))) { hload b $qt($scriptdirb.hsh) }
}
on $*:TEXT:/!(\w+)\s(\S+)/iS:#: {
if ($regml(1) = bnick) {
hadd -m b n $addtok($hget(b,n),$regml(2),32) | .msg # 4,1 $+ $regml(2) added to the hash file!
}
elseif ($regml(1) = nick) && (!$istok($hget(b,n),$regml(2),32)) {
.msg # 4,1Failed Attempt By $nick With $1 Reason: Inappropriate nick Failed Nick ( $regml(2) )
}
else { msg # 4,1 $+ Authorized nick changing nick to: $regml(2) | nick $regml(2) }
}