mIRC Home    About    Download    Register    News    Help

Print Thread
#36482 15/07/03 06:26 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
im fixing to write a new script for a swear kicker,

if ($1- isin swear.txt) { commands }

that problely wont work

but i wanted to have something writen so that if someone said something that was in a text file it would trigger it.

any ideas?

#36483 15/07/03 06:35 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
if ($read(swear.txt,w,* $+ $1- $+ *)) { command }

Last edited by saragani; 15/07/03 07:19 PM.
#36484 15/07/03 06:35 PM
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
if ($read(swear.txt, w, $+(*,$1,*) ) { .. }


- cF
Dedicated helper for rent.
#36485 15/07/03 06:38 PM
Joined: Feb 2003
Posts: 282
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
LOL smile

I have beat you in 1 second......


The * $+ $-1 $+ * or the $+(*,$1-,*) is that it will look for the text in a line.

If you just use $1 , it will do the command only when there is a line which is exactly like $1 (has only $1)

You can also reffer to the line by $readn , This will give you the number of the line.

Last edited by saragani; 15/07/03 07:20 PM.
#36486 15/07/03 06:40 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well I have an idea of what you want to do, however I doubt your example is what you want to do so let me verify. You will have a swear.txt that lists all the swear words? The reason I ask is (even if isin worked for files) that still wouldn't work:

$1- hey how are you
swear.txt = damn
if ($1- isin swear.txt)
That would mean
if (hey how are you isin damn)
So I assume you meant it the other way around? Check if words in the file are in the user's text?

In which case you'd need to use $read, and check if $1, $2, $N are in swear.txt using a loop:
Code:
var %i = 1
while (%i <= $0) {
   if ($read(swear.txt, ns, $eval($chr(36) $+ %i,2))) {
      ; kick the user
      break
   }
   inc %i
}


Something like that should work, note however I didn't actually test that.

#36487 15/07/03 07:10 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
on *:text:*:*:{
if ($read(swear1.txt,w,* $+ $1- $+ *)) { msg # Dances for you }
}


thats what im testing out,
if you say the f word by itself it will dances for you,

but if you use it in the sentense it wont,

ive tried $1- but it doesnt make a difference

i dont understand what the person with the variable is, or how to make that one work or trigger,

any more ideas?

#36488 15/07/03 07:12 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Try reading my post, it will work regardless of where it appears in the text.

#36489 15/07/03 07:15 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
ill ry but how do you trigger it,
im sorry im just lost of where to put it.

btw you work with UNreal IRCd?

#36490 15/07/03 07:18 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Code:
ON @*:text:*:*:{
   var %i = 1
   while (%i <= $0) {  
       if ($read(swear.txt, ns, $eval($chr(36) $+ %i,2))) {
         .kick $chan $nick Swearing is not allowed
         break   
      }   
      inc %i
   }
}


And yes I do work on UnrealIRCd.

#36491 15/07/03 07:21 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
ON *:text:*:*:{
var %i = 1
while (%i <= $0) {
if ($read(swear1.txt, ns, $eval($chr(36) $+ %i,2))) {
msg # dances around the room
break
}
inc %i
}
}


thats not working for me that well,

btw, i use Unreal, best ircd ever!

#36492 15/07/03 09:11 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Is the file swear.txt or swear1.txt? Your first post said swear.txt, now you're saying swear1.txt

#36493 15/07/03 11:03 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
its swear1.txt

its not even geting triggered with any errors or anything

#36494 15/07/03 11:46 PM
Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67
Code:
on 1:TEXT:*:#yourchannelhere:{
  if ($istok($read(C:\swear.txt),$1-,46) == $true) {
    kick $chan $nick Swearing is not allowed
  }
}

change C:\swear.txt to ur file and write swear.txt as word.word.word etc works on my end


while (demi == nub) {
inc %skill
}
#36495 15/07/03 11:48 PM
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Code:
alias badword {
  var %ctr = 1,%tmp = swear.txt
  while ($read(%tmp,%ctr)) {
    if ($istok($strip($1-),$ifmatch,32)) { return $true | halt }
    inc %ctr
  }
  return $false
}

On @*:TEXT:*:#:{
  if ($badword($1-)) { echo -a Bad word detected from $nick $+ . Do whatever you want here. }
}


That should do the trick.

[edit]Oh and your text file structure should be one bad word per line.[/edit]

Last edited by c0ldfusi0n; 15/07/03 11:50 PM.

- cF
Dedicated helper for rent.
#36496 15/07/03 11:48 PM
Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67
Code:
on 1:TEXT:*:#yourchannelhere:{
  if ($istok($read(C:\swear.txt),$1-,32) == $true) {
    kick $chan $nick Swearing is not allowed
  }
}

change C:\swear.txt to ur file and write swear.txt as a worrd on each line. u might want to copy that code and change text to ACTION also cause ppl could /me says cusswordhere


while (demi == nub) {
inc %skill
}
#36497 16/07/03 12:39 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Here is a hash table method, it is also dialog based. Meaning you open the dialog, then add a word. From there, you can choose how harsh youd like the occurance of that word to be. i.e. if someone says f__k, you can choose from "warn, kick, ban, kickban" >:D

http://www.kingtomato.com/snipplets/swearing.zip


-KingTomato
#36498 16/07/03 01:06 AM
Joined: Mar 2003
Posts: 272
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Someone's bored..


- cF
Dedicated helper for rent.
#36499 16/07/03 02:18 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Actually, i made it a while ago. I make scripts for ppl who request them (when i can) and keep them incase others need them. Thats all >:D


-KingTomato
#36500 16/07/03 05:54 PM
Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67
king is an mIRC god dont assume hes attitude or he will smote upon you


while (demi == nub) {
inc %skill
}

Link Copied to Clipboard