mIRC Home    About    Download    Register    News    Help

Print Thread
#3426 25/12/02 05:14 AM
Joined: Dec 2002
Posts: 20
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
Okay this I know is easy and I probably can not figure it out cause it is so late...

I have a text file that has a list of 25 words....each on thier own line...

I want to create an on text script that will check to see if any word of a users phrase matches any word in the text file. If it does I want it to come back with a standard phrase (the same phrase for each time)

I hope that all makes sense. -- Thanks!


Scott Roberts
T&R Communications of Florida
sroberts@tnrcomm.com
#3427 25/12/02 08:02 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Code:

on *:TEXT:!find*:#:{
  var %i = 1
  var %s = 
  while ($gettok($1-,%i,32)) {
    if ($read(filename.txt,s,$ifmatch)) %s = $addtok(%s,$ifmatch,44)
    inc %i
  }
  if ($chr(44) isin %s) msg $chan Found: %s ( $+ $nick $+ )
  else msg $chan Sorry $nick $+ , no matches found.
}

Without more information to go on, this is the closest I can come to what you are trying to do. Perhaps it will set you on the correct trail.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#3428 25/12/02 01:06 PM
Joined: Dec 2002
Posts: 20
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
Okay I i wll try that...more detail....I am trying to create a "Swear Jar". What heppens is that I havea text file with 25 or so words that are considered "swear words" Everytime a user uses one of these words in a phrase, the script will respong with
$nick, please deposit 25 cents into the swear jar.

I think the scrip you put will work. Let me try it a nd play with it.

Thanks!


Scott Roberts
T&R Communications of Florida
sroberts@tnrcomm.com
#3429 25/12/02 01:29 PM
Joined: Dec 2002
Posts: 145
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
on *:TEXT:*:#: {
var %i = 1
while (%i <= $lines(yourfile.txt) ) {
if ($read(yourfile.txt,%i) isin $1- ) {
msg $chan $nick $+ , please deposit 25 cents into the swear jar.
return
}
inc %i
}
}

#3430 25/12/02 03:46 PM
Joined: Dec 2002
Posts: 20
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
Thank you kindly! That worked great.

Also thanks for the first script. I am actually using that for another idea that I had.


Scott Roberts
T&R Communications of Florida
sroberts@tnrcomm.com

Link Copied to Clipboard