Difference between revisions of "Target"
From OpenEUO
m (Created page with "''target implemented, but undocumented''") |
m (→See Also) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | == Calling Convention == | |
+ | Call | ||
+ | local targ, time = sl.target([timeout]) | ||
+ | Args | ||
+ | timeout (optional) is the number of milliseconds to wait before timing out | ||
+ | Results | ||
+ | targ is a boolean and reflects the current status of UO.TargCurs | ||
+ | time is the number of milliseconds that have elapsed during the call | ||
+ | |||
+ | == Usage Example == | ||
+ | |||
+ | local targ, time = sl.target(1500) | ||
+ | print(tostring(targ)..' '..tostring(time)) | ||
+ | |||
+ | --> true 780 | ||
+ | |||
+ | == Description == | ||
+ | |||
+ | Target acts like easyuo's target statement; waiting for UO.TargCurs to toggle to true or timing out. Override timeout values are specified in milliseconds. The default timeout is 3 seconds. Target returns the current value of UO.TargCurs and the time elapsed (in ms) during the call. | ||
+ | |||
+ | == Upon Error == | ||
+ | |||
+ | A timeout argument which cannot be converted to a number is silently converted into the default timeout duration. Only a logical run time error in the library itself would cause an error; this error would be recorded and handled according to the operant error redirection mode. | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | * [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib] | ||
+ | |||
+ | * [[chosen]] | ||
+ | |||
+ | * [[spin]] | ||
+ | |||
+ | * [[type]] | ||
+ | |||
+ | * [[UO.TargCurs]] |
Latest revision as of 17:43, 8 January 2011
Calling Convention
Call
local targ, time = sl.target([timeout])
Args
timeout (optional) is the number of milliseconds to wait before timing out
Results
targ is a boolean and reflects the current status of UO.TargCurs time is the number of milliseconds that have elapsed during the call
Usage Example
local targ, time = sl.target(1500) print(tostring(targ)..' '..tostring(time))
--> true 780
Description
Target acts like easyuo's target statement; waiting for UO.TargCurs to toggle to true or timing out. Override timeout values are specified in milliseconds. The default timeout is 3 seconds. Target returns the current value of UO.TargCurs and the time elapsed (in ms) during the call.
Upon Error
A timeout argument which cannot be converted to a number is silently converted into the default timeout duration. Only a logical run time error in the library itself would cause an error; this error would be recorded and handled according to the operant error redirection mode.