mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 3 1 2 3
#188628 26/10/07 11:20 PM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
I made a small dialog for private offensive words and I cant get the trigger to work?

Code:
 
dialog spamdetect {
  title "Private Offensive"
  size -1 -1 88 75
  option dbu
  list 1, 2 3 50 59, size
  button "Add", 2, 57 6 24 9,flat
  button "Del", 3, 57 18 24 9,flat
  box "", 5, 53 0 33 60
  button "List", 6, 57 30 24 9,flat
  button "Close", 11, 57 42 24 9,flat,ok,cancel
}
on *:dialog:spamdetect:sclick:2:{
  .write spamdetect.txt $?="Spam Word To Add"
  dialog -x $dname
  dialog -dmn spamdetect spamdetect
}
on *:dialog:spamdetect:sclick:3:{
.write -ds $+ $?="Spam Word To Delete" spamdetect.txt
dialog -x $dname
dialog -dmn spamdetect spamdetect
}
on *:dialog:spamdetect:sclick:6:{
.run spamdetect.txt
}
on *:dialog:spamdetect:init:*:{ 
loadbuf -o $dname 1 $+(",$mircdir/spamdetect.txt,")
}

on *:open:?:*: {
var %Spamword = 1
while (%Spamword <= $lines(spamdetect.txt)) {
if ($+(*,$read(spamdetect.txt,%Spamword),*)  iswm $1-) {
.kick # $nick Private Offensive Language
.mode # +b $nick 2
    }
   inc %Spamword
  }
}
on ^*:notice:*:?: {
  var %Spamword = 1
while (%Spamword <= $lines(spamdetect.txt)) {
if ($+(*,$read(spamdetect.txt,%Spamword),*)  iswm $1-) {
      haltdef
    }
   inc %Spamword
  }
}
alias spamdetect {
inc %i
if (%i == 1) write spamdetect.txt
dialog -dmn spamdetect spamdetect
}



Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I don't see an issue your looping through your text file ok, it should pull up line by line Unless the entries are like

ajdjd ajjdad then i could see why its not working but if its

ajdjd
ajjdad

then everything should be fine

I can suggest this...

Code:
on *:open:?:*: {
  if ($regex($1-,/(myword|nextword|wow|I|can|choose|alot)/g) == 1) {
    .kick # $nick Private Offensive Language
    .mode # +b $nick 2
  }
}





Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Not working

Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
'Not Working' is really not very helpful.

Read through this and give us some more details as to what is 'not working'.

Bekar #188642 27/10/07 02:02 AM
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
I did say before that it wont trigger unless its something else dunno, thats why i am asking help from real scripters.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Does it atleast kick users out of channels? if not then its based on your events?


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
If I use on *:TEXT:*:#:{ yes it does kick from the channel but I want to use it for private spamwords so I want to use on *:open:?:*: { and on ^*:notice:*:?: {

Last edited by bcancer; 27/10/07 02:17 AM.
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Ok so A) your kicking using # it will not work since your not on the channel...

I mean use .kick #channel because on OPEN:?: << is for privmsg the OP can be on #mirc and msg you and you will not have the ability to kick him..


EDIT: Also try it this method too from earlier.

