Class RepeatingTask

All Implemented Interfaces:
Runnable

public class RepeatingTask extends Task
Represents a repeating task defined by a script.
  • Constructor Details

    • RepeatingTask

      public RepeatingTask(Script script, PyFunction function, Object[] functionArgs, boolean async, long delay, long interval)
      Parameters:
      script - The script associated with this repeating task
      function - The script function that should be called every time the repeating task executes
      functionArgs - Any arguments that should be passed to the function
      async - True if the task is asynchronous, false if otherwise
      delay - The delay, in ticks, to wait until running the task
      interval - The interval, in ticks, between each repeat of the task
  • Method Details

    • run

      public void run()
      Called internally when the task executes.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Task
    • toString

      public String toString()
      Prints a representation of this RepeatingTask in string format, including the task ID, if it is async, delay (if applicable), and interval (if applicable)
      Overrides:
      toString in class Task
      Returns:
      A string representation of the RepeatingTask