Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Ulokye
Newbie


Joined: 08 Sep 2002
Posts: 4
Location: Sweden

PostPosted: 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
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Sep 08, 2002 12:42 pm   
 
What you want is the #READ command:
#READ filename

Kjata
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net