Code:
on *:open:?:*: {
  if ($regex($1-,/(myword|nextword|wow|I|can|choose|alot)/g) == 1) {
    .kick #mychannel $nick Private Offensive Language
    .mode #my channel +b $nick 2
  }
}



Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Ok thanks guys.

Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
I cant seem to get ban type 2 to work, any ideal why it wont?

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
.ban #mychannel $nick 2


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Thax I must be going blind.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
yw


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
I found this swear script thats better then mine so I was wondering if it can be use for private swear spam instead of channel swear spam?
Can we just change:
on @!*:TEXT:*:#: {
to
on @!*:OPEN:?:*: {

Code:
alias swear { dialog -dmr sweard sweard }

dialog sweard {
  title " Swear"
  size -1 -1 342 330
  button "&Close",1, 205 305 60 20, cancel,flat
  list 2, 15 20 140 110, sort size  
  box "Swear Words",3, 5 5 160 153
  button "Add",4,  15 133 60 21,flat
  button "Remove",5, 80 133 74 20, autohs,flat
  box "Exempt Channels:",6, 170 5 161 153
  list 7, 180 20 140 110, sort size  
  button "Add",8, 180 133 60 21,flat
  button "Remove",9, 246 133 73 20, autohs,flat
  check "Kick Message:",10, 13 179 84 20
  box "Other Options",11, 5 156 326 142
  edit "",12, 99 179 225 20, autohs
  button "Ok",13, 270 305 60 20, ok,flat
  check "Exempt The Ops in the Channel", 14, 13 205 175 10 
  check "Exempt The Voices in the Channel", 15, 13 224 185 10
  edit "", 16, 112 238 50 20, autohs
  check "Set Ban Length:", 17, 13 240 99 20
  text "Seconds", 18, 165 240 50 20
  combo 19, 112 265 151 89, edit drop autohs 
  text "Select Ban Time", 21, 13 268 99 30  
}

on *:dialog:sweard:*:*:{
  if ($devent == init) {
    if ($readini($keke,options,ban)) { did -c $dname 17 }    
    if ($readini($keke,options,message)) { did -c $dname 10 }  
    if ($readini($keke,options,ops)) { did -c $dname 14 }
    if ($readini($keke,options,vops)) { did -c $dname 15 }
    did -a $dname 12 $readini($keke,options,message)    
    if ($readini($keke,options,secs)) { did -c $dname 17 }
    did -a $dname 16 $readini($keke,options,secs)
    did -i $dname 19 0 $readini($keke,options,punish)    
    .dlist 2 swear words 
    .dlist 7 exempt chan 
    did -f $dname 13
    did -a sweard 19 Kick
    did -a sweard 19 Kick and Ban 
    did -a sweard 19 None

  }    
  if ($devent == sclick) {
    if ($did(14).state == 1) { op_c }
    if ($did(15).state == 1) { vo_c }
    if ($did == 4) {
      var %t = $$?="Enter swear word $crlf $+ Separate multiple entries with a comma:"
      if ($numtok(%t,32) > 1) { %t = $replace(%t,$chr(32),$chr(160)) }
      .writeini $keke swear words $iif($readini($keke,swear,words),$+($ifmatch,$chr(44),%t),%t)
      dlist 2 swear words    
    }
    if ($did == 5) {
      var %tmp = $did(2).seltext
      if (%tmp) {
        if ($remtok($readini($keke,swear,words),%tmp,44)) { 
          .writeini $keke swear words $ifmatch 
        }
        else .remini $keke swear words
        .dlist 2 swear words      
      }
    }
    if ($did == 8) {
      var %t = $$?="Enter Channel Name $crlf $+ Separate multiple entries with a comma:"
      if ($chr(32) !isin %t) {
        .writeini $keke exempt chan $iif($readini($keke,exempt,chan),$+($ifmatch,$chr(44),%t),%t)
        dlist 7 exempt chan      
      }
    }
    if ($did == 9) {
      var %tmp = $did(7).seltext
      if (%tmp) {
        if ($remtok($readini($keke,exempt,chan),%tmp,44)) { 
          .writeini $keke exempt chan $ifmatch 
        }
        else .remini $keke exempt chan
        .dlist 7 exempt chan      
      }
    }


    if ($did == 13) {
      ; OK button,flat

      .writeini $keke options kick $iif($did(10).state == 1,$true,$false)
      .writeini $keke options message $iif($did(12),$ifmatch,$readini($keke,options,message))
      .writeini $keke options secs $iif($did(16) isnum 1-,$ifmatch,$readini($keke,options,secs))
      .writeini $keke options ops $iif($did(14).state == 1,$true,$false)
      .writeini $keke options vops $iif($did(15).state == 1,$true,$false)
      .writeini $keke options ban $iif($did(17).state == 1,$true,$false)
      .writeini $keke options punish $iif($did(19),$ifmatch,$readini($keke,options,punish))
    }
  }
}

on @!*:TEXT:*:#: {
  %swear.punish = $readini($keke,options,punish))
  if ($ischan) { return }  
  if ($readini($keke,options,ops)) { op_c }
  if ($readini($keke,options,vops)) { vo_c }
  if ($readini($keke,swear,words)) && ($match_text($1-)) {
    if (None isin %swear.punish) { return }    
    if (kick isin %swear.punish) {
      if (ban isin %swear.punish) {
        .raw kick $chan $nick $+(:,$readini($keke,options,message)) $+ $cr $+ mode $chan +b $mask($fulladdress,2)
        .timerswearunban 1 $readini($keke,options,secs) mode $chan -b $mask($fulladdress,2)
      }
      else { .raw kick $chan $nick $+(:,$readini($keke,options,message)) }
    }
  }
}

