Difference between revisions of "Target"

From OpenEUO
Jump to: navigation, search
m
m
Line 1: Line 1:
 
''target implemented, but undocumented''
 
''target implemented, but undocumented''
  
Target acts like easyuo's target statement; override timeout values are specified in milliseconds.  The default timeout is 3 seconds.  Target returns the current value of UO.TargCurs and the elapsed time (in ms).
+
 
 +
== 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 ==
 
== See Also ==
  
 
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]
 
* [http://www.easyuo.com/openeuo/wiki/index.php/Simplelib simplelib]
 +
 +
* [[spin]]
 +
 +
* [[type]]

Revision as of 14:07, 2 November 2010

target implemented, but undocumented


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