Class Script

  • Direct Known Subclasses:
    LoopScript

    public abstract class Script
    extends java.lang.Object
    • Constructor Detail

      • Script

        public Script()
    • Method Detail

      • init

        @Inject
        public void init()
      • onStart

        public abstract boolean onStart​(java.lang.String... args)
      • onBreak

        protected void onBreak()
      • onPause

        protected void onPause()
      • onResume

        protected void onResume()
      • onStop

        protected void onStop()
      • onGameTick

        protected void onGameTick​(GameTickEvent event)
      • onPaint

        protected void onPaint​(java.awt.Graphics2D g2d,
                               APIContext ctx)
      • isRunning

        public final boolean isRunning()
      • isPaused

        public final boolean isPaused()
      • isStopping

        public final boolean isStopping()
      • getLogger

        public final org.apache.logging.log4j.Logger getLogger()
      • resume

        public final void resume()
      • pause

        public final void pause​(java.lang.String reason)
      • startBreak

        public final void startBreak()
      • stop

        public final void stop​(java.lang.String reason)
      • antiRandom

        public final void antiRandom​(java.lang.String reason)
      • addTask

        public void addTask​(ScriptTask task)
      • removeTask

        public void removeTask​(ScriptTask task)
      • setIterationDelay

        public void setIterationDelay​(int iterationDelay)
        The time to sleep after running/checking all tasks.

        Note: set to 0 when using LoopScript since LoopScript.loop() decides how long to sleep.

        Note: when using TreeScript this will be used as the time to sleep after each loop.

        Parameters:
        iterationDelay - the iteration delay/sleep
      • getIterationDelay

        public int getIterationDelay()
        Set the time to sleep after running/checking all tasks.
        Returns:
        int
        See Also:
        setIterationDelay(int)
      • getAPIContext

        public APIContext getAPIContext()
      • getScriptType

        public final ScriptType getScriptType()
      • getScriptProfile

        public final java.util.Optional<java.io.File> getScriptProfile()
        Get the profile/settings this script was started with by the script scheduler.
        Returns:
        File
      • getSettingsDirectory

        public final java.io.File getSettingsDirectory()
        Get the settings directory for this script.
        Returns:
        the directory, for example C:/Users/John/EpicBot/ScriptSettings/Pro Agility/