mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
Hey morning all
why this script does'nt save the badwords i put on it?
(when i go exit and then i open my Mirc script the words that i put on it they dont exist - dont save - hash problem? )
here is the script =>

On *:start: {
hmake badwords 50
if ( $isfile($+(",$scriptdirbadwords.hsh,")) ) {
hload badwords $+(",$scriptdirbadwords.hsh,")
}
}
on *:exit: {
hsave -ob badwords $+(",$scriptdirbadwords.hsh,")
hfree badwords
}
dialog badwords {
title "Bad Words List"
size -1 -1 170 160
option dbu
button "OK", 10, 62 144 37 12, ok cancel
tab "Words", 30, 0 -2 169 141
edit "Enter Your Bad Word To Add", 1, 4 14 124 10, tab 30
box "Current Bad Words list. Double Click a word to remove it.", 3, 2 26 166 112, tab 30
button "Add Word", 11, 130 14 37 10, tab 30
list 2, 4 34 162 102, tab 30 sort size
tab "Options", 31
check "Warn Before Kicking or Banning", 40, 2 16 134 10, tab 31
check "Kick User", 41, 2 26 38 10, tab 31
check "Kick/Ban User", 42, 2 36 54 10, tab 31
edit "5 Minutes", 43, 116 36 50 10, tab 31
text "Ban Time In Minutes:", 50, 64 38 51 8, tab 31
edit "Please Watch Your language.", 45, 50 70 116 20, tab 31 multi autohs
text "Ban/Kick Reason:", 4, 2 70 43 8, tab 31
text "Channels to Monitor:", 52, 2 96 163 8, tab 31
edit "Use # to indicate all channels. Seperate Multiple channels by spaces. IE: #channel1 #channel2 #channel3", 46, 2 104 166 22, tab 31 multi autovs
text "Warning Message:", 53, 2 48 47 8, tab 31
edit "Please Watch Your Language. Further abuse will cause actions to be taken.", 47, 50 46 116 20, tab 31 multi
}
alias badwords {
if ( !$hget(badwords) ) hmake badwords 100
dialog -m Badwords Badwords
}
on *:dialog:badwords:init:0: {
if ( $hget(badwords) != $null ) {
var %x 1
did -r badwords 2
while ( %x <= $hget(badwords,0).item ) {
did -a badwords 2 $hget(badwords,%x).item
inc %x
}
}
if ( $ini($+(",$scriptdirsettings.ini),Badwords) != $null ) {
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Warn) == 1 ) did -c badwords 40
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Kick) == 1 ) did -c badwords 41
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Ban) == 1 ) did -c badwords 42
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) != $null ) did -ra badwords 43 $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Reason) != $null ) did -ra badwords 45 $readini($+(",$scriptdirsettings.ini,"),Badwords,Reason)
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Warnmsg) != $null ) did -ra badwords 47 $readini($+(",$scriptdirsettings.ini,"),Badwords,Warnmsg)
if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Channels) != $null ) did -ra badwords 46 $replace($readini($+(",$scriptdirsettings.ini,"),Badwords,Channels),$chr(44),$chr(32))
}
}
on *:dialog:badwords:dclick:2: {
hdel badwords $did(badwords,2).seltext
did -d badwords 2 $did(badwords,2).sel
}