alias -l keke return $+(",$scriptdirswear.ini,")

alias -l ischan {
  var %i = $numtok($readini($keke,exempt,chan),44),%j
  while (%i > 0) {
    %j = $gettok($readini($keke,exempt,chan),%i,44)
    if (%j isin $chan) || ($2 == %j) { return $true }
    dec %i
  }
  return $false
}

alias -l match_text {
  var %i = $numtok($readini($keke,swear,words),44),%swear
  while (%i > 0) {
    %swear = $+(*,$replace($gettok($readini($keke,swear,words),%i,44),$chr(160),$chr(32)),*) 
    if ($wildtok($1-,%swear,1,44)) {
      return $true
    }
    dec %i
  }
}

alias op_c {
  if ($nick isop $chan) { halt }
}

alias vo_c {
  if ($nick isvo $chan) { halt }
}
alias -l dlist {
  var %a = 1
  did -r $dname $1
  while ($gettok($readini($keke,$2,$3),%a,44)) {
    did -az $dname $1 $ifmatch
    inc %a
  }
}

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
What a lengthy and intimidating script.

so I won't go deep into it because this basically has unless junk in it but first...

on @!*:TEXT:*:#: {
%swear.punish = $readini($keke,options,punish))
if ($ischan) { return }
if ($readini($keke,options,ops)) { op_c }
if ($readini($keke,options,vops)) { vo_c }
if ($readini($keke,swear,words)) && ($match_text($1-)) {
if (None isin %swear.punish) { return }
if (kick isin %swear.punish) {
if (ban isin %swear.punish) {
.raw kick $chan $nick $+(:,$readini($keke,options,message)) $+ $cr $+ mode $chan +b $mask($fulladdress,2)
.timerswearunban 1 $readini($keke,options,secs) mode $chan -b $mask($fulladdress,2)
}
else { .raw kick $chan $nick $+(:,$readini($keke,options,message)) }
}
}
}

What i've highlighted in red is an alias that's local that is called within the script that detects an exempt list of channel calculations.

>

Code:
alias -l ischan {
  var %i = $numtok($readini($keke,exempt,chan),44),%j
  while (%i > 0) {
    %j = $gettok($readini($keke,exempt,chan),%i,44)
    if (%j isin $chan) || ($2 == %j) { return $true }
    dec %i
  }
  return $false
}


This alias calls an ini file by another alias $keke which is usually because its a quote of $scriptdirpathfile Obviously the script is outdated or just simply wants to continue using the old method of quoting while $qt($cmd) could of simply be done.. as you can also see this script is abusing alias(es).

So if you did change On text to on open you run into factors A) the $ischan alias is completly useless. B) Simply regex matches can cut down the size of the script and the use of certain alias calls.

Either or, im not sure were you pick this script off from, It's good for on text event but in your case its useless without re-writting part of it.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Ok tkanks for trying.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Well here you can have this just change the variable on top of the alias swear call with your own channel

