home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
MODEM
/
TWTERM20.ZIP
/
SCRIPT.DOC
< prev
next >
Wrap
Text File
|
1994-02-15
|
13KB
|
286 lines
Instructions on using TWTERM's script language for creating macros.
====================================================================
!!!!!!!! ABORT MACRO !!!!!!!!
There are going to be times you miscode a macro. Or perhaps line noise
came in and interrupted the macro. Maybe you started the macro from the
wrong place in your game. In any case, if you find yourself stuck in a
macro, use the <ESC> key to get out of it.
How will you know when you are stuck? The screen will sit there and
not end where it should. The keyboard won't respond to your keypresses.
Hit <ESC> anytime you're stuck or just want to end a macro.
NOTE: Sometimes hitting <ESC> won't work the first time. Just keep hitting
<ESC> until you exit.
===================================================================
VARIABLES
There are 23 variables numbered %0 thru %22 that are available for use.
Use these variables for storing of data. Useful when using loops and to
save time typing.
Some of the above variables are used for special purposes. However you can
still access them and even overwrite them. Here is the complete list:
%1 - %8 Available for your use when writing your own macros.
%0 Contains TW's Main prompt. Use this variable to find out
when you have returned to TW's main prompt
%9 Contains TW's Computer prompt. Use this to find out when
you have reached/returned to the Computer prompt
%10-%13 Used by the Built-In macros when being executed. You can use
these for your macros, but when a Built-In macro is run
it will erase anything you have stored here.
%14 Password for the Underground stored here. Once you set a new
password using the UNLOCK macro, you can then send this
variable to access the underground without having to run the
UNLOCK macro again.
%15 Current path is stored here
%16 Contains location of Stardock if found in .DAT file. If found
use this in a macro to take you to Stardock.
%17 Used for storing offer when price haggling via the HAGGLE command
%18 Contains the current sector you are in. Can copy the contents
of this variable to another variable. Then use the other
variable to return back to this sector.
%19 Contains the current sectors Class Type if a port exists.
If not contains Class Type of last port visited.
%20 Contains ships password. Use this variable in a macro when
you need to send a password for one of your ships.
%21 Used by built-in macros to determine whether your ship is
equipped with a Trans-Warp Drive. The colonize macro uses
this variable.
%22 Used by the planet macros to determine/handle the prompts
you will encounter when trying to land on a planet.
When TWTERM encounters one of these variables in your macro, it will check
to see if the macro contains anything. If blank, you will be prompted for
input, if the variable contains something, it will use that instead of
prompting for input. (See the SET command on how to manipulate variables).
==========================================================================
OPERATORS
Operators perform mathmatical or logical operations on variables.
= Use to put a numeric value or text string into a variable.
Syntax: {Variable = Number/TextString}
* Multiplies a variable by a number you specify
Syntax: {Variable * Number}
/ Divides a variable by a number you specify
Syntax: {Variable / Number}
+ Adds to a variable a number you specify
Syntax: {Variable + Number}
- Subtracts from a variable a number you specify
Syntax: {Variable - Number}
Examples: {%10 = 889} Puts "889" into variable 10
{%4 = Hello Commander} Puts "Hello Commander" into 4
{%3 * 2} Multiplies variable 3 by two, then
stores the answer back in var 3
==========================================================================
LABELS
Labels are used to branch back to a previous part of your macro. These
are extremely helpful when coding a loop for your macro.
The label can be any string of text you want, as long as you add a ":"
to the beginning of your labels name. The following are all valid labels:
{:again} or {:Do Again} or {:A}
As you can see, your label must be enclosed within a set of "{}" brackets.
You can use upper or lowercase characters. You can have as many labels as
you want in your macro as long as each label has it's own unique name.
==========================================================================
AVAILABLE COMMANDS
1) All commands must be enclosed within the {} characters.
EX: {Command}
2) Commands must be entered with no spaces between the brackets.
EX: {Command}{Command} This is valid
{Command} {Command} This is not valid
3) Commands can be entered in Upper or Lower case.
------------------------------------------------------------------------
BEEP Makes a Beep sound.
Syntax: {BEEP}
------------------------------------------------------------------------
CHKBUST If you have coded a macro that does a rob or steal loop, then
you will want to use this command to check if you were busted.
If so the macro will end, if not it will continue with the loop.
Syntax: {CHKBUST}
Example: {:loop}
{your rob/steal code goes here}
{chkbust}
{goto loop}
------------------------------------------------------------------------
GOTO Branches to another part of your macro. Excellent for creating
loops in your macros
Syntax: {GOTO LabelName}
Parameters: LabelName
where LabelName is the name of the label you want the
macro to branch to. The macro then executes all of the
commands following that label.
SPECIAL NOTE: LabelName MUST NOT be preceded with a ":". Only the name
of the label. Also, LabelName is not case sensitive. Captalization doesn't
matter as long as the name is spelled correctly.
Example: {:loop}{beep}{goto loop}
{:again}{set}{goto AGAIN}
{send d}{%0}{:HERE}{SEND D}{%0}{GOTO here}
the above are all valid
------------------------------------------------------------------------
HAGGLE Calculates best price to offer when trading, then stores
the amount in variable %17. Also turns on "Haggle Mode".
Syntax: {HAGGLE -}{EndWhere} or {HAGGLE +}{EndWhere}
Parameters: - or +
"-" tells the macro you want to buy. Thus the price
calculated will be 4 1/2% less then what the port
is offering.
"+" tells the macro you are selling. Thus the price
calculated will be 5 1/2% more then what the port is
willing to pay.
EndWhere
This tells TW where to end this command. Enter here
the last few letters of the line to end this command on.
Example: {haggle +}{%0}
The above macro works at a CLASS 8 port and provided you have
only 1 type of product on your ship. After you port and
specify you want to trade, the port will make you an offer.
Run the above macro. It will findout what that offer is,
calculate your offer, then send it back to TW. The macro will
haggle until your offer is accepted, then return you to the
main prompt (%0).
If you are at a port that has something to sell you, then you
would run HAGGLE again this time specifying "-" to haggle for
that one.
Example: {haggle +}{}
When asked to make an offer, run the above macro. It haggles
the best price then returns control to you when done.
------------------------------------------------------------------------
SEND Sends the TW command you want to execute to the modem
Syntax: {SEND CharacterToSend}{EndWhere}
Parameters: CharacterToSend
is the TW command to execute, or user variable you want
executed. If you want a carriage return added put a ";"
on the end.
EndWhere
This tells TW where to end this command. Enter here
the last few letters of the line to end this command on.
Example: {send 4;}{%0}
Unlike other commands in TW, when you move sectors you need
to press <ENTER> to execute the command. By adding ";" to the
end of string to execute, you send an <ENTER> key with it.
The above example sends to TW a "4" and an "ENTER" key. Thus
telling it to move to sector 4. The {%0} says to return
control back to TWTERM when the Main Menu prompt is
encountered.
Example: {SEND %1}{%0}
Here you are sending whatever you have stored in variable one
If you have stored nothing there, you will be prompted to
enter a string of text for execution and storage. Most useful
when wanting to run the same macro over and over, thus you
only have to enter the data once.
Examples: {Send c}{p)?}{send n}{p)?}{SEND Q}{p) ?}
This macro is started from the main prompt. The first set
of brackets tells TWTERM to send the "C" command (enter the
computer), the second set of brackets tell it to wait until
it gets to the computers prompt "p)?". This prompt to search
for is also stored in variable %9. So this command is just as
valid: {Send c}{%9}
Once it gets to the computer prompt it starts the next
command (set of brackets). The next one says to send "N"
which will toggle the color, and wait again until you get
back to the computer prompt.
The third SEND command sends "Q" telling TW to exit the
computer and return to the main menu. At the end of this
command you see "p) ?" (the last 4 letters of TW's main menu
prompt), which tells it to wait until it gets back to TW's
main menu prompt.
With this macro, you can now turn on/off the color in TW
while at the main prompt instead of just at the computer
prompt.
------------------------------------------------------------------------
SET Clears User variables
Syntax: {SET} or {SET variable}
Parameters: variable
is one of the 23 valid variables from %0 thru %22
Using SET without a variable, initilizes variables %0 thru %13 to their
original default values and sets all other variables to null.
Specifing a variable clears only that variable. All variables are valid
here.
Examples: {set %8} clears variable 8
{set} clears all variables between 0-13 and sets
%0 and %9 to their original default values
--------------------------------------------------------------------------
ERROR MESSAGES
The following are some of the error messages you may encounter.
* Incorrect Command
This occurs when you have issued a command that TWTERM doesn't recognize.
Perhaps you have spelled it incorrectly, or used the wrong syntax.
* Wrong Syntax For Label
You're label does not have a ":" at the beginning of it, or perhaps
your forgot to enclose it within the "{}" brackets.
* Label Not Found
You issued a GOTO command and the label you specified cannot be found
in the macro. Make sure your GOTO statement doesn't have a ":" at the
beginning of the label name. Also check to see if the label name is
spelled the same as the one you are using in your GOTO.