Identifying a word - 10/06/03 05:36 PM
how do u get it to identify a word from a sentance and if that word is in a txt file?
on 1:TEXT:*:#: { /unset %match var %word = 1 while (%word <= $numtok($1-, 32)) { if ($read([color:Red]yourtext.txt[/color], s, $gettok($1-, %word, 32))) var %match = $addtok(%match, $gettok($1-, %word, 32), 44) /inc %word } if (%match != $null) /msg $chan Found the current matching words: %match }
on @1:TEXT:*:#botsparadise: { /unset %match var %word = 1 while (%word <= $numtok($1-, 32)) { if ($read(swearwords.txt, s, $gettok($1-, %word, 32))) var %match = $addtok(%match, $gettok($1-, %word, 32), 44) /inc %word } if (%match != $null) /msg $chan Do not use: < $+ $nick $+ > " $+ %match $+ " You will be kicked if it happens again | /write swearer.txt $nick }
S***T F***K
on @1:TEXT:*:#botsparadise: { var %i = 1 while (%i <= $0) { .!echo -q $read($scriptdirswearwords.txt,s,$eval($+($,%i),2)) if ($readn) { var %match = $addtok(%match,$eval($+($,%i),2),44) } inc %i } if (%match != $null) { msg $chan Do not use: < $+ $nick $+ > " $+ %match $+ " You will be kicked if it happens again } }
on @1:TEXT:*:#botsparadise: { var %i = 1 while (%i <= $0) { .!echo -q $read($scriptdirswearwords.txt,s,$eval($+($,%i),2)) if ($readn) { var %match = $addtok(%match,$eval($+($,%i),2),44) } inc %i } [color:red] if ($read(swearers.txt,s,$nick) && if($nick !isop #)) { if ($ifmatch != $null) { kick $chan $nick You Were Warned elseif (%match != $null) { [/color] msg $chan Do not use: < $+ $nick $+ > " $+ %match $+ " You will be kicked if it happens again | write swearers.txt $nick } } } }
on @1:TEXT:*:#botsparadise: { if ($nick !isop $chan) { tokenize 32 $strip($1-) var %i = 1 while (%i <= $0) { .!echo -q $read($scriptdirswearwords.txt,s,$eval($+($,%i),2)) if ($readn) { var %match = $addtok(%match,$eval($+($,%i),2),44) } inc %i } ; You need this so you don't take any action of no swears were spoke by $nick if (%match) { .!echo -q $read($scriptdirswearers.txt,s,$nick) if ($readn) { kick $chan $nick You Were Warned } else { msg $chan Do not use: < $+ $nick $+ > " $+ %match $+ " You will be kicked if it happens again write $scriptdirswearers.txt $nick } } } }
on @1:TEXT:*:#botsparadise: { if ($nick !isop $chan) { tokenize 32 $strip($1-) var %i = 1 while (%i <= $0) { .!echo -q $read($scriptdirswearwords.txt,s,$eval($+($,%i),2)) if ($readn) { var %match = $addtok(%match,$eval($+($,%i),2),44) } inc %i } if (%match) { if ($hget(SwearKicked) == $null) { hmake SwearKicked 100 } if ($hfind(SwearKicked,$fulladdress,1,W)) { var %item = $ifmatch , %val = $hget(SwearKicked,%item) if (%val > 5) { ban $chan $nick 2 | kick $chan $nick You were warned %val times! Now you are banned! } else { kick $chan $nick You were warned %val time $+ $iif(%val > 1,s) $+ ! } hinc -u7200 SwearKicked %item 1 } else { hadd -u7200 SwearKicked $+(*!*,$address) 1 msg $chan Do not use: < $+ $nick $+ > " $+ %match $+ " You will be kicked if it happens again } } } }
.!echo -q $read($scriptdirswearwords.txt,s,$eval($+($,%i),2)) if ($readn) { var %match = $addtok(%match,$eval($+($,%i),2),44) }
if ($read($scriptdirswearwords.txt,w,$eval($+($,%i),2))) { var %match = $addtok(%match,$ifmatch,44) }