Code:
alias swear { dialog -dmr sweard sweard | %s.chan = #mychannel }

dialog sweard {
  title " Swear"
  size -1 -1 342 330
  option pixels
  button "&Close", 1, 205 305 60 20, flat cancel
  list 2, 15 20 309 110, sort size
  box "Swear Words", 3, 5 6 325 153
  button "Add", 4, 109 133 60 21, flat
  button "Remove", 5, 173 133 74 20, flat
  check "Kick Message:", 10, 13 179 84 20
  box "Other Options", 11, 5 156 326 142
  edit "", 12, 99 179 225 20, autohs
  button "Ok", 13, 270 305 60 20, flat ok
  check "Exempt The Ops in the Channel", 14, 13 205 175 10
  check "Exempt The Voices in the Channel", 15, 13 224 185 10
  edit "", 16, 112 238 50 20, autohs
  check "Set Ban Length:", 17, 13 240 99 20
  text "Seconds", 18, 165 240 50 20
  combo 19, 112 265 151 89, edit drop
  text "Select Ban Time", 21, 13 268 99 30
}

on *:dialog:sweard:*:*:{
  if ($devent == init) {
    if ($readini($keke,options,ban)) { did -c $dname 17 }    
    if ($readini($keke,options,message)) { did -c $dname 10 }  
    if ($readini($keke,options,ops)) { did -c $dname 14 }
    if ($readini($keke,options,vops)) { did -c $dname 15 }
    did -a $dname 12 $readini($keke,options,message)    
    if ($readini($keke,options,secs)) { did -c $dname 17 }
    did -a $dname 16 $readini($keke,options,secs)
    did -i $dname 19 0 $readini($keke,options,punish)    
    .dlist 2 swear words 
    .dlist 7 exempt chan 
    did -f $dname 13
    did -a sweard 19 Kick
    did -a sweard 19 Kick and Ban 
    did -a sweard 19 None

  }    
  if ($devent == sclick) {
    if ($did(14).state == 1) { op_c }
    if ($did(15).state == 1) { vo_c }
    if ($did == 4) {
      var %t = $$?="Enter swear word $crlf $+ Separate multiple entries with a comma:"
      if ($numtok(%t,32) > 1) { %t = $replace(%t,$chr(32),$chr(160)) }
      .writeini $keke swear words $iif($readini($keke,swear,words),$+($ifmatch,$chr(44),%t),%t)
      dlist 2 swear words    
    }
    if ($did == 5) {
      var %tmp = $did(2).seltext
      if (%tmp) {
        if ($remtok($readini($keke,swear,words),%tmp,44)) { 
          .writeini $keke swear words $ifmatch 
        }
        else .remini $keke swear words
        .dlist 2 swear words      
      }
    }
    if ($did == 8) {
      var %t = $$?="Enter Channel Name $crlf $+ Separate multiple entries with a comma:"
      if ($chr(32) !isin %t) {
        .writeini $keke exempt chan $iif($readini($keke,exempt,chan),$+($ifmatch,$chr(44),%t),%t)
        dlist 7 exempt chan      
      }
    }
    if ($did == 9) {
      var %tmp = $did(7).seltext
      if (%tmp) {
        if ($remtok($readini($keke,exempt,chan),%tmp,44)) { 
          .writeini $keke exempt chan $ifmatch 
        }
        else .remini $keke exempt chan
        .dlist 7 exempt chan      
      }
    }


    if ($did == 13) {
      ; OK button,flat

      .writeini $keke options kick $iif($did(10).state == 1,$true,$false)
      .writeini $keke options message $iif($did(12),$ifmatch,$readini($keke,options,message))
      .writeini $keke options secs $iif($did(16) isnum 1-,$ifmatch,$readini($keke,options,secs))
      .writeini $keke options ops $iif($did(14).state == 1,$true,$false)
      .writeini $keke options vops $iif($did(15).state == 1,$true,$false)
      .writeini $keke options ban $iif($did(17).state == 1,$true,$false)
      .writeini $keke options punish $iif($did(19),$ifmatch,$readini($keke,options,punish))
    }
  }
}

on *:OPEN:?:*: {
  %swear.punish = $readini($keke,options,punish)) 
  if ($readini($keke,options,ops)) { op_c }
  if ($readini($keke,options,vops)) { vo_c }
  if ($readini($keke,swear,words)) && ($match_text($1-)) {
    if (None isin %swear.punish) { return }    
    if (kick isin %swear.punish) {
      if (ban isin %swear.punish) {
        .raw kick %s.chan $nick $+(:,$readini($keke,options,message)) $+ $cr $+ ban %s.chan $nick $mask($fulladdress,2)
        .ban $+(-u,$readini($keke,options,secs)) %s.chan $nick $mask($fulladdress,2)
      }
      else { .raw kick %s.chan $nick $+(:,$readini($keke,options,message)) }
    }
  }
}

