 |
Ulokye Newbie
Joined: 08 Sep 2002 Posts: 4 Location: Sweden
|
Posted: Sun Sep 08, 2002 10:19 am
Gathering script |
I am looking for a command that allows me to
read one line of a text file the do the commands and the when done read the next line in the file untill compleate
I am not an especally good user of zmud so keep it simple
Thanks on my behalf
Ulokye
"Bob we worship thee"
Exodus cuote |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Sep 08, 2002 12:42 pm |
What you want is the #READ command:
#READ filename
Kjata |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Wed Sep 11, 2002 2:26 am |
You could work things like:
#FILE 1 my_command_list_file_name_here.txt
#VAR File_1_ReadPosition 1
#VAR ReadFileLine 0
Some sort of trigger that either is based on time (#ALARM) or mud output that contains
#IF ((@ReadFileLine) AND (@File_1_ReadPosition < %filesize(1))) {%read(1,@File_1_ReadPosition);#ADD File_1_ReadPosition 1}
I don't know what you are doing exactly or what kind commands you are sending to the mud to figure out how fast you should be spamming the mud etc so I leave the above trigger to figure out for yourself.
To start reading the file you would toggle the variable @ReadFileLine:
#VAR ReadFileLine 1
To stop the file reading for what ever reason:
#VAR ReadFileLine 0
To start the commands at the beginning of the file again:
#VAR File_1_ReadPosition 1
Ton Diening |
|
|
 |
|
|