mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 8
T
tac0 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Oct 2005
Posts: 8
Well I need a way to write and search a text file.

I want it to have a list of nicks who said something.

Like in it I would want:
Guy1
Mr_Cool
Some`Other[Guy]
Guy2

And I want a way to search it and check if one of the nicks is in there.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
For text-based (non-ini files) read up on /help $read & /help /write

For text-based (ini files) read up on /help $ini, /help $readini, & /help /writeini

If you still need more help after reading those, let us know just how the text file is being created and we'll try to help.

Joined: Oct 2005
Posts: 8
T
tac0 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Oct 2005
Posts: 8
I understand how to write, but for search..

I see:

$read(filename.txt, ??, *help*)

But I don't understand what to put for ??. *help* will be changed but I left it like that to search for help in the file.

Also, I dont know how I would use it.

I'm trying to make it so that when the person says something it will check if they have already said it..

Blah.. I can't really explain it..

If anyone can help on AIM my sn is tent0es.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
From the mIRC help file
Quote:
//echo $read(info.txt, s, mirc)

Scans the file info.txt for a line beginning with the word mirc and returns the text following the match value.

//echo $read(help.txt, w, *help*)

Scans the file help.txt for a line matching the wildcard text *help*. The r switch implies a regex match.

If you specify the s, w, or r switches, you can also specify the N value to specify the line you wish to start searching from in the file, eg.:

//echo $read(versions.txt, w, *mirc*, 100)


Joined: Oct 2005
Posts: 8
T
tac0 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Oct 2005
Posts: 8
Yes, I read that.

Well, this is how I need it.. I don't know how to explain any better..

If (their nick is in the file) {
do this
}

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
On *:Text:someword:#: {
  if (!$read(check.txt,w,$+(*,$1,*))) write check.txt $nick
  else { echo -a *** $nick exists }
}


-Andy


Link Copied to Clipboard