|
Alexander Newbie
Joined: 10 May 2004 Posts: 4 Location: Russia
|
Posted: Mon May 10, 2004 2:09 am
Catching and considering text with a list |
Greets, maybe some of you can help.
I have the following trouble
I need to check every line that mud sends to me with a huge list of other lines (stored in a file). and if lines doesnt exist in a list i need get a beep.
I tried to find anything in help files or on this forum - but alas..
Please help. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon May 10, 2004 3:57 am |
I recommend putting the list in a variable. Comparing every line to a huge list will be slow enough without having to go through a file everytime to do it.
#FILE 1 lines.txt
#VAR lines {}
#LOOP 1,%filesize( 1) {#ADDITEM lines {%read( 1, %i)}}
#CLOSE 1
#TR {(*)} {#IF (%ismember( "%1", @lines)) {} {#BEEP}} |
|
|
|
Alexander Newbie
Joined: 10 May 2004 Posts: 4 Location: Russia
|
Posted: Mon May 10, 2004 4:25 am |
Seems i have not slightest clue how it should work.
I will describe my brob in mud:
We have rules preventing us from afk practising,
And those who check if one practices afk send different emotes, questions etc. people here made triggers on most popular questions like "Are you here?" or "Do you prac afk?" but then immortals started to add random spaces into phrases. So it is now totaly imposible to make right patters for triggers.
So my idea was to create the file with all the lines mud sends by default. (it is not THAT large list of lines, probavly 20 or 30, with deaf mode on and prompts off) and then make a trigger that considers everything comes from mud with these standart lines. And if mud sends something different I get alert. |
|
|
|
Alexander Newbie
Joined: 10 May 2004 Posts: 4 Location: Russia
|
Posted: Mon May 10, 2004 10:00 am |
Ohh, lightbulb, it works.
thank you a lot! |
|
|
|
|
|