mIRC Home    About    Download    Register    News    Help

Page 2 of 2 < 1 2
Topic Options
#203716 - 25/08/08 12:26 AM Re: from txt to hash [Re: Crinul]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3367
Loc: France
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

Top
#203720 - 25/08/08 12:47 AM Re: from txt to hash [Re: Crinul]
xyzzy Offline
Vogon poet

Registered: 06/11/06
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


Edited by xyzzy (25/08/08 12:47 AM)

Top
#262852 - 13/04/18 07:21 PM Re: from txt to hash [Re: RusselB]
Tano Offline
Ameglian cow

Registered: 12/04/18
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
}
}

Top
Page 2 of 2 < 1 2