mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 16:49:10 +00:00
Moved conditional sleep method, depracted Script#sleep(SleepCondition,
int)
This commit is contained in:
@@ -123,21 +123,17 @@ public class Script implements Runnable {
|
||||
/**
|
||||
* Sleeps until the SleepCondition is valid.
|
||||
*
|
||||
* <B>DEPRECATED!</b> use {@link Time#sleep(SleepCondition, int)}
|
||||
*
|
||||
* @param conn
|
||||
* the condition.
|
||||
* @param timeout
|
||||
* the time in miliseconds before it stops sleeping.
|
||||
* @return whether it ran successfully without timing out.
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean sleep(SleepCondition conn, int timeout) {
|
||||
long start = System.currentTimeMillis();
|
||||
while (!conn.isValid()) {
|
||||
if (start + timeout < System.currentTimeMillis()) {
|
||||
return false;
|
||||
}
|
||||
Time.sleep(50);
|
||||
}
|
||||
return true;
|
||||
return Time.sleep(conn, timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user