uopilot-script-manual
uopilot-script-manual
program UOPilot of the version 1.07 beta 5. Be attentive at use of earlier versions
of the program.
Conditional designations:
<> - obligatory parameter
[] - unessential parameter
SYNTAX
===========
In one line there can be only one command. The first word in a line - command,
other words - parameters. If the first word in a line not the command - the line is
considered as the comment.
It is possible to write the comments after all parameters. Also that consider
everything, that goes after '//'. It is extremely recommended to use such method.
The pauses in commands are specified by default in ms (1/1000 seconds), but the
instruction(indication) of time and obviously, in hours, minutes, seconds is
possible:
wait 500 // to wait for 0.5 seconds
wait 5s // to wait for 5 seconds
wait 1m // to wait 1 minute
wait 1h // to wait 1 hour
Variable
===========
In a name variable the symbols - are allowable ['0'.. '9', 'A'.. 'z', 'A'..'y'],
register am not taken into account. Maximal length of a name variable 255 symbols.
Variable can be numerical and line. Syntax numerical variable '#name', where name -
name variable. Syntax line variable '$name', where name - name variable.
For example:
set #i 20
set $s test string
Also you can use arrays. The symbol of percent '%' is considered as the identifier
of a array. The indexes of a array are specified after a name in square brackets
'[' and ']'. The size of a array is equal to the maximal used index. The giving of
values is carried out to each element individually by command set. The elements of
a array can contain both line, and number. Is allowable to refer to arrays of the
parallel scripts, having specified after a name of a array, through a point, number
of the script. At the indication only of first index in two-dimension a array,
result will be a line from all elements of the second dimension of a array
appropriate to the specified index, and divided by a space.
For example:
set %ar [4] oano // an one-dimensional array on 4 elements
set %arr [50 1] 544
set %arr [50 2] 800 // an two-dimensional a array on 50 times till 2 elements
set %ar.2 [5] // an one-dimensional array in parallel script
left %arr [50] // click by the left button on coordinates 544 800
Take into account, that the elements of arrays cannot directly be used in the
conditional operators:
if charposx <> %arr [50 1]
Before use variable in the scripts you should define it through the command 'set'.
Variable change only at participation 'set' and 'for', the command 'repeat' uses
value, not changing it.
For example:
set #i #i + 1
In the command 'set' you can use the generator of random numbers: random (number)
returns number in a range from 0 up to number-1
For example:
set #a random (2)
At two or more started scripts you can address to variable, certain in other
scripts of the pilot. Syntax of the instruction such variable following:
#i.2 - we address to variable #i from the script which is taking place in a window
number 2.
Variable during performance of the script can be changed through the table of
display variable. The change variable occurs synchronously to a character set.
Reserved variable
=============================
The note 1: [W] means, that you can change value by this variable in the scripts
through the command 'set', all others variable only for reading
The note 2: For correct definition by the Pilot of the majority of parameters of
the character at you on the UO screen the Character Status window should be opened.
str - force
int - intelligence
dex - dexterity
hits - health
mana - mana
stam - stamina
lastliftedid - identifier of a thing, which by last was touched from a place (is
moved, has visited in 'hand'). [W]
lastskill - number last scill which was used through the menu Skills [W]
lastspell - number of last spell which was used through the book [W]
At two or more started scripts you can address to variable, certain in other
scripts of the pilot for others characters, having added to a name variable number
of the script through a point. For example:
set lasttargetid.1 7
say hits.1
In the conditional operators and cycles you can use the following operations: >, <,
=, <>, and also logic operations (and, or, xor). The priorities are not present, is
processed consistently.
For example:
if hour = 23 and min = 45 or #count = 100
In the conditional operators you can use the generator of random numbers: random
(number) returns number in a range from 0 up to number-1
For example:
while (#a = #b) or (random (5) > 3)
For interruption of action of the operators 'while', 'for' and 'repeat' you can use
the command 'Break'. Syntax:
Break [a level]
If the level is more 1, interrupts given amount parental cycles.
The operator 'Continue' continues execution of a cycle on the following step. Can
be used in cycles 'repeat', 'for', 'while'.
At use of last message from the server in the conditional operators, there is some
rule of syntax:
if lastmsg the text of last message or its part
Or
if lastmsg = $a [or lastmsg = $b ...]
I.e. if directly is specified in a condition the text of the message, there should
not be more nothing, including marks of any operations.
The operator IF
--------------------
Syntax:
if <condition>
...
end_if
Or
if <condition>
...
else
...
end_if
Or
if_not <condition>
...
end_if
Or
if_not <condition>
...
else
...
end_if
Or
While_not <condition>
...
end_while
Three variants of conditions are possible:
Syntax:
For #<name> <beginning> <end> [a step]
...
End_for
Cycle, with increase variable. If variable #<name> existed, it is replaced,
differently is added. After end of a cycle variable is equal <end>. If the step is
not specified, it is equal 1.
For example:
For #i 0 10 2
Take into account, that if you set boundary conditions of a cycle through variable,
the pilot reads out values these variable at an input in a cycle and more value
these variable does not check. Therefore change of borders of a cycle inside a
cycle is impossible.
For example:
Goto end
:end
The subroutines it is recommended to have at the end of the script and before them
to put either 'end_script', or 'goto' by the beginning of the script.
Call of procedure
------------------------------
The process of performance of procedure is not displayed, the parameters yet are
not transferred.
For example:
proc saying_message
say test passed
end_proc
call saying_message
end_script
Or command:
stop_script
Without the indication of any parameters.
Pauses
-----------
pause_script
The command pause_script without the instruction of parameters stops performance of
the current script. To start it again, you should set the command resume_script in
the FRIEND SCRIPT with the link to number current (see following)
You can operate work of other scripts started in other windows THIS UoPilot through
below-mentioned commands. Thus as parameter <number> you specify number of a window
of the appropriate script in the UoPilot.
start_script <number>
If the script with such number exists, it will be started
In all these commands, except for first, instead of numbers of the script you can
set parameter 'all' - then the action of the given command will be distributed on
all scripts, loaded in all existing window of the UoPilot.
Concerning use of commands 'pause_script' and 'stop_script' without parameters -
look previous.
Alarm [a file.wav]
Issues a sound signal contained in a file [a file.wav]. At a mistake of
reproduction of a file (incorrect format), or if parameter [a file.wav] is not
specified - the standard sound signal earlier contained in a file msg.wav is
reproduced. If the file is not found, the command is ignored.
For example:
alarm welcome.wav
Flash
To blink in taskbar. Thus in taskbar blinks a window of the Pilot. If you want,
that should blink that window of the UO, to which the current script is adhered,
specify the command flash with any parameter.
For example:
flash something
macro_play [number]
To start loaded macros [number] times, and to wait ending its performance. If
[number] =0 - macros will be carried out indefinitely, by default once. To stop or
start manually it is possible by standard shortcuts.
All commands of work with the mouse, and also some other require the indication of
coordinates. The pilot supports two ways of the indication of coordinates: absolute
coordinates (coordinate of a point from the left top corner of the screen) and
relative coordinates (coordinate of a point from the left top corner of the UO
screen. The caption of a UO window is not taken into account). Set in the scripts
of coordinate you can, having guided the cursor of the mouse on a necessary point
and having pressed a combination Ctrl-A. Thus remember:
1) The window of the UoPilot should be active. That is arrange a window of the UO
under a window of the pilot, choose a window of the pilot, guide the cursor of the
mouse, the necessary point NOT PRESSING ON BUTTONS of the MOUSE and press Ctrl-A.
On execution time of commands of work with the mouse on absolute coordinates, there
is a capture of the mouse.
Move <coordinate>
Moves the cursor to the specified coordinates.
Attention! It is extremely recommended to set this command before the task any of
two below-mentioned commands.
Left <coordinate>
To click the left key of the mouse 1 time in the specified coordinates
Right <coordinate>
To click the right key of the mouse 1 time in the specified coordinates
Double_Left <coordinate>
To click the left key of the mouse 2 times in the specified coordinates
Double_Right <coordinate>
To click the right key of the mouse 2 times in the specified coordinates
left_down <coordinate>
Presses the left button of the mouse in the specified coordinates
left_up <coordinate>
Releases the left button of the mouse in the specified coordinates
right_down <coordinate>
Presses the right button of the mouse in the specified coordinates
right_up <coordinate>
Releases the right button of the mouse in the specified coordinates
Other commands
==============
================================