on *:dialog:badwords:sclick:11: {
if ( $did(badwords,1).text == $null ) {
did -ra badwords 1 Please Enter Text
halt
}
if ( $hfind(badwords,$did(badwords,1).text,1) == $null ) {
if ( $did(badwords,1).edited == $true ) {
hadd badwords $did(badwords,1).text
did -a badwords 2 $did(badwords,1).text
did -j badwords 1
}
else {
did -ra badwords 1 You Must edit this text before clicking add.
did -j badwords 1
}
}
else {
did -ra badwords 1 $+(",$did(badwords,1).text,") Already Exists in the List.
did -j badwords 1
}
}
on *:dialog:badwords:sclick:41: {
if ( $did(badwords,41).state == 1 ) && ( $did(badwords,42).state == 1 ) {
did -u badwords 42
}
}
on *:dialog:badwords:sclick:42: {
if ( $did(badwords,42).state == 1 ) && ( $did(badwords,41).state == 1 ) {
did -u badwords 41
}
}
on *:dialog:badwords:sclick:10: {
.writeini $+(",$scriptdirsettings.ini,") Badwords Warn $did(badwords,40).state
.writeini $+(",$scriptdirsettings.ini,") Badwords Kick $did(badwords,41).state
.writeini $+(",$scriptdirsettings.ini,") Badwords Ban $did(badwords,42).state
var %x 1
if ( $did(badwords,45).text != $null ) {
while ( %x <= $did(badwords,45).lines ) {
set %badwords.reason %badwords.reason $did(badwords,45,%x).text
inc %x
}
.writeini $+(",$scriptdirsettings.ini,") Badwords Reason %badwords.reason
unset %badwords.reason
}
else {
.remini $+(",$scriptdirsettings.ini,") Badwords Reason
}
var %x 1
if ( $did(badwords,47).text != $null ) {
while ( %x <= $did(badwords,47).lines ) {
set %badwords.warnmsg %badwords.warnmsg $did(badwords,47,%x).text
inc %x
}
.writeini $+(",$scriptdirsettings.ini,") Badwords Warnmsg %badwords.warnmsg
unset %badwords.warnmsg
}
else {
.remini $+(",$scriptdirsettings.ini,") Badwords Warnmsg
}
$iif( $did(badwords,43).text != $null , .writeini $+(",$scriptdirsettings.ini,") Badwords Bantime $calc( $int($did(badwords,43).text) * 60 ) , .remini $+(",$scriptdirsettings.ini,") Badwords Bantime )
if ( $did(badwords,46).edited ) && ( $did(badwords,46).text != $null ) {
var %x 1
while ( %x <= $did(badwords,46).lines ) {
set %badwords.channels %badwords.channels $did(badwords,46,%x).text
inc %x
}
.writeini $+(",$scriptdirsettings.ini,") Badwords Channels $replace(%badwords.channels,$chr(32),$chr(44))
unset %badwords.channels
}
else {
.remini $+(",$scriptdirsettings.ini,") Badwords Channels
}
}

;;;;;;;;on text script section;;;;;;;;;;;;;;
on @*:text:*:$($readini($+(",$scriptdirsettings.ini,"), Badwords, Channels)): {
var %x 1
while ( %x <= $numtok($1-,32) ) {
if ( $hfind(badwords,$gettok($1-,%x,32),1,W) != $null ) {
;;warn;;
if ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Warn) == 1 ) {
if ( $hget(badwordswarn,$+($nick,.,$chan)) == $null ) {
hinc -m badwordswarn $+($nick,.,$chan)
.Notice $nick $chan $readini($+(",$scriptdirsettings.ini,"), Badwords, Warnmsg)
}
else {
hinc -m badwordswarn $+($nick,.,$chan)
}
;;warned kick;;
if ( $hget(badwordswarn,$+($nick,.,$chan)) > 1 ) && ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 1 ) && ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 0 ) {
.kick $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason )
hdel badwordswarn $+($nick,.,$chan)
}
;;warned kickban;;
elseif ( $hget(badwordswarn,$+($nick,.,$chan)) > 1 ) && ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 0 ) && ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 1 ) {
.ban $+(-ku,$readini($+(",$scriptdirsettings.ini,"), Badwords, Bantime)) $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason ) $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes
hdel badwordswarn $+($nick,.,$chan)
}
}
}
;;no warn;;
if ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Warn) == 0 ) {
;;;no warn kick;;;
if ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 1 ) && ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 0 ) {
.kick $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason )
}
;;;no warn kickban
elseif ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 0 ) && ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 1 ) {
.ban $+(-ku,$readini($+(",$scriptdirsettings.ini,"), Badwords, Bantime) $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason ) Banned: $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes
}
}
inc %x
}
}

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I havent looked at your script yet, but a real good idea when you post alot of code like that is to click the Code link down the bottom, this adds two tags called code & /code put youtr code between them and its spaced out like it should be instead of all being on the left wall, this makes reading it much simplier, and thus more likely to get someone helping.

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
sorry about that frown
let me try again
Code:
 
