www.ClassicTW.com
https://mail.black-squirrel.com/

I'm trying to mape an auto planet move sell script
https://mail.black-squirrel.com/viewtopic.php?f=15&t=13030
Page 1 of 1

Author:  Aidan [ Tue May 18, 2004 12:56 pm ]
Post subject: 

I'm trying to write a Zoc Script that will pull sector numbers from .txt. I want the script to start from the top of the list and go to the end in order i have the sectors listed.

any one that can help me with this code please respond, help a trader out...
Aidan

Author:  Zentock [ Tue May 18, 2004 2:31 pm ]
Post subject: 

a good example of a script that employs a list use function is
the reverends eprobe script you may want to get it and look at it with a txt editor breaking down the processes and isolating the
list reading subroutine and there you will have what your looking for.
i am sure that other more qualified individuals will provide you with other examples but for a zoc script that is the best example i could
find for you.
i hope this helps.

Author:  Harley Nuss [ Tue May 18, 2004 3:24 pm ]
Post subject: 

Hey, a script question in a language I know :) I do it this way:

file1 = "myfile.txt"
myarray. = 0
k = 1
call stream file1, "C", "OPEN READ"
do while lines(file1) = 1
line = linein(file1)
myarray.k = line
k = k + 1
end
call stream file1, "C", "CLOSE"

now myarray.1 = the first line of your file. myarray.32 = line 32 of your file, etc. You could do whatever you want with each line as you pull it it, also. Or if it were a list of sectors (like a fig'd sectors list), you could do myarray.line = 1. Then you could later do a test like:
if myarray.4652 = 1 then do
call zocwriteln "Sector 4652 has a fig"
end

Does this make sense?

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/