Skip to content
MSN

wildcards and text files scanning

A TG007 community discussion started by DreaM.

Discussion 3 posts
Page 1 of 1
Open
Topic #3127 · 3 published posts · 497 views

hi guys, I have a text file contains some of bad words but I want the script to accept wildcards for example i have in my bad words file:

 

blah

*blah1*

*blah2

blah3*

 

I want the script to scan the text file and

 

if word blah == $1- kick but if word blah isin $1- dont kick

if word blah1 isin $1- kick

if word .......blah2 isin $1- kick

if word blah3....... isin $1- kick

 

I am using:

 

on *:text:*:#:{
var %w 1
while ($lines(badwords.txt) >= %w) {
 if ($read(badwords.txt,%w) isin $1-) {
  kick $chan $nick bad word
  break
 }
inc %w
}
}

 

any help please? I think that it is hard to be done with *blah2 or blah3* but if impossible then what is about blah and *blah1* ?

 

many blahs

 

I dont think you can use wild cards in a txt file, why dont you put it all in a mrc file?

 

 

on *:text:*:#:{
var %w 1
while ($lines(badwords.txt) >= %w) {
if (* $+ $read(badwords.txt,%w) $+ * iswm $1-) {
 kick $chan $nick bad word
 break
}
inc %w
}
}

 

should get the words as *test*

 

My code does NOT have bugs. It just develops random features.