mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: from txt to hash [Re: Crinul] #203716 24/08/08 11:26 PM
Joined: Jul 2006
Posts: 3,585
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,585
Ah Ah, i've made some test, and $eval is really much faster wink


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: from txt to hash [Re: Crinul] #203720 24/08/08 11:47 PM
Joined: Nov 2006
Posts: 143
X
xyzzy Offline OP
Vogon poet
OP Offline
Vogon poet
X
Joined: Nov 2006
Posts: 143
!bwadd word
adding the words in badwords.txt
the code i gave bans if words added as
word1
word2
word3
but the command !bwadd words abreast
like word1|word2|word3
Code:
on @*:text:*:#:{if $nick isreg # { var %k = 1,%kk = $lines(badwords.txt) | while %k <= %kk { if $+(*,$read(badwords.txt,%k),*) iswm $1- { ban -ku600 $chan $nick 2 Bad word detected out out > $read(badwords.txt,%k) | return $true } | inc %k } | return $false }

so this not works if words added like this word1|word2|word3

Last edited by xyzzy; 24/08/08 11:47 PM.
Re: from txt to hash [Re: RusselB] #262852 13/04/18 06:21 PM
Joined: Apr 2018
Posts: 24
T
Tano Offline
Ameglian cow
Offline
Ameglian cow
T
Joined: Apr 2018
Posts: 24
Hello guys, any suggestion how to make this hash badword to give ban to hostmask of user when is match the badword,
and how to make the badword to be add like /bwadd /bwdel *azz* *azz azz* to match the word azzhole azz hole azz-hole azz`hole, like user say ffff i want to !bwadd *ff* or ff* or *ff

on *:start:{
if !$hget(Badwords) { .hmake Badwords 100 }
if $exists(Badwords.txt) {
.hload -n Badwords Badwords.txt
}
}
on *:text:*:#:{
var %bw.code = $strip($1-)
%bw.code = $replace(%bw.code,$chr(44),$chr(32))
tokenize 32 %bw.code
if $1 == !bwadd {
if !$2 {
.notice $nick Usage: !bwadd <list of bad words to be added, space or comma separated)
}
else {
tokenize 32 $2-
var %a = $0
while %a {
if !$hfind(Badwords,$($+($,%a),2),1).data {
.hadd -m Badwords $calc($hget(Badwords,0).item + 1) $($+($,%a),2)
}
dec %a
}
.hsave -n Badwords Badwords.txt
}
}
elseif $1 == !bwdel {
if !$2 {
.notice $nick Usage: !bwdel <list of bad words to be deleted, space or comma separated)
}
else {
tokenize 32 $2-
var %a = $0
while %a {
.hdel Badwords $hfind(Badwords,$($+($,%a),2),1).data
}
dec %a
}
.hsave -n Badwords Badwords.txt
}
elseif $1 == !bwlist {
.hsave -n Badwords Badwords.txt
.msg $nick Warning the Badwords file currently has $hget(Badwords,0).item entries
.play $nick Badwords.txt
}
}

Page 2 of 2 1 2