On *:start: {
  hmake badwords 50
  if ( $isfile($+(",$scriptdirbadwords.hsh,")) ) {
    hload badwords $+(",$scriptdirbadwords.hsh,")
  }
}
on *:exit: {
  hsave -ob badwords $+(",$scriptdirbadwords.hsh,")
  hfree badwords
}
dialog badwords {
  title "Bad Words List"
  size -1 -1 170 160
  option dbu
  button "OK", 10, 62 144 37 12, ok cancel
  tab "Words", 30, 0 -2 169 141
  edit "Enter Your Bad Word To Add", 1, 4 14 124 10, tab 30
  box "Current Bad Words list. Double Click a word to remove it.", 3, 2 26 166 112, tab 30
  button "Add Word", 11, 130 14 37 10, tab 30
  list 2, 4 34 162 102, tab 30 sort size
  tab "Options", 31
  check "Warn Before Kicking or Banning", 40, 2 16 134 10, tab 31
  check "Kick User", 41, 2 26 38 10, tab 31
  check "Kick/Ban User", 42, 2 36 54 10, tab 31
  edit "5 Minutes", 43, 116 36 50 10, tab 31
  text "Ban Time In Minutes:", 50, 64 38 51 8, tab 31
  edit "Please Watch Your language.", 45, 50 70 116 20, tab 31 multi autohs
  text "Ban/Kick Reason:", 4, 2 70 43 8, tab 31
  text "Channels to Monitor:", 52, 2 96 163 8, tab 31
  edit "Use # to indicate all channels. Seperate Multiple channels by spaces. IE: #channel1 #channel2  #channel3", 46, 2 104 166 22, tab 31 multi autovs
  text "Warning Message:", 53, 2 48 47 8, tab 31
  edit "Please Watch Your Language. Further abuse will cause actions to be taken.", 47, 50 46 116 20, tab 31 multi
}
alias badwords {
  if ( !$hget(badwords) ) hmake badwords 100
  dialog -m Badwords Badwords
}
on *:dialog:badwords:init:0: {
  if ( $hget(badwords) != $null ) {
    var %x 1
    did -r badwords 2
    while ( %x &lt;= $hget(badwords,0).item ) {
      did -a badwords 2 $hget(badwords,%x).item
      inc %x
    }
  }
  if ( $ini($+(",$scriptdirsettings.ini),Badwords) != $null ) {
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Warn) == 1 ) did -c badwords 40
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Kick) == 1 ) did -c badwords 41
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Ban) == 1 ) did -c badwords 42
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) != $null ) did -ra badwords 43 $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Reason) != $null ) did -ra badwords 45 $readini($+(",$scriptdirsettings.ini,"),Badwords,Reason)
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Warnmsg) != $null ) did -ra badwords 47 $readini($+(",$scriptdirsettings.ini,"),Badwords,Warnmsg)
    if ( $readini($+(",$scriptdirsettings.ini,"),Badwords,Channels) != $null ) did -ra badwords 46 $replace($readini($+(",$scriptdirsettings.ini,"),Badwords,Channels),$chr(44),$chr(32))
  }
}
on *:dialog:badwords:dclick:2: {
  hdel badwords $did(badwords,2).seltext
  did -d badwords 2 $did(badwords,2).sel
}

