mIRC Home    About    Download    Register    News    Help

Topic Options
#262919 - 18/04/18 02:43 AM Need help with script pls help me
Tano Offline
Ameglian cow

Registered: 12/04/18
Posts: 24
anyone from u guys can help me to give ban to the user who put badword on text and to be baned for the badword example: stupid i have in my badword.list added in this way /bwadd stupi*

this way is matched dhe badword wilcard in badword.list

Mike says : stupid
Jimmy sets mode: +b *!*@Host-retail.telecomitalia.it
[4 Mike Wrote Stupid ] 6Matched On BadWord List. 4 [ stupi* ]

Now on full text cant match the badword 'stupid'

Mike says : You my friend are "stupid" so get lost now
(no ban)

on *:start:{ $iif(!$isfile(badword.list),.write badword.list) | .hmake badword 100 | .hload badword badword.list }
#bwaddon on
on *:text:*:#: badword $1-
on *:action:*:#: badword $1-
alias -l badword {
if ($nick(#,$nick,oh%&~)) { return }
if ($me isop $chan) {
if $hfind(badword,$strip($1-),1,W).data {
ban -u300 $chan $nick 2
echo -a $token(%:c,%c,32) [ 6BADWORD ] $strip($1-) Matched From Badword List. $+([,$chr(32),$hget(badword,$hfind(badword,$strip($1-),1,W).data),$chr(32),])
var %:c $regsubex($chr(-,$hfind($strip($1-),1,W)),/./g, $iiif ($regex($1-,$+(/(?<![a-z\d])\Q,$read(badword,\E,\\E\Q,$chr(32),\E|\Q),\E(?![a-z\d])/Si))) {
var %c = 1
while %c <= $token(%:c,0,32) {

i belive is something wrong in this regex to match string on full text user speaker

var %:c $regsubex($chr(-,$hfind($strip($1-),1,W)),/./g, $iiif ($regex($1-,$+(/(?<![a-z\d])\Q,$read(badword,\E,\\E\Q,$chr(32),\E|\Q),\E(?![a-z\d])/Si))) {

something like that i need help guys pls any idea suggestion how to fix this problem ?

Edited by Tano (18/04/18 04:45 AM)

#262931 - 20/04/18 08:54 AM Re: Need help with script pls help me [Re: Tano]
raycomp Offline
Vogon poet

Registered: 04/05/13
Posts: 103
I use ths simple script. Maybe you can use some of it?

alias -l swear.words { return word1.word2.word3.word4 }

on @*:text:*:#: {
if ($nick isop #) return
var %x $strip($1-) , %i $numtok($swear.words,46)
while (%i) {
if ($istok(%x,$gettok($swear.words,%i,46),32)) {
;raw -q mode # +b $wildsite
/msg $chan 4 $nick we do not allow swearing in our channel!
/kick # $nick No swearing!
dec %i