Class TreeBot
- java.lang.Object
-
- com.runemate.game.api.script.framework.AbstractBot
-
- com.runemate.game.api.script.framework.LoopingBot
-
- com.runemate.game.api.script.framework.tree.TreeBot
-
public abstract class TreeBot extends LoopingBot
This is an extension of the LoopingBot class in the same way that TaskBot was. This class aims to provide a more robust implementation than TaskBot did by allowing Tasks to be executed on not only a successful validation, but also on a validation failure.
-
-
Constructor Summary
Constructors Constructor Description TreeBot()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract TreeTask
createRootTask()
Creates the root task, invoked exactly one time per instance of the bot.void
onLoop()
This is where the magic happens.-
Methods inherited from class com.runemate.game.api.script.framework.LoopingBot
getLoopDelay, run, setLoopDelay, setLoopDelay
-
Methods inherited from class com.runemate.game.api.script.framework.AbstractBot
addWebServicesContext, completeRestart, equals, getBridgeService, getCache, getCacheController, getConfiguration, getEmbeddableUI, getEventDispatcher, getFpsRegulator, getGameEventController, getInputManager, getLogger, getMetaData, getPlatform, getSettings, getSettingsManager, getState, hashCode, IiIIiiiiiIIiIi, initiateRestart, isPaused, isRestarting, isRunning, isSafeToPause, isSafeToStop, isStopped, isUnstarted, onPause, onResume, onStart, onStop, onStop, pause, pause, removeWebServicesContext, resume, setEmbeddableUI, setEmbeddableUI, start, stop, stop
-
-
-
-
Method Detail
-
createRootTask
public abstract TreeTask createRootTask()
Creates the root task, invoked exactly one time per instance of the bot.- Returns:
- A non-null TreeTask
-
onLoop
public final void onLoop()
This is where the magic happens. Performs a sort of in-order traversal of the Task tree based on the validator. When a leaf node is reached, it will be executed instead of validated.- Specified by:
onLoop
in classLoopingBot
-
-