Package rsb.methods
Class Methods
java.lang.Object
rsb.methods.Methods
- Direct Known Subclasses:
PassiveScript,Random,Script
Provides access to methods that can be used by RSBot scripts.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current client's local player.voidinit(MethodContext ctx) For internal use only: initializes the method providers.voidPrints to the RSBot log with a font colorvoidPrints to the RSBot log.static doublerandom(double min, double max) Returns a random double with min as the inclusive lower bound and max as the exclusive upper bound.static intrandom(int min, int max) Returns a random integer with min as the inclusive lower bound and max as the exclusive upper bound.static voidsleep(int toSleep) Pauses execution for a given number of milliseconds.static voidsleep(int minSleep, int maxSleep) Pauses execution for a random amount of time between two values.booleanChecks for the existence of a RSGroundItem.booleanChecks for the existence of a NPC.booleanChecks for the existence of a RSObject.booleanChecks for the existence of a RSTile.
-
Field Details
-
ctx
-
-
Constructor Details
-
Methods
public Methods()
-
-
Method Details
-
init
For internal use only: initializes the method providers.- Parameters:
ctx- The MethodContext.
-
getMyPlayer
Returns the current client's local player.- Returns:
- The current client's
RSPlayer. - See Also:
-
random
public static int random(int min, int max) Returns a random integer with min as the inclusive lower bound and max as the exclusive upper bound.- Parameters:
min- The inclusive lower bound.max- The exclusive upper bound.- Returns:
- Random integer min (less than or equal) to n (less than) max.
-
verify
Checks for the existence of a NPC.- Parameters:
npc- The NPC to check for.- Returns:
trueif found.
-
verify
Checks for the existence of a RSObject.- Parameters:
o- The RSObject to check for.- Returns:
trueif found.
-
verify
Checks for the existence of a RSTile.- Parameters:
t- The RSTile to check for.- Returns:
trueif found.
-
verify
Checks for the existence of a RSGroundItem.- Parameters:
i- The RSGroundItem to check for.- Returns:
trueif found.
-
random
public static double random(double min, double max) Returns a random double with min as the inclusive lower bound and max as the exclusive upper bound.- Parameters:
min- The inclusive lower bound.max- The exclusive upper bound.- Returns:
- Random double min (less than or equal) to n (less than) max.
-
sleep
public static void sleep(int minSleep, int maxSleep) Pauses execution for a random amount of time between two values.- Parameters:
minSleep- The minimum time to sleep.maxSleep- The maximum time to sleep.- See Also:
-
sleep
public static void sleep(int toSleep) Pauses execution for a given number of milliseconds.- Parameters:
toSleep- The time to sleep in milliseconds.
-
log
Prints to the RSBot log.- Parameters:
message- Object to log.
-
log
Prints to the RSBot log with a font color- Parameters:
color- The color of the fontmessage- Object to log
-