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

Zoc/REXX Sector info
https://mail.black-squirrel.com/viewtopic.php?f=15&t=26138
Page 1 of 1

Author:  Timberwolf [ Tue Jun 15, 2010 8:39 pm ]
Post subject:  Zoc/REXX Sector info

I'm trying to write REXX scripts for ZOC again after so many years of being away. It's slowly coming back to me, but one issue I'm having is this:

What's the line for a script to grab the current sector that the player is in and use that information in the script? There are many ways to get sector info such as sending "/" or "I".

Using that line (or lines) as a template, I can continue writing my scripts.

Thanks :)

Author:  the reverend [ Tue Jun 15, 2010 9:15 pm ]
Post subject:  Re: Zoc/REXX Sector info

given the line "Command [TL=00:00:00]:[1234] (?=Help)? :", here is a start:

Code:
call zocwait "Command ["
call zocwait "]:["
call zocwait "]"
sector = zoclastline()


the above will give you sector = "1234]" because zoclastline() gives you everything from the current line or the latest zocwait. the following code is an improvement because it strips out the "]".

Code:
call zocwait "Command ["
call zocwait "]:["
call zocwait "]"
parse value zoclastline() with sector "]"


the above will give you sector = "1234". you can refine more by handling the return values from the zocwait calls. zocwait will return the number 640 on a timeout. you can define the timeout period in seconds with the zoctimeout function.

Code:
call zoctimeout 60
if zocwait("Command [") = 640 then exit
if zocwait("]:[") = 640 then exit
if zocwait("]") = 640 then exit
parse value zoclastline() with sector "]"

Author:  Timberwolf [ Tue Jun 15, 2010 9:28 pm ]
Post subject:  Re: Zoc/REXX Sector info

Thanks, Rev. Much appreciated.

Author:  Timberwolf [ Wed Jun 16, 2010 4:33 am ]
Post subject:  Re: Zoc/REXX Sector info

I don't get that line from the Citadel prompt. So what's my option here?

Author:  Singularity [ Wed Jun 16, 2010 6:00 am ]
Post subject:  Re: Zoc/REXX Sector info

Timberwolf wrote:
I don't get that line from the Citadel prompt. So what's my option here?


/, I, S or qdc

Author:  Scrat [ Wed Jun 16, 2010 7:07 pm ]
Post subject:  Re: Zoc/REXX Sector info

Singularity wrote:
Timberwolf wrote:
I don't get that line from the Citadel prompt. So what's my option here?


/, I, S or qdc


You can also activate your computer from the citadel prompt and parse it from the computer prompt:

Computer command [TL=11:32:11]:[466] (?=Help)? ?

Author:  Timberwolf [ Sat Jun 19, 2010 6:07 am ]
Post subject:  Re: Zoc/REXX Sector info

Thanks, Scrat...i'll give it a shot.

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