Package com.osrsbots.orb.api.util
Class ScriptUtil
- java.lang.Object
-
- com.osrsbots.orb.api.util.ScriptUtil
-
public class ScriptUtil extends java.lang.ObjectThe ScriptUtil class provides utility methods for interacting with the scripting framework provided by the ORB API. It facilitates actions such as setting loop delays, stopping scripts, toggling user input, and displaying text on the game overlay.
-
-
Constructor Summary
Constructors Constructor Description ScriptUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddEventListener(com.osrsbots.orb.api.events.framework.EventListener listener)static voidaddSubscriptionListener(java.lang.Object object)static voiddebugActions(boolean enabled)static java.lang.StringgetDiscordUsername()static voidremoveEventListener(com.osrsbots.orb.api.events.framework.EventListener listener)static voidremoveSubscriptionListener(java.lang.Object object)static voidsetLoopDelay(int min, int max)Sets the loop delay for the script execution within the specified range.static voidsetTasks(java.util.List<ScriptTask> tasks)static voidstop()Stops the script execution without providing a specific message.static voidstop(java.lang.String msg)Stops the script execution with an optional message.
-
-
-
Method Detail
-
setLoopDelay
public static void setLoopDelay(int min, int max)Sets the loop delay for the script execution within the specified range. Script#onLoop() will be called every min-max milliseconds.- Parameters:
min- Minimum loop delay in milliseconds.max- Maximum loop delay in milliseconds.
-
setTasks
public static void setTasks(@Nonnull java.util.List<ScriptTask> tasks)
-
stop
public static void stop(java.lang.String msg)
Stops the script execution with an optional message. Script#onStop() is immediately called.- Parameters:
msg- Optional message to be displayed when stopping the script.
-
stop
public static void stop()
Stops the script execution without providing a specific message. Script#onStop() is immediately called.
-
addSubscriptionListener
public static void addSubscriptionListener(@Nonnull java.lang.Object object)
-
removeSubscriptionListener
public static void removeSubscriptionListener(@Nonnull java.lang.Object object)
-
addEventListener
public static void addEventListener(@Nonnull com.osrsbots.orb.api.events.framework.EventListener listener)
-
removeEventListener
public static void removeEventListener(@Nonnull com.osrsbots.orb.api.events.framework.EventListener listener)
-
getDiscordUsername
public static java.lang.String getDiscordUsername()
-
debugActions
public static void debugActions(boolean enabled)
-
-