|
Zene Beginner
Joined: 10 Jul 2002 Posts: 26 Location: Canada
|
Posted: Tue Aug 20, 2002 3:44 am
Reading files question.. |
Hey I was wondering if there is a way to read the same line from a file again...
like for example in my script...
it walks around..but sometimes it has to try to go into the direction a few times because my swim/climb skills are low in %..so i would like it to re-read the previous direction read from the file...i read the help files..but didn't find anything that might work in this manner...
But I just realized, as I am typing this that I can make a variable and fill it up with the last command :)..hehe..but any help to original question would still be appreciated.. |
|
|
|
Burser Wanderer
Joined: 07 Feb 2001 Posts: 70 Location: United Kingdom
|
Posted: Tue Aug 20, 2002 4:06 am |
I'm no expert on this, but if the read-system works like most things, the file pointer can only move down or reset.
---> Burser
|## - The flags have it. |
|
|
|
Zene Beginner
Joined: 10 Jul 2002 Posts: 26 Location: Canada
|
Posted: Tue Aug 20, 2002 3:14 pm |
hehe...well...the idea sounds great..but i'm not sure how to implement it.
Does anyone have any ideas on how i can read the file into a variable...like line by line...
The only thing i can think of is to put a #var varname {<contents of line in file>} at every line...
But the script files do tend to be very big, so i was hoping someone else had an easier solution.. |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Tue Aug 20, 2002 7:29 pm |
quote:
Syntax: #REA filename
#REA n [rec] _noexpand
#REA n [rec] [arguments]
Open the file given by filename and read it line by line, executing each line. This allows you to store commands in a script file and then execute this script. Typically the KILLALL command will be used to clear memory before reading the file.
The second form of this command reads data from the nth file (opened with the FILE command). If n is 1-5, then the file is a text file and rec is the line number to read. If rec is zero or omitted, the next sequential line is read.
Unless I'm missing something
An alias can do:
#READ 1 @V_ThisLine
#ADD V_ThisLine 1
Then you have a trigger modify the location
You try to swim but don't as your big toe found it too cold.
#ADD V_ThisLine -1
If that is timed properly it will re-read the swim direction.
Ton Diening |
|
|
|
|
|