RuneHive-Game
Loading...
Searching...
No Matches
WildernessWalkObjective.java
Go to the documentation of this file.
1package com.runehive.content.bot.objective.impl;
2
3import com.runehive.content.bot.PlayerBot;
4import com.runehive.content.bot.objective.BotObjectiveListener;
5import com.runehive.game.world.position.Position;
6import com.runehive.util.RandomUtils;
7
9
10 @Override
11 public void init(PlayerBot bot) {
12 bot.loop(1, () -> {
13 if (bot.movement.needsPlacement()) {
14 return;
15 }
16
17 int x = bot.getX() + RandomUtils.inclusive(-5, 5);
18 int y = bot.getY() + RandomUtils.inclusive(-5, 5);
19 if (x < 3061) x = 3061;
20 if (y < 3525) y = 3525;
21 if (x > 3101) x = 3101;
22 if (y > 3547) y = 3547;
23
24 bot.walkExactlyTo(Position.create(x, y));
25 bot.pause(RandomUtils.inclusive(4, 15));
26 });
27 }
28
29 @Override
30 public void finish(PlayerBot bot) {
31 }
32
33}
Represents a single tile on the game world.
Definition Position.java:14
static Position create(int x, int y, int z)
Creates a location.
A static-util class that provides additional functionality for generating pseudo-random numbers.
static int inclusive(int min, int max)
Returns a pseudo-random int value between inclusive min and inclusive max.