public class Bot
extends org.osbot.core.AbstractBot
Modifier and Type | Field and Description |
---|---|
org.osbot.core.debug.ShapeDebugger |
shapeDebug |
Constructor and Description |
---|
Bot(int id,
java.lang.String world,
int revision,
org.osbot.core.account.RSAccount account) |
Modifier and Type | Method and Description |
---|---|
void |
addAudioListener(AudioListener listener)
Adds an audio event listener.
|
void |
addConfigListener(ConfigListener listener)
Adds a config event listener.
|
void |
addGameTickListener(GameTickListener listener)
Adds a game tick listener.
|
void |
addKeyListener(BotKeyListener listener)
Adds a key event listener.
|
void |
addLoginListener(LoginResponseCodeListener listener)
Adds a login event listener.
|
void |
addMessageListener(MessageListener listener)
Adds a message event listener.
|
void |
addMouseListener(BotMouseListener listener)
Adds a mouse event listener.
|
void |
addPainter(Painter painter)
Adds a painter to the bot canvas.
|
void |
cleanup()
Deprecated.
|
void |
clearEventQueue() |
void |
closeSelf() |
void |
dispatchAudioEvent(int cacheIndex) |
void |
dispatchConfigEvent(int id) |
void |
dispatchGameTick() |
void |
dispatchLoginEvent(int id) |
void |
dispatchMessageEvent(Message message) |
void |
executeListenerEvents()
Deprecated.
|
java.util.Set<AudioListener> |
getAudioListeners()
Gets a set of registered audio event listeners.
|
org.osbot.rs07.canvas.BotPanel |
getBotPanel() |
java.util.concurrent.Callable<java.lang.Boolean> |
getBreakCondition() |
org.osbot.rs07.canvas.WrappedCanvas |
getCanvas()
Gets the canvas wrapper associated with this bot.
|
Client |
getClient()
Gets the client wrapper associated with this bot.
|
java.util.Set<ConfigListener> |
getConfigListeners()
Gets a set of registered config event listeners.
|
java.lang.String |
getDisplayName() |
EventExecutor |
getEventExecutor()
Gets the event executor for dispatching and controlling events.
|
ClientFocusEventHandler |
getFocusEventHandler()
Gets the focus event handler for directly dispatching focus events to the client.
|
java.util.Set<GameTickListener> |
getGameTickListeners()
Gets a set of registered game tick listeners.
|
int |
getId()
Gets the unique ID number representing this bot.
|
java.lang.String |
getIdentifierFileName()
Gets the file name that's used to track this RuneScape account by Jagex.
|
ClientKeyEventHandler |
getKeyEventHandler()
Gets the key event handler for directly dispatching key events to the client.
|
java.util.Set<BotKeyListener> |
getKeyListeners()
Gets a set of registered mouse event listeners.
|
long |
getLastGainedXPTimeThreshold()
|
java.lang.String |
getLoadingStage() |
int |
getLoadingStageErrorCode() |
java.util.Set<LoginResponseCodeListener> |
getLoginResponseCodeListeners()
Gets a set of registered login event listeners.
|
java.util.Set<MessageListener> |
getMessageListeners()
Gets a set of registered message event listeners.
|
MethodProvider |
getMethods()
Gets the
MethodProvider context associated with this bot. |
ClientMouseEventHandler |
getMouseEventHandler()
Gets the mouse event handler for directly dispatching mouse events to the client.
|
java.util.Set<BotMouseListener> |
getMouseListeners()
Gets a set of registered mouse event listeners.
|
MouseMoveProfile |
getMouseMoveProfile() |
java.util.Set<Painter> |
getPainters()
Gets the set of painters currently registered.
|
RandomExecutor |
getRandomExecutor()
Gets the random executor for controlling random solvers.
|
ScriptExecutor |
getScriptExecutor()
Gets the script executor for controlling scripts.
|
org.osbot.core.debug.ShapeDebugger |
getShapeDebugger()
A debugger tool which can cache Shapes to debug them.
|
org.osbot.core.gui.side.TabPanel |
getTabPanel() |
int |
getTimeUntilNextBreak()
Gets the time (in seconds) until the next break will occur.
|
void |
initialize()
Deprecated.
|
boolean |
isBreakSettingEnabled()
Checks if the breaks setting is enabled
|
boolean |
isDefaultUser()
Checks whether or not this bot is assigned to the default user
|
boolean |
isLoaded() |
boolean |
isMirrorMode()
Checks if the bot is using mirror mode
|
boolean |
isStopped() |
boolean |
lowCpu() |
void |
removeAudioListener(AudioListener listener)
Removes an audio event listener.
|
void |
removeConfigListener(ConfigListener listener)
Removes a config event listener.
|
void |
removeGameTickListener(GameTickListener listener)
Removes a game tick listener.
|
void |
removeKeyListener(BotKeyListener listener)
Removes a key event listener.
|
void |
removeLoginListener(LoginResponseCodeListener listener)
Removes a config event listener.
|
void |
removeMessageListener(MessageListener listener)
Removes a mouse event listener.
|
void |
removeMouseListener(BotMouseListener listener)
Removes a mouse event listener.
|
void |
removePainter(Painter painter)
Removes a painter from the bot canvas.
|
void |
resetExtensions() |
void |
sendAppletEvent(java.awt.AWTEvent event) |
void |
sendWebhookMessageToManager(org.osbot.rs07.utility.webhooks.WebhookMessage message) |
void |
setBreakCondition(java.util.concurrent.Callable<java.lang.Boolean> breakCondition) |
void |
setCanvas(org.osbot.rs07.canvas.WrappedCanvas canvas)
Deprecated.
|
void |
setLastGainedXPTimeThreshold(java.util.concurrent.TimeUnit timeUnit,
int lastGainedXPTimeThreshold)
MUST BE SET IN
Script.onStart() to above 0. |
void |
setLoadingStage(java.lang.String loadingStage) |
void |
setMouseMoveProfile(MouseMoveProfile mouseMoveProfile) |
void |
stop()
Deprecated.
|
boolean |
switchAccount(java.lang.String username,
java.lang.String password,
int pin) |
boolean |
tryFinishLoading()
Deprecated.
|
public Bot(int id, java.lang.String world, int revision, org.osbot.core.account.RSAccount account)
public boolean isDefaultUser()
public java.lang.String getDisplayName()
public org.osbot.core.gui.side.TabPanel getTabPanel()
public org.osbot.core.debug.ShapeDebugger getShapeDebugger()
public int getLoadingStageErrorCode()
public java.util.concurrent.Callable<java.lang.Boolean> getBreakCondition()
public void setBreakCondition(java.util.concurrent.Callable<java.lang.Boolean> breakCondition)
public boolean switchAccount(java.lang.String username, java.lang.String password, int pin)
public org.osbot.rs07.canvas.BotPanel getBotPanel()
public java.lang.String getLoadingStage()
public void setLoadingStage(java.lang.String loadingStage)
public java.lang.String getIdentifierFileName()
public boolean isLoaded()
public boolean isStopped()
public int getId()
org.osbot.core.AbstractBot
getId
in class org.osbot.core.AbstractBot
public boolean isMirrorMode()
public boolean isBreakSettingEnabled()
public Client getClient()
public org.osbot.rs07.canvas.WrappedCanvas getCanvas()
@Deprecated public void setCanvas(org.osbot.rs07.canvas.WrappedCanvas canvas)
public ScriptExecutor getScriptExecutor()
public RandomExecutor getRandomExecutor()
public EventExecutor getEventExecutor()
public MethodProvider getMethods()
MethodProvider
context associated with this bot.getMethods
in class org.osbot.core.AbstractBot
public ClientMouseEventHandler getMouseEventHandler()
public ClientKeyEventHandler getKeyEventHandler()
public ClientFocusEventHandler getFocusEventHandler()
public java.util.Set<Painter> getPainters()
public void addPainter(Painter painter)
painter
- The painter to addpublic void removePainter(Painter painter)
painter
- The painter to removepublic java.util.Set<BotMouseListener> getMouseListeners()
public java.util.Set<BotKeyListener> getKeyListeners()
public void addMouseListener(BotMouseListener listener)
listener
- The listener to addpublic void addKeyListener(BotKeyListener listener)
listener
- The listener to addpublic void removeMouseListener(BotMouseListener listener)
listener
- The listener to removepublic void removeKeyListener(BotKeyListener listener)
listener
- The listener to removepublic java.util.Set<ConfigListener> getConfigListeners()
public void addConfigListener(ConfigListener listener)
listener
- The listener.public void removeConfigListener(ConfigListener listener)
listener
- The listener.public java.util.Set<LoginResponseCodeListener> getLoginResponseCodeListeners()
public void addLoginListener(LoginResponseCodeListener listener)
listener
- The listener.public void removeLoginListener(LoginResponseCodeListener listener)
listener
- The listener.public java.util.Set<MessageListener> getMessageListeners()
public void addMessageListener(MessageListener listener)
listener
- The listener.public void removeMessageListener(MessageListener listener)
listener
- The listener.public java.util.Set<AudioListener> getAudioListeners()
public void addAudioListener(AudioListener listener)
listener
- The listener.public void removeAudioListener(AudioListener listener)
listener
- The listener.public java.util.Set<GameTickListener> getGameTickListeners()
public void addGameTickListener(GameTickListener listener)
listener
- The listener.public void removeGameTickListener(GameTickListener listener)
listener
- The listener.public void dispatchMessageEvent(Message message)
public void dispatchConfigEvent(int id)
public void dispatchLoginEvent(int id)
public void dispatchAudioEvent(int cacheIndex)
public void dispatchGameTick()
public void clearEventQueue()
@Deprecated public void executeListenerEvents() throws java.lang.InterruptedException
java.lang.InterruptedException
@Deprecated public boolean tryFinishLoading()
@Deprecated public void initialize() throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
public void sendWebhookMessageToManager(org.osbot.rs07.utility.webhooks.WebhookMessage message)
public MouseMoveProfile getMouseMoveProfile()
public void setMouseMoveProfile(MouseMoveProfile mouseMoveProfile)
public void resetExtensions()
public void closeSelf()
public boolean lowCpu()
public void sendAppletEvent(java.awt.AWTEvent event)
@Deprecated public void stop()
@Deprecated public void cleanup()
public long getLastGainedXPTimeThreshold()
public void setLastGainedXPTimeThreshold(java.util.concurrent.TimeUnit timeUnit, int lastGainedXPTimeThreshold)
Script.onStart()
to above 0. OTHERWISE IT WILL NOT BE ACTIVATED. It can be adjusted afterwards from anywhere.
If set to something above 0, this will enable automatic stopping of script if no XP gained after the specified amount of time.
In other words, if the specified time passes and the player has not gained XP, the script will be stopped.
Disabled by default. Set to -1 to disable (or anything equal to or below 0).
This is checked approximately every 5 seconds.timeUnit
- The unit of the timelastGainedXPTimeThreshold
- The time thresholdpublic int getTimeUntilNextBreak()