Difference between revisions of "Sleep"

From Wiki
Jump to: navigation, search
(added quote from Cheffe)
 
(One intermediate revision by one other user not shown)
Line 20: Line 20:
 
</pre>
 
</pre>
  
{{footer}}
+
== Related Commands ==
 +
{| style="background:gainsboro; color:black; border: 2px #aaa solid;"
 +
| Width=250px align=center | [[wait]]
 +
|}
 +
=See Also=
 +
{{Client}}

Latest revision as of 12:58, 13 October 2007

Synopsis

sleep {time}

Description

The sleep command suspends the processing of EasyUO for a specified amount of time, in milliseconds.


Note: For values above 50 ms it is recommended that the wait command be used.

Quoted from Cheffe: Wait durations have to be exactly 50ms or multiples of it because that's how long one cycle takes. Even if you could specify values shorter than 50ms it would still take 50ms because that's how long it takes for the next cycle to start. Now, sleep doesn't work with cycles. It simply stops execution right where it is (freezing the EUO window). After the specified amount of milliseconds, execution is continued and the interrupted cycle continues as well.

If you only had one command per cycle then there wouldn't be any difference between sleep and wait because the interrupted cycle would end right after sleep was executed anyway (because it's only one line per cycle). If you have more lines then the cycle will continue as normal.

Sleep and Wait both don't take any CPU time at all. EUO doesn't do anything while waiting for another cycle to start and Sleep simply pauses the current cycle. Sleep only makes sense for short periods of time (<50ms). If you want to wait for exactly 125ms then you can make a "wait 2" and a "sleep 25". Sleep freezes EUO while wait does not. Thus it makes sense to limit Sleep to very low values because you can combine those two commands to build all other values.

Quote is from this thread: http://www.easyuo.com/forum/viewtopic.php?p=34120#34120

Example

...
; Wait for 5 miliseconds
sleep 5
...

Related Commands

wait

See Also

Client

  • Client commands are used to send information to the Ultima Online client in order to perform an action or effect some change.
chooseSkill Reads the current skill value/lock status for a specific skill
click Clicks at a specific position in the UO client
cmpPix Compares a current pixel to a previously saved pixel
contPos Moves the active topmost gump to a new position
deleteJournal Forgets the contents of the journal buffer
findItem Finds items, monsters, players, NPCs based on object ID or object type
getShopInfo Retrieves information from the client about the currently shown top entry on a shopping gump
getUOTitle Gets the text on the title bar of the client
hideItem Removes an items graphic from the client
ignoreItem Removes items from the list searched by findItem
key Sends a key-stroke to the client
move Moves the character to a specified location
msg Sends a string to the client as keystrokes
nextCPos Denotes where the next opened container/gump will open
onHotKey Performs a line of code if a specific key is pressed
savePix Saves the color of a pixel in a specified location
setShopItem Sets the number of items to purchase given by ID
setUOTitle Sets the text on the title bar of the client
scanJournal Scans the users journal and stores the string for examination
sleep Waits a specified amount of time
target Waits for a target cursor to appear
terminate Terminates the current client
uoXL Start/manage clients
wait Waits a specified amount of time