on *:dialog:badwords:sclick:11: {
  if ( $did(badwords,1).text == $null ) {
    did -ra badwords 1 Please Enter Text 
    halt
  }
  if ( $hfind(badwords,$did(badwords,1).text,1) == $null ) {
    if ( $did(badwords,1).edited == $true ) {
      hadd badwords $did(badwords,1).text
      did -a badwords 2 $did(badwords,1).text
      did -j badwords 1
    }
    else {
      did -ra badwords 1 You Must edit this text before clicking add.
      did -j badwords 1
    }
  }
  else {
    did -ra badwords 1 $+(",$did(badwords,1).text,") Already Exists in the List.
    did -j badwords 1
  }
}
on *:dialog:badwords:sclick:41: {
  if ( $did(badwords,41).state == 1 ) &amp;&amp; ( $did(badwords,42).state == 1 ) {
    did -u badwords 42
  }
}
on *:dialog:badwords:sclick:42: {
  if ( $did(badwords,42).state == 1 ) &amp;&amp; ( $did(badwords,41).state == 1 ) {
    did -u badwords 41
  }
}
on *:dialog:badwords:sclick:10: {
  .writeini $+(",$scriptdirsettings.ini,") Badwords Warn $did(badwords,40).state
  .writeini $+(",$scriptdirsettings.ini,") Badwords Kick $did(badwords,41).state
  .writeini $+(",$scriptdirsettings.ini,") Badwords Ban $did(badwords,42).state
  var %x 1
  if ( $did(badwords,45).text != $null ) {
    while ( %x &lt;= $did(badwords,45).lines ) {
      set %badwords.reason %badwords.reason $did(badwords,45,%x).text
      inc %x
    }
    .writeini $+(",$scriptdirsettings.ini,") Badwords Reason %badwords.reason
    unset %badwords.reason 
  }
  else {
    .remini $+(",$scriptdirsettings.ini,") Badwords Reason 
  }
  var %x 1
  if ( $did(badwords,47).text != $null ) {
    while ( %x &lt;= $did(badwords,47).lines ) {
      set %badwords.warnmsg %badwords.warnmsg $did(badwords,47,%x).text
      inc %x
    }
    .writeini $+(",$scriptdirsettings.ini,") Badwords Warnmsg %badwords.warnmsg
    unset %badwords.warnmsg 
  }
  else {
    .remini $+(",$scriptdirsettings.ini,") Badwords Warnmsg 
  } 
  $iif( $did(badwords,43).text != $null , .writeini $+(",$scriptdirsettings.ini,") Badwords Bantime $calc( $int($did(badwords,43).text) * 60 ) , .remini $+(",$scriptdirsettings.ini,") Badwords Bantime )
  if ( $did(badwords,46).edited ) &amp;&amp; ( $did(badwords,46).text != $null ) {
    var %x 1
    while ( %x &lt;= $did(badwords,46).lines ) {
      set %badwords.channels %badwords.channels $did(badwords,46,%x).text
      inc %x
    }
    .writeini $+(",$scriptdirsettings.ini,") Badwords Channels $replace(%badwords.channels,$chr(32),$chr(44)) 
    unset %badwords.channels
  }
  else {
    .remini $+(",$scriptdirsettings.ini,") Badwords Channels 
  }
}

