mIRC Home    About    Download    Register    News    Help

Print Thread
find a word in a line #100999 19/10/04 10:15 AM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
Hi all.

How can i find a specific word in a line, take out the word next to it and.. write it down in a file.
This is what i got at the moment:

on *:text:*:#: {
if (theword isin $1-) { write $mircdirtxtfiles\word.txt $1- }
}

This however just writes the word wich was isin the line and not the word i need: for example: theword WORD
i need the WORD to write down.
The WORD is a unknown word so i cannot use the isin for that.

Greetz
Aaron


Deridio fatum
Re: find a word in a line #101000 19/10/04 10:51 AM
Joined: May 2004
Posts: 95
W
wiebe Offline
Babel fish
Offline
Babel fish
W
Joined: May 2004
Posts: 95
there are probably better ways to do this, but i made this of it:
Code:
$ [ $+ [ $calc($findtok($1-,theword,1,32) +1) ] ]

Re: find a word in a line #101001 19/10/04 11:35 AM
Joined: Mar 2004
Posts: 175
Relinsquish Offline
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Code:
On *:TEXT:*:#: {
If ($Istok($1-,theword,32) == $True) { write txtfiles\word.txt $($+($,$Calc($Findtok($1-,theword,1,32) + 1)),2) }
}


- Relinsquish
Re: find a word in a line #101002 19/10/04 12:22 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
No need for the eval.
Code:

on *:TEXT:*:#: if $findtok($$1-,theword,1,32) { write txtfiles\word.txt $gettok($1-,$calc($v1 + 1),32) }



Gone.
Re: find a word in a line #101003 19/10/04 07:57 PM
Joined: Mar 2004
Posts: 175
Relinsquish Offline
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Eval and Gettok do the same thing in this situation. cool


- Relinsquish
Re: find a word in a line #101004 20/10/04 05:19 AM
Joined: Jan 2004
Posts: 129
A
AaronL Offline OP
Vogon poet
OP Offline
Vogon poet
A
Joined: Jan 2004
Posts: 129
hi FiberOptics and Relinsquish.

These routine you gave me works awesome. thanks

Greetz
Aaron


Deridio fatum