RuneHive-Game
Loading...
Searching...
No Matches
BankObjective.java
Go to the documentation of this file.
1
package
com.runehive.content.bot.objective.impl;
2
3
import
com.runehive.content.bot.PlayerBot;
4
import
com.runehive.content.bot.objective.BotObjective;
5
import
com.runehive.content.bot.objective.BotObjectiveListener;
6
import
com.runehive.game.world.position.Position;
7
import
com.runehive.util.RandomUtils;
8
9
public
class
BankObjective
implements
BotObjectiveListener
{
10
11
/** The positions of all the bank locations for the bot to access. */
12
private
static
final
Position
[]
BANK_LOCATIONS
= {
13
new
Position
(3096, 3493),
14
new
Position
(3098, 3493),
15
new
Position
(3095, 3491),
16
new
Position
(3095, 3489)
17
};
18
19
@Override
20
public
void
init
(
PlayerBot
bot
) {
21
Position
position =
RandomUtils
.
random
(
BANK_LOCATIONS
);
22
bot
.walkTo(position, () ->
finish
(
bot
));
23
}
24
25
@Override
26
public
void
finish
(
PlayerBot
bot
) {
27
bot
.schedule(
RandomUtils
.
random
(6, 12), () ->
BotObjective
.
RESTOCK
.init(
bot
));
28
}
29
30
}
com.runehive.content.bot.PlayerBot
The player bot entity.
Definition
PlayerBot.java:29
com.runehive.content.bot.objective.impl.BankObjective
Definition
BankObjective.java:9
com.runehive.content.bot.objective.impl.BankObjective.init
void init(PlayerBot bot)
Definition
BankObjective.java:20
com.runehive.content.bot.objective.impl.BankObjective.finish
void finish(PlayerBot bot)
Definition
BankObjective.java:26
com.runehive.content.bot.objective.impl.BankObjective.BANK_LOCATIONS
static final Position[] BANK_LOCATIONS
The positions of all the bank locations for the bot to access.
Definition
BankObjective.java:12
com.runehive.game.world.position.Position
Represents a single tile on the game world.
Definition
Position.java:14
com.runehive.util.RandomUtils
A static-util class that provides additional functionality for generating pseudo-random numbers.
Definition
RandomUtils.java:22
com.runehive.util.RandomUtils.random
static< T > T random(T[] array)
Pseudo-randomly retrieves a element from array.
Definition
RandomUtils.java:111
com.runehive.content.bot.objective.BotObjective
Definition
BotObjective.java:6
com.runehive.content.bot.objective.BotObjective.RESTOCK
RESTOCK
Definition
BotObjective.java:10
com.runehive.content.bot.objective.BotObjectiveListener
Definition
BotObjectiveListener.java:5
com.runehive.content.bot