Package org.rspeer.game
Class Game
- java.lang.Object
-
- org.rspeer.game.Game
-
public class Game extends Object
Provides general game state operations
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Game.ScriptExecutor
-
Field Summary
Fields Modifier and Type Field Description static int
STATE_AUTHENTICATOR_SCREEN
static int
STATE_CONNECTION_LOST
static int
STATE_CREDENTIALS_SCREEN
static int
STATE_HOPPING_WORLD
static int
STATE_IN_GAME
static int
STATE_LOADING_GAME
static int
STATE_LOADING_REGION
static int
STATE_LOGGING_IN
-
Constructor Summary
Constructors Constructor Description Game()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addMouseListener(BotMouseListener listener)
Deprecated.static void
call(Runnable runnable)
static <T> T
call(Callable<T> callable)
Executes code on the game threadstatic <T> CompletableFuture<T>
callAsync(Function<RSClient,T> function)
Executes code on the game threadstatic AccountType
getAccountType()
static Predicate<MenuActionEvent>
getActionFilter()
static Canvas
getCanvas()
static RSClient
getClient()
static RSClientPreferences
getClientPreferences()
static int
getEngineCycle()
static EventDispatcher
getEventDispatcher()
static EventMediator
getEventMediator()
static List<BotMouseListener>
getMouseListeners()
Deprecated.static Proxy
getProxy()
static Pair<String,String>
getProxyCredentials()
static int
getRemainingMembershipDays()
static int
getRevision()
static int
getState()
static int
getTick()
static boolean
isLoadingRegion()
static boolean
isLoggedIn()
static boolean
isMembershipPresent()
static boolean
isOnCredentialsScreen()
static boolean
isVerboseMenuActions()
static boolean
logout()
static boolean
logout(boolean xlog)
static void
queueAction(Action action)
static void
queueAction(MenuAction action)
static void
removeMouseListener(BotMouseListener listener)
Deprecated.static void
setActionFilter(Predicate<MenuActionEvent> actionFilter)
static void
setClient(RSClient client)
static void
setFps(int fps)
static void
setProxy(Proxy proxy)
static void
setProxyCredentials(Pair<String,String> proxyCredentials)
static void
setVerboseMenuActions(boolean verboseMenuActions)
-
-
-
Field Detail
-
STATE_LOADING_GAME
public static final int STATE_LOADING_GAME
- See Also:
- Constant Field Values
-
STATE_CREDENTIALS_SCREEN
public static final int STATE_CREDENTIALS_SCREEN
- See Also:
- Constant Field Values
-
STATE_AUTHENTICATOR_SCREEN
public static final int STATE_AUTHENTICATOR_SCREEN
- See Also:
- Constant Field Values
-
STATE_LOGGING_IN
public static final int STATE_LOGGING_IN
- See Also:
- Constant Field Values
-
STATE_LOADING_REGION
public static final int STATE_LOADING_REGION
- See Also:
- Constant Field Values
-
STATE_IN_GAME
public static final int STATE_IN_GAME
- See Also:
- Constant Field Values
-
STATE_CONNECTION_LOST
public static final int STATE_CONNECTION_LOST
- See Also:
- Constant Field Values
-
STATE_HOPPING_WORLD
public static final int STATE_HOPPING_WORLD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getClient
public static RSClient getClient()
-
getRevision
public static int getRevision()
-
setClient
public static void setClient(RSClient client)
-
setFps
public static void setFps(int fps)
-
getTick
public static int getTick()
-
getRemainingMembershipDays
public static int getRemainingMembershipDays()
-
isMembershipPresent
public static boolean isMembershipPresent()
-
logout
public static boolean logout()
-
logout
public static boolean logout(boolean xlog)
-
getAccountType
public static AccountType getAccountType()
-
addMouseListener
@Deprecated public static void addMouseListener(BotMouseListener listener)
Deprecated.- See Also:
GameCanvas
-
removeMouseListener
@Deprecated public static void removeMouseListener(BotMouseListener listener)
Deprecated.- See Also:
GameCanvas
-
getMouseListeners
@Deprecated public static List<BotMouseListener> getMouseListeners()
Deprecated.- See Also:
GameCanvas
-
queueAction
public static void queueAction(MenuAction action)
-
queueAction
public static void queueAction(Action action)
-
getClientPreferences
public static RSClientPreferences getClientPreferences()
-
getState
public static int getState()
-
isLoggedIn
public static boolean isLoggedIn()
-
isOnCredentialsScreen
public static boolean isOnCredentialsScreen()
-
isLoadingRegion
public static boolean isLoadingRegion()
-
getEngineCycle
public static int getEngineCycle()
-
getCanvas
public static Canvas getCanvas()
-
getEventMediator
public static EventMediator getEventMediator()
-
getEventDispatcher
public static EventDispatcher getEventDispatcher()
-
call
public static <T> T call(Callable<T> callable)
Executes code on the game thread- Type Parameters:
T
- The return type- Parameters:
callable
- The task to call- Returns:
- The value returned from the task, or
null
-
callAsync
public static <T> CompletableFuture<T> callAsync(Function<RSClient,T> function)
Executes code on the game thread- Type Parameters:
T
- The return type- Returns:
- The value returned from the task, or
null
-
call
public static void call(Runnable runnable)
-
getProxy
public static Proxy getProxy()
-
setProxy
public static void setProxy(Proxy proxy)
-
getActionFilter
public static Predicate<MenuActionEvent> getActionFilter()
-
setActionFilter
public static void setActionFilter(Predicate<MenuActionEvent> actionFilter)
-
isVerboseMenuActions
public static boolean isVerboseMenuActions()
-
setVerboseMenuActions
public static void setVerboseMenuActions(boolean verboseMenuActions)
-
-