Package net.eternalclient.api.script
Class AbstractScript
- java.lang.Object
-
- net.eternalclient.api.script.AbstractScript
-
public abstract class AbstractScript extends java.lang.ObjectThis class provides methods to control the state of a script and retrieve information about the active script. It also defines abstract methods to be implemented by subclasses for script execution.
-
-
Constructor Summary
Constructors Constructor Description AbstractScript()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetScriptAuthor()Retrieves the author of the active script, or "N/A" if no active script exists.static java.lang.StringgetScriptName()Retrieves the name of the active script.static doublegetScriptVersion()Retrieves the version number of the currently active script.static ScriptStategetState()static booleanisPaused()Checks if the script is currently paused.static booleanisRunning()Returns a boolean indicating if the script is currently running.static booleanisStopped()Checks if the script is currently in a stopped state.voidonExit()abstract intonLoop()voidonPause()voidonResume()voidonStart(java.lang.String[] args)static voidsetPaused()Pauses the script if it is currently running.static voidsetResumed()Sets the script state to running if the current state is paused.static voidsetRunning()Sets the state of the script to running.static voidsetState(ScriptState state)static voidsetStopped()Sets the script state to STOPPED and stops the running script.
-
-
-
Method Detail
-
isStopped
public static boolean isStopped()
Checks if the script is currently in a stopped state.- Returns:
- true if the script is stopped, false otherwise.
-
isRunning
public static boolean isRunning()
Returns a boolean indicating if the script is currently running.- Returns:
- true if the script is running, false otherwise
-
isPaused
public static boolean isPaused()
Checks if the script is currently paused.- Returns:
- true if the script is paused, false otherwise.
-
setRunning
public static void setRunning()
Sets the state of the script to running.
-
setPaused
public static void setPaused()
Pauses the script if it is currently running.
-
setResumed
public static void setResumed()
Sets the script state to running if the current state is paused. Returns void.
-
setStopped
public static void setStopped()
Sets the script state to STOPPED and stops the running script.
-
getScriptVersion
public static double getScriptVersion()
Retrieves the version number of the currently active script.- Returns:
- the version number of the active script, or 0.0 if no script is active
-
getScriptName
public static java.lang.String getScriptName()
Retrieves the name of the active script.- Returns:
- the name of the active script as a String, or "NONE" if no active script exists.
-
getScriptAuthor
public static java.lang.String getScriptAuthor()
Retrieves the author of the active script, or "N/A" if no active script exists.- Returns:
- the author of the active script, or "N/A"
-
onLoop
public abstract int onLoop()
-
onStart
public void onStart(java.lang.String[] args)
-
onExit
public void onExit()
-
onPause
public void onPause()
-
onResume
public void onResume()
-
getState
public static ScriptState getState()
-
setState
public static void setState(ScriptState state)
-
-