Package org.dreambot.api.script.impl
Class TaskScript
- java.lang.Object
-
- org.dreambot.api.methods.MethodProvider
-
- org.dreambot.api.script.AbstractScript
-
- org.dreambot.api.script.impl.TaskScript
-
- All Implemented Interfaces:
java.lang.Runnable
,java.util.EventListener
,PaintListener
public abstract class TaskScript extends AbstractScript
New replacement for NodeScript. More appropriately named thanks to Harold.Created with IntelliJ IDEA. User: NotoriousPP Date: 11/25/2014 Time: 5:05 PM
-
-
Constructor Summary
Constructors Constructor Description TaskScript()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addNodes(TaskNode... nodes)
Add nodes to task list.TaskNode
getLastTaskNode()
Gets the last task node that has been found valid to be executed.TaskNode[]
getNodes()
Get task list nodes as an array.int
onLoop()
SeeAbstractScript.onLoop()
Checks all accepted nodes and executes the one with the highest priority value If no nodes are found, failCount is incremented by 1 If failCount goes above the failLimit, the script will stop.void
removeNodes(TaskNode... nodes)
Remove select nodes from task list.void
setFailLimit(int failLimit)
Sets the amount the node selector is allowed to fail before stopping the script.-
Methods inherited from class org.dreambot.api.script.AbstractScript
buildRandomManager, getCurrentState, getManifest, getRandomManager, getRandomThread, getScriptId, getSDNName, getSDNParameters, getStoreId, getThreadURL, getVersion, isPaused, onExit, onPaint, onPaint, onPause, onResume, onScheduledStop, onSolverEnd, onSolverStart, onStart, onStart, run, setState, stop
-
Methods inherited from class org.dreambot.api.methods.MethodProvider
debug, error, getScriptManager, info, isUserSponsor, isUserVIP, log, print, sleep, sleep, sleepUntil, sleepUntil, sleepWhile, sleepWhile
-
-
-
-
Method Detail
-
addNodes
public void addNodes(TaskNode... nodes)
Add nodes to task list.- Parameters:
nodes
- the nodes
-
removeNodes
public void removeNodes(TaskNode... nodes)
Remove select nodes from task list.- Parameters:
nodes
- the nodes
-
getNodes
public TaskNode[] getNodes()
Get task list nodes as an array.- Returns:
- the task node [ ]
-
onLoop
public int onLoop()
SeeAbstractScript.onLoop()
Checks all accepted nodes and executes the one with the highest priority value If no nodes are found, failCount is incremented by 1 If failCount goes above the failLimit, the script will stop. failCount is reset to 0 on successfully finding a node to execute. SeesetFailLimit(int)
- Specified by:
onLoop
in classAbstractScript
- Returns:
- highest priority
TaskNode.execute()
value, if no nodes found returns 1000
-
getLastTaskNode
public TaskNode getLastTaskNode()
Gets the last task node that has been found valid to be executed.- Returns:
- last accepted task node to execute.
-
setFailLimit
public void setFailLimit(int failLimit)
Sets the amount the node selector is allowed to fail before stopping the script.Any value less than 0 is considered unlimited.
- Parameters:
failLimit
- the amount allowed to fail
-
-