Class AbstractScript


  • public abstract class AbstractScript
    extends java.lang.Object
    This 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.String getScriptAuthor()
      Retrieves the author of the active script, or "N/A" if no active script exists.
      static java.lang.String getScriptName()
      Retrieves the name of the active script.
      static double getScriptVersion()
      Retrieves the version number of the currently active script.
      static ScriptState getState()  
      static boolean isPaused()
      Checks if the script is currently paused.
      static boolean isRunning()
      Returns a boolean indicating if the script is currently running.
      static boolean isStopped()
      Checks if the script is currently in a stopped state.
      void onExit()  
      abstract int onLoop()  
      void onPause()  
      void onResume()  
      void onStart​(java.lang.String[] args)  
      static void setPaused()
      Pauses the script if it is currently running.
      static void setResumed()
      Sets the script state to running if the current state is paused.
      static void setRunning()
      Sets the state of the script to running.
      static void setState​(ScriptState state)  
      static void setStopped()
      Sets the script state to STOPPED and stops the running script.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractScript

        public AbstractScript()
    • 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()
      • setState

        public static void setState​(ScriptState state)