alias -l keke return $+(",$scriptdirswear.ini,")

alias -l match_text {
  var %i = $numtok($readini($keke,swear,words),44),%swear
  while (%i > 0) {
    %swear = $+(*,$replace($gettok($readini($keke,swear,words),%i,44),$chr(160),$chr(32)),*) 
    if ($wildtok($1-,%swear,1,44)) {
      return $true
    }
    dec %i
  }
}

alias op_c {
  if ($nick isop %s.chan) { halt }
}

alias vo_c {
  if ($nick isvo %s.chan) { halt }
}
alias -l dlist {
  var %a = 1
  did -r $dname $1
  while ($gettok($readini($keke,$2,$3),%a,44)) {
    did -az $dname $1 $ifmatch
    inc %a
  }
}


I removed the exempt


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Cool thx.
I get this error:

* /did: 'sweard' invalid id '7' (line 133, dialog75.mrc)

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Um in this event..

Code:
on *:dialog:sweard:*:*:{
  if ($devent == init) {
    if ($readini($keke,options,ban)) { did -c $dname 17 }    
    if ($readini($keke,options,message)) { did -c $dname 10 }  
    if ($readini($keke,options,ops)) { did -c $dname 14 }
    if ($readini($keke,options,vops)) { did -c $dname 15 }
    did -a $dname 12 $readini($keke,options,message)    
    if ($readini($keke,options,secs)) { did -c $dname 17 }
    did -a $dname 16 $readini($keke,options,secs)
    did -i $dname 19 0 $readini($keke,options,punish)    
    .dlist 2 swear words 
    .dlist 7 exempt chan 


Remove .dlist 7 exempt chan


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
I get a new error:

* [test44] No such channel
* Error: /BAN is an unknown command.

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Both of those errors are from this line
Code:
        .raw kick %s.chan $nick $+(:,$readini($keke,options,message)) $+ $cr $+ ban %s.chan $nick $mask($fulladdress,2)

"No such channel" - Apparently you don't have %s.chan defined.
"Unknown command" - /ban is a mIRC command, not an IRCd command.

Replace both these lines
Code:
        .raw kick $chan $nick $+(:,$readini($keke,options,message)) $+ $cr $+ mode $chan +b $mask($fulladdress,2)
        .timerswearunban 1 $readini($keke,options,secs) mode $chan -b $mask($fulladdress,2)
with this line
Code:
        ban $+(-ku,$iif($readini($keke,options,secs),$v1,600)) #CHANNEL $nick 2 $readini($keke,options,message
but first change "#CHANNEL" to the channel you want the user kicked from.

FWIW though, I think that's a pretty awful script, WAY too many $readini's IMHO.


Edit:
This replacement match_text alias will cut down on some of the file accesses...
Code:
alias -l match_text {
  var %i = 1,%a = $readini($keke,swear,words)
  while ($gettok(%a,%i,44)) {
    var %swear = $+(*,$replace($v1,$chr(160),$chr(32)),*) 
    if ($wildtok($1-,%swear,1,44)) { return $true }
    inc %i
  }
}

Last edited by deegee; 30/10/07 04:38 AM.
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Lol I totally agree, sorry for the un-noticed ban mode


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
* Invalid parameters: $readini (line 102, dialog75.mrc)

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Can you type out //echo -a $read(dialog75.mrc,n,102) and paste the output


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
$read(dialog75.mrc,n,102)

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
lol I meant in mirc then give me what it says here.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 2,033
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,033
He probably used only one /

Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
* /echo: insufficient parameters

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
  • //echo -a $read($script(dialog75.mrc),n,102)


Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
.ban $+(-ku,$iif($readini($keke,options,secs),$v1,600)) #test444 $nick 2 $readini($keke,options,message

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Add a ) to the end
ban $+(-ku,$iif($readini($keke,options,secs),$v1,600)) #test444 $nick 2 $readini($keke,options,message)

Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Ok I fixed that but still wont trigger, here is what I have so far:

Code:
alias swear { dialog -dmr sweard sweard | %s.chan = #test44 }

dialog sweard {
  title " Swear"
  size -1 -1 342 330
  option pixels
  button "&Close", 1, 205 305 60 20, flat cancel
  list 2, 15 20 309 110, sort size
  box "Swear Words", 3, 5 6 325 153
  button "Add", 4, 109 133 60 21, flat
  button "Remove", 5, 173 133 74 20, flat
  check "Kick Message:", 10, 13 179 84 20
  box "Other Options", 11, 5 156 326 142
  edit "", 12, 99 179 225 20, autohs
  button "Ok", 13, 270 305 60 20, flat ok
  check "Exempt The Ops in the Channel", 14, 13 205 175 10
  check "Exempt The Voices in the Channel", 15, 13 224 185 10
  edit "", 16, 112 238 50 20, autohs
  check "Set Ban Length:", 17, 13 240 99 20
  text "Seconds", 18, 165 240 50 20
  combo 19, 112 265 151 89, edit drop
  text "Select Ban Time", 21, 13 268 99 30
}

on *:dialog:sweard:*:*:{
  if ($devent == init) {
    if ($readini($keke,options,ban)) { did -c $dname 17 }    
    if ($readini($keke,options,message)) { did -c $dname 10 }  
    if ($readini($keke,options,ops)) { did -c $dname 14 }
    if ($readini($keke,options,vops)) { did -c $dname 15 }
    did -a $dname 12 $readini($keke,options,message)    
    if ($readini($keke,options,secs)) { did -c $dname 17 }
    did -a $dname 16 $readini($keke,options,secs)
    did -i $dname 19 0 $readini($keke,options,punish)    
    .dlist 2 swear words  
    did -f $dname 13
    did -a sweard 19 Kick
    did -a sweard 19 Kick and Ban 
    did -a sweard 19 None

  }    
  if ($devent == sclick) {
    if ($did(14).state == 1) { op_c }
    if ($did(15).state == 1) { vo_c }
    if ($did == 4) {
      var %t = $$?="Enter swear word $crlf $+ Separate multiple entries with a comma:"
      if ($numtok(%t,32) > 1) { %t = $replace(%t,$chr(32),$chr(160)) }
      .writeini $keke swear words $iif($readini($keke,swear,words),$+($ifmatch,$chr(44),%t),%t)
      dlist 2 swear words    
    }
    if ($did == 5) {
      var %tmp = $did(2).seltext
      if (%tmp) {
        if ($remtok($readini($keke,swear,words),%tmp,44)) { 
          .writeini $keke swear words $ifmatch 
        }
        else .remini $keke swear words
        .dlist 2 swear words      
      }
    }
    if ($did == 8) {
      var %t = $$?="Enter Channel Name $crlf $+ Separate multiple entries with a comma:"
      if ($chr(32) !isin %t) {
        .writeini $keke exempt chan $iif($readini($keke,exempt,chan),$+($ifmatch,$chr(44),%t),%t)
        dlist 7 exempt chan      
      }
    }
    if ($did == 9) {
      var %tmp = $did(7).seltext
      if (%tmp) {
        if ($remtok($readini($keke,exempt,chan),%tmp,44)) { 
          .writeini $keke exempt chan $ifmatch 
        }
        else .remini $keke exempt chan
        .dlist 7 exempt chan      
      }
    }


    if ($did == 13) {
      ; OK button,flat

      .writeini $keke options kick $iif($did(10).state == 1,$true,$false)
      .writeini $keke options message $iif($did(12),$ifmatch,$readini($keke,options,message))
      .writeini $keke options secs $iif($did(16) isnum 1-,$ifmatch,$readini($keke,options,secs))
      .writeini $keke options ops $iif($did(14).state == 1,$true,$false)
      .writeini $keke options vops $iif($did(15).state == 1,$true,$false)
      .writeini $keke options ban $iif($did(17).state == 1,$true,$false)
      .writeini $keke options punish $iif($did(19),$ifmatch,$readini($keke,options,punish))
    }
  }
}

on *:OPEN:?:*: {
  %swear.punish = $readini($keke,options,punish)) 
  if ($readini($keke,options,ops)) { op_c }
  if ($readini($keke,options,vops)) { vo_c }
  if ($readini($keke,swear,words)) && ($match_text($1-)) {
    if (None isin %swear.punish) { return }    
    if (kick isin %swear.punish) {
      if (ban isin %swear.punish) {
      .ban $+(-ku,$iif($readini($keke,options,secs),$v1,600)) #test44 $nick 2 $readini($keke,options,message)
      }
      else { .raw kick $chan $nick $+(:,$readini($keke,options,message)) }
    }
  }
}

alias -l keke return $+(",$scriptdirswear.ini,")

alias -l match_text {
  var %i = 1,%a = $readini($keke,swear,words)
  while ($gettok(%a,%i,44)) {
    var %swear = $+(*,$replace($v1,$chr(160),$chr(32)),*) 
    if ($wildtok($1-,%swear,1,44)) { return $true }
    inc %i
  }
}

alias op_c {
  if ($nick isop %s.chan) { halt }
}

alias vo_c {
  if ($nick isvo %s.chan) { halt }
}
alias -l dlist {
  var %a = 1
  did -r $dname $1
  while ($gettok($readini($keke,$2,$3),%a,44)) {
    did -az $dname $1 $ifmatch
    inc %a
  }
}

Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
-- Removed due to being incorrect --

Last edited by Bekar; 31/10/07 08:43 AM.
Bekar #188831 31/10/07 05:54 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Oops, good catch thats what happens when your tired.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
Actually, no. I'm wrong. Checked the help page when I got home.

ON TEXT is that order, ON OPEN is reversed, just for the 'ol confusing wink

Bekar #188844 31/10/07 02:28 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Hmph, that seemed an incorrect order to myself. I guess my brain still functions when tired lol


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Originally Posted By: bcancer
Ok I fixed that but still wont trigger, here is what I have so far:

* deegee wonders where the errors came from if the script didn't trigger... confused



You'll need to change the $chan in this line also
Code:
      else { .raw kick $chan $nick $+(:,$readini($keke,options,message)) }
Not really a lot of use to use /raw for a kick either...
Code:
      else { !kick #CHANNEL $nick $readini($keke,options,message) }


Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I would seriously re-write the whole script and use Variables to carry the words and use TOK commands to loop through etc..


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
I would suggest using a hash table wink

Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Its working fine now accept for kicking or banning the exact bad word exemple:
sex ok to ban but not to ban sexy
can that be fix?

Joined: Oct 2007
Posts: 102
B
bcancer Offline OP
Vogon poet
OP Offline
Vogon poet
B
Joined: Oct 2007
Posts: 102
Lpfix5 if you find time please sure re-write it all with a dialog of course hehe thx.

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
This is why regex is good


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Page 1 of 3 1 2 3

Link Copied to Clipboard