Package com.epicbot.api.shared.script
Class Script
- java.lang.Object
-
- com.epicbot.api.shared.script.Script
-
- Direct Known Subclasses:
LoopScript
public abstract class Script extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Script()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addTask(ScriptTask task)
void
antiRandom(java.lang.String reason)
APIContext
getAPIContext()
int
getIterationDelay()
Set the time to sleep after running/checking all tasks.org.apache.logging.log4j.Logger
getLogger()
ScriptManifest
getManifest()
RandomHandler
getRandomHandler()
java.util.Optional<java.io.File>
getScriptProfile()
Get the profile/settings this script was started with by the script scheduler.ScriptType
getScriptType()
java.io.File
getSettingsDirectory()
Get the settings directory for this script.ScriptState
getState()
ScriptTaskContainer
getTaskContainer()
void
init()
boolean
isPaused()
boolean
isRunning()
boolean
isStopping()
protected void
onBreak()
protected void
onChatMessage(ChatMessageEvent event)
protected void
onGameTick(GameTickEvent event)
protected void
onPaint(java.awt.Graphics2D g2d, APIContext ctx)
protected void
onPause()
protected void
onResume()
abstract boolean
onStart(java.lang.String... args)
protected void
onStop()
void
pause(java.lang.String reason)
void
removeTask(LoopScriptTask task)
void
removeTask(ScriptTask task)
void
resume()
void
setIterationDelay(int iterationDelay)
The time to sleep after running/checking all tasks.void
startBreak()
void
stop(java.lang.String reason)
void
submitTask(LoopScriptTask task)
-
-
-
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)
-
onChatMessage
protected void onChatMessage(ChatMessageEvent event)
-
onPaint
protected void onPaint(java.awt.Graphics2D g2d, APIContext ctx)
-
getManifest
public final ScriptManifest getManifest()
-
isRunning
public final boolean isRunning()
-
isPaused
public final boolean isPaused()
-
isStopping
public final boolean isStopping()
-
getState
public final ScriptState getState()
-
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)
-
submitTask
public void submitTask(LoopScriptTask task)
-
removeTask
public void removeTask(LoopScriptTask task)
-
setIterationDelay
public void setIterationDelay(int iterationDelay)
The time to sleep after running/checking all tasks.Note: set to 0 when using
LoopScript
sinceLoopScript.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()
-
getTaskContainer
public ScriptTaskContainer getTaskContainer()
-
getRandomHandler
public RandomHandler getRandomHandler()
-
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/
-
-