;;;;;;;;on text script section;;;;;;;;;;;;;;
on @*:text:*:$($readini($+(",$scriptdirsettings.ini,"), Badwords, Channels)): {
  var %x 1
  while ( %x &lt;= $numtok($1-,32) ) {
    if ( $hfind(badwords,$gettok($1-,%x,32),1,W) != $null ) {    
      ;;warn;;
      if ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Warn) == 1 ) {
        if ( $hget(badwordswarn,$+($nick,.,$chan)) == $null ) {
          hinc -m badwordswarn $+($nick,.,$chan)
          .Notice $nick $chan $readini($+(",$scriptdirsettings.ini,"), Badwords, Warnmsg)
        }
        else {
          hinc -m badwordswarn $+($nick,.,$chan)
        }
        ;;warned kick;;
        if ( $hget(badwordswarn,$+($nick,.,$chan)) &gt; 1 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 1 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 0 ) {
          .kick $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason )
          hdel badwordswarn $+($nick,.,$chan)
        }
        ;;warned kickban;;
        elseif ( $hget(badwordswarn,$+($nick,.,$chan)) &gt; 1 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 0 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 1 ) {
          .ban $+(-ku,$readini($+(",$scriptdirsettings.ini,"), Badwords, Bantime)) $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason ) $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes
          hdel badwordswarn $+($nick,.,$chan)
        }
      }
    }
    ;;no warn;;
    if ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Warn) == 0 ) {
      ;;;no warn kick;;;
      if ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 1 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 0 ) {
        .kick $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason )
      }
      ;;;no warn kickban
      elseif ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 0 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 1 ) {
        .ban $+(-ku,$readini($+(",$scriptdirsettings.ini,"), Badwords, Bantime) $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason ) Banned: $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes
      }
    }
    inc %x
  }
}
 

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Much easier to read, and thus spot, I saw this instantly, and then went off to test what i believed to be the problem, looks like it is it.

Code:
 
On *:start: {
  hmake badwords 50
  if ( $isfile($+(",$scriptdirbadwords.hsh,")) ) {
    hload badwords $+(",$scriptdirbadwords.hsh,")
  }
}
on *:exit: {
  hsave -ob badwords $+(",$scriptdirbadwords.hsh,")
  hfree badwords
}


Its in there, The saving of the file hsave -ob badwords $+(",$scriptdirbadwords.hsh,") uses -b save binary, when you do this you need to read in using -b as well so replace the above with.....

Code:
 
On *:start: {
  hmake badwords 50
  if ( $isfile($+(",$scriptdirbadwords.hsh,")) ) {
    hload -b badwords $+(",$scriptdirbadwords.hsh,")
  }
}
on *:exit: {
  hsave -ob badwords $+(",$scriptdirbadwords.hsh,")
  hfree badwords
}

* Only line changed is line 4, see the -b is added smile

PS: i didnt check anything else in the code, since you seemed to be saying it was all good, just didnt load the words smile

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
...so it was a just a little letter ..iakkkk.. smile
Thank u DaveC it's save the words now!
u seems to now alot about scripts.Maybe u can help me also
in what point and how on this script i can change it to check words with * and @ and space beetween a letters.
I want only that tree options!
example:if swear word is "badword"
1) [email]B@dword[/email]
2) B*dw*rd
3) Ba d word

Last edited by tenya; 29/03/05 03:13 AM.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
ThiS thread has a problem in to a second part.When i test it with words with spaces or symbols its crash my mirc client after a wile.

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
Dammmmmmm frown
I can't make it.I try hard but i do not have the knolege yet.
Script codes is something hard to make it after all frown
Any help from anyone????
(I need this code to catch also badwords with space beetween letters and 2 symbols * and @ /ie [email]b@dword[/email],b a d wo rd, b*adw*rd)

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
It does indeed do this, a small error crept in during debugging, something i missed sorry.
Its been corrected here

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
????????
lol lol
i am confused DaveC
how can i put all this in your thread to my script
i dont now about scripts like u now
i JUST wanted a simple help for the spaces beetween letters
like i wroted above
frown frown frown

