Compare commits
2 Commits
eededcb580
...
3e27bf8a08
Author | SHA1 | Date | |
---|---|---|---|
3e27bf8a08
|
|||
cd6ec994fd
|
@ -11,7 +11,7 @@ import io.reisub.dreambot.util.tasks.kitten.KittenTask;
|
||||
import org.dreambot.api.methods.skills.Skill;
|
||||
import org.dreambot.api.script.Category;
|
||||
import org.dreambot.api.script.ScriptManifest;
|
||||
import org.dreambot.api.utilities.Timer;
|
||||
import org.dreambot.api.script.TaskNode;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@ -25,9 +25,13 @@ public class CAgility extends CTaskScript {
|
||||
getUI().addSkills(Skill.AGILITY);
|
||||
getUI().setCustomLines(1);
|
||||
|
||||
TaskNode kittenTask = KittenTask.getInstance();
|
||||
if (kittenTask != null) {
|
||||
addNodes(kittenTask);
|
||||
}
|
||||
|
||||
addNodes(
|
||||
new Eat(),
|
||||
KittenTask.createKittenTask(),
|
||||
new TurnOnRun(),
|
||||
new HandleObstacle(HandleObstacle.Course.SEERS),
|
||||
new PickupMark()
|
||||
|
@ -4,18 +4,20 @@ import org.dreambot.api.methods.interactive.GameObjects;
|
||||
import org.dreambot.api.methods.interactive.Players;
|
||||
import org.dreambot.api.methods.map.Area;
|
||||
import org.dreambot.api.methods.map.Tile;
|
||||
import org.dreambot.api.methods.walking.path.impl.LocalPath;
|
||||
import org.dreambot.api.wrappers.interactive.GameObject;
|
||||
|
||||
public class Obstacle {
|
||||
private final int id;
|
||||
private final Area area;
|
||||
private final Tile[] walkingTiles;
|
||||
private final LocalPath<Tile> path;
|
||||
private Obstacle next;
|
||||
|
||||
public Obstacle(int id, Area area, Tile... walkingTiles) {
|
||||
this.id = id;
|
||||
this.area = area;
|
||||
this.walkingTiles = walkingTiles;
|
||||
path = new LocalPath<>();
|
||||
path.addAll(walkingTiles);
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
@ -38,7 +40,7 @@ public class Obstacle {
|
||||
return area.contains(Players.localPlayer());
|
||||
}
|
||||
|
||||
public Tile[] getWalkingTiles() {
|
||||
return walkingTiles;
|
||||
public LocalPath<Tile> getPath() {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,9 @@ import org.dreambot.api.methods.item.GroundItems;
|
||||
import org.dreambot.api.methods.map.Area;
|
||||
import org.dreambot.api.methods.map.Tile;
|
||||
import org.dreambot.api.methods.walking.impl.Walking;
|
||||
import org.dreambot.api.methods.walking.path.impl.LocalPath;
|
||||
import org.dreambot.api.script.ScriptManager;
|
||||
import org.dreambot.api.script.TaskNode;
|
||||
import org.dreambot.api.utilities.impl.Condition;
|
||||
import org.dreambot.api.wrappers.interactive.GameObject;
|
||||
import org.dreambot.api.wrappers.items.GroundItem;
|
||||
|
||||
@ -77,8 +77,8 @@ public class HandleObstacle extends TaskNode {
|
||||
new Tile(2735, 3459, 0),
|
||||
new Tile(2735, 3495, 0),
|
||||
new Tile(2698, 3494, 0)),
|
||||
new Tile(2719, 3472, 0),
|
||||
new Tile(2727, 3482, 0)),
|
||||
new Tile(2720, 3470, 0),
|
||||
new Tile(2727, 3480, 0)),
|
||||
new Obstacle(14928, new Area(
|
||||
new Tile(2721, 3489, 3),
|
||||
new Tile(2730, 3489, 3),
|
||||
@ -170,19 +170,20 @@ public class HandleObstacle extends TaskNode {
|
||||
|
||||
boolean isWalking = false;
|
||||
|
||||
if (current.getWalkingTiles() != null && currentObject.distance() > 20) {
|
||||
LocalPath<Tile> path = current.getPath();
|
||||
if (path.size() > 0 && currentObject.distance() > 20) {
|
||||
isWalking = true;
|
||||
|
||||
if (hoverMap.get(current.getID()) == null) {
|
||||
Tile t = current.getWalkingTiles()[0];
|
||||
MiniMapTileDestination td = new MiniMapTileDestination(t);
|
||||
MiniMapTileDestination td = new MiniMapTileDestination(path.first());
|
||||
hoverMap.put(current.getID(), td.getBoundingBox());
|
||||
}
|
||||
|
||||
for (Tile t : current.getWalkingTiles()) {
|
||||
final Tile target = t.getRandomizedTile();
|
||||
Walking.clickTileOnMinimap(target);
|
||||
MethodContext.sleepUntil(() -> target.distance(Players.localPlayer()) < Calculations.random(4, 7), Calculations.random(12000, 13000));
|
||||
for (Tile t : path) {
|
||||
final Tile target = t.getRandomizedTile(1);
|
||||
Walking.clickTileOnMinimap(target)
|
||||
|
||||
MethodContext.sleepUntil(() -> target.distance(Players.localPlayer()) < Calculations.random(4, 7), Calculations.random(14000, 15000));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class CFisher extends TaskScript {
|
||||
public void onStart() {
|
||||
getRandomManager().registerSolver(new GenieSolver(GenieSolver.Skill.HERBLORE));
|
||||
|
||||
TaskNode kittenTask = KittenTask.createKittenTask();
|
||||
TaskNode kittenTask = KittenTask.getInstance();
|
||||
if (kittenTask != null) {
|
||||
addNodes(kittenTask);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class KittenTask extends TaskNodeParent {
|
||||
};
|
||||
|
||||
@Nullable
|
||||
public static KittenTask createKittenTask() {
|
||||
public static KittenTask getInstance() {
|
||||
KittenTask task = null;
|
||||
|
||||
if (Inventory.contains(Constants.KITTEN_INVENTORY)) {
|
||||
|
Reference in New Issue
Block a user