Target

From OpenEUO
Revision as of 17:43, 8 January 2011 by Ximan (Talk | contribs) (See Also)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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