is this what i am put in on my scripts on text?
var %nicktext | !.echo -q $regsub($1-,/[^A-Z a-z]+/g,*,%nicktext

but hey appraisated anyway for ur help smile

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Replace your on text script section with the following...

Code:
;;;;;;;;on text script section;;;;;;;;;;;;;;
on @*:text:*:$($readini($+(",$scriptdirsettings.ini,"), Badwords, Channels)): {
  if (( $readini($+(",$scriptdirsettings.ini,"), Badwords, Warn) == 1 ) || ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 1 ) || ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 1 )) {
    ;
    ; Were actually gonna do something to someone so lets check for badwords
    ;
    var %orginal = $1-
    var %text = $replace($strip($1-),@,a,?,¿,*,?)
    var %i = $numtok(%text,32)
    while (%i) {
      tokenize 32 $gettok(%text,$+(%i,-),32)
      while ($0) {
        if (  ($hfind(badwords,$1,1,W) != $null)  ||  (($remove($1,?,*)) &amp;&amp; ($hfind(badwords,$1,1,w)))  ) {
          ;
          ; Found a badword so lets do something to them
          ;   
          var %badword.match = $v1
          ;;warn;;
          if (( $readini($+(",$scriptdirsettings.ini,"), Badwords, Warn) == 1 ) &amp;&amp; !$hget(badwordswarn,$+($nick,.,$chan))) {
            hinc -m badwordswarn $+($nick,.,$chan)
            .Notice $nick $chan $readini($+(",$scriptdirsettings.ini,"), Badwords, Warnmsg) Matched Word  %badword.match 
            var %i = 1 | break | ; clean exit strategy
          }
          ;;kick;;
          elseif (( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 1 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 0 )) {
            .kick $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason ) Matched Word  %badword.match 
            hinc -m badwordswarn $+($nick,.,$chan)
            hdel    badwordswarn $+($nick,.,$chan)
            var %i = 1 | break | ; clean exit strategy
          }
          ;;kickban;;
          elseif ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Kick) == 0 ) &amp;&amp; ( $readini($+(",$scriptdirsettings.ini,"), Badwords, Ban) == 1 ) {
            .ban $+(-ku,$readini($+(",$scriptdirsettings.ini,"), Badwords, Bantime)) $chan $nick $readini($+(",$scriptdirsettings.ini,"), Badwords, Reason ) Banned: $calc( $readini($+(",$scriptdirsettings.ini,"),Badwords,Bantime) / 60 ) Minutes. Matched Word  %badword.match 
            hinc -m badwordswarn $+($nick,.,$chan)
            hdel    badwordswarn $+($nick,.,$chan)
            var %i = 1 | break | ; clean exit strategy
          }
        }
        tokenize 32 $iif(($0 &gt; 1),$+($1,$2-))
      }
      dec %i
    }
    tokenize 32 %orginal | ; clean exit strategy
  }
}


* it was the best I could think of, i dont think its perfect but its ok. It may lag you if the channel has lots of talking.

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
what a guy .......
thaaaaaannnkk youuuuuu DaveC smile
I test it and it's work alright
Now i have a swear kicker exactly what i want !!
yupieeeeeeeeeeeee smile
(just curiosity ..what point and why cause the lag if they cause it ? -i dont test it with lots talking yet-)

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
becuase its got to do a lot of work

if someone says "my dog ate my cat"

if must check all of these.
my
mydog
mydogate
mydogatemy
mydogatemycat
dog
dogate
dogatemy
dogatemycat
ate
atemy
atemycat
my
mycat
cat

Becuase you wanted words with spaces in joined.
it must do (((X^2)+X)/2) comparasions
example if you have 16 words it well do (((16 * 16) + 16) / 2 ) = 136 comparasons
100 words is 5,050 comparasons (now thats gonna lag ya!)

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
Yeap ..now i understand smile but i will keep it
anyway.. thank u thank u so mutch for ur help smile
really appraisated!! smile

Joined: Mar 2005
Posts: 17
T
tenya Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Mar 2005
Posts: 17
hey DaveC i have a small problem
on this "on text" when someone types the symbol " & "
they catched for the badwords and the strange is i dont have it in badwords list
any idea how to correct this?
(thes symbols * or @ dont cached unless if is in badwords -and that we want it- .....but "&" ..why?)

if you have a time pls can u look at this>?
thanks for advance

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
locate this line
var %text = $replace($strip($1-),@,a,?,¿,*,?)
replace with
var %text = $replace($strip($1-),@,a,?,¿,*,?,&,+)


The & is a special character in text matches and matches one whole word, so thats likely what was happening, sorry i didnt get back to you, this message liekly fell off page one, and sometimes i never look on any of the other pages on the forum.


Link Copied to Clipboard