mIRC Homepage
Posted By: AaronL find a word in a line - 19/10/04 10:15 AM
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
Posted By: wiebe Re: find a word in a line - 19/10/04 10:51 AM
there are probably better ways to do this, but i made this of it:
Code:
$ [ $+ [ $calc($findtok($1-,theword,1,32) +1) ] ]
Posted By: Relinsquish Re: find a word in a line - 19/10/04 11:35 AM
Code:
On *:TEXT:*:#: {
If ($Istok($1-,theword,32) == $True) { write txtfiles\word.txt $($+($,$Calc($Findtok($1-,theword,1,32) + 1)),2) }
}
Posted By: FiberOPtics Re: find a word in a line - 19/10/04 12:22 PM
No need for the eval.
Code:

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

Posted By: Relinsquish Re: find a word in a line - 19/10/04 07:57 PM
Eval and Gettok do the same thing in this situation. cool
Posted By: AaronL Re: find a word in a line - 20/10/04 05:19 AM
hi FiberOptics and Relinsquish.

These routine you gave me works awesome. thanks

Greetz
Aaron
© mIRC Discussion Forums