Package org.dreambot.api.randoms
Class RandomSolver
- java.lang.Object
-
- org.dreambot.api.randoms.RandomSolver
-
- All Implemented Interfaces:
java.util.EventListener,PaintListener
- Direct Known Subclasses:
BankPinConfirmSolver,BankPinSolver,BreakSolver,DeathsDoor,DismissBankNotificationTutorial,DismissBankTutorial,DismissSolver,GameLayoutSolver,GenieSolver,LoginSolver,RoofDisabler,WelcomeScreenSolver
public abstract class RandomSolver extends java.lang.Object implements PaintListener, java.util.EventListener
-
-
Constructor Summary
Constructors Constructor Description RandomSolver(java.lang.String eventString)RandomSolver(RandomEvent event)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddisable()voidenable()java.lang.StringgetDebugInfo()This will return state information about the solver useful for debuggingjava.lang.StringgetEventString()intgetMinimumRest()booleanisEnabled()booleanisForceDisable()longlastRan()voidonFinish()Runs once at the end (when shouldExecute first returns false); This method can be optionally overriddenabstract intonLoop()Runs as long as shouldExecute returns true; This method must be overriddenvoidonPaint(java.awt.Graphics graphics)Handles the graphic for the script.voidonPaint(java.awt.Graphics2D graphics)Handles the graphic for the script.voidonStart()Runs once when the random solver first activates; This method can be optionally overriddenvoidsetForceDisable(boolean forceDisable)abstract booleanshouldExecute()Checks whether the random even solver should execute; This method must be overridden
-
-
-
Constructor Detail
-
RandomSolver
public RandomSolver(RandomEvent event)
-
RandomSolver
public RandomSolver(java.lang.String eventString)
-
-
Method Detail
-
getDebugInfo
public java.lang.String getDebugInfo()
This will return state information about the solver useful for debugging- Returns:
- state information about the solver
-
shouldExecute
public abstract boolean shouldExecute()
Checks whether the random even solver should execute; This method must be overridden- Returns:
- true as long as the random executor should be executing
-
onStart
public void onStart()
Runs once when the random solver first activates; This method can be optionally overridden
-
onLoop
public abstract int onLoop()
Runs as long as shouldExecute returns true; This method must be overridden- Returns:
- time to delay before next onLoop
-
onFinish
public void onFinish()
Runs once at the end (when shouldExecute first returns false); This method can be optionally overridden
-
getEventString
public java.lang.String getEventString()
-
onPaint
public void onPaint(java.awt.Graphics graphics)
Description copied from interface:PaintListenerHandles the graphic for the script.- Specified by:
onPaintin interfacePaintListener- Parameters:
graphics- The Graphics instance sent from the canvas.
-
onPaint
public void onPaint(java.awt.Graphics2D graphics)
Description copied from interface:PaintListenerHandles the graphic for the script.- Specified by:
onPaintin interfacePaintListener- Parameters:
graphics- The Graphics instance sent from the canvas.
-
disable
public void disable()
-
enable
public void enable()
-
isEnabled
public boolean isEnabled()
-
lastRan
public long lastRan()
-
isForceDisable
public boolean isForceDisable()
-
setForceDisable
public void setForceDisable(boolean forceDisable)
-
getMinimumRest
public int getMinimumRest()
-
-