Optimize picking up mark
This commit is contained in:
parent
deaba10e18
commit
7cae9e07d0
@ -4,9 +4,12 @@ import io.reisub.dreambot.util.Constants;
|
||||
import io.reisub.dreambot.util.Util;
|
||||
import org.dreambot.api.methods.Calculations;
|
||||
import org.dreambot.api.methods.MethodContext;
|
||||
import org.dreambot.api.methods.MethodProvider;
|
||||
import org.dreambot.api.methods.container.impl.Inventory;
|
||||
import org.dreambot.api.methods.interactive.Players;
|
||||
import org.dreambot.api.methods.item.GroundItems;
|
||||
import org.dreambot.api.script.TaskNode;
|
||||
import org.dreambot.api.utilities.impl.Condition;
|
||||
import org.dreambot.api.wrappers.items.GroundItem;
|
||||
import org.dreambot.api.wrappers.items.Item;
|
||||
|
||||
@ -29,14 +32,14 @@ public class PickupMark extends TaskNode {
|
||||
Item marks = Inventory.get(Constants.MARK_OF_GRACE);
|
||||
final int count = marks == null ? 0 : marks.getAmount();
|
||||
|
||||
mark.interact();
|
||||
mark.interactForceLeft(Constants.TAKE);
|
||||
|
||||
if (MethodContext.sleepUntil(() -> {
|
||||
Item currentMarks = Inventory.get(Constants.MARK_OF_GRACE);
|
||||
return currentMarks != null && currentMarks.getAmount() > count;
|
||||
}, Calculations.random(5000, 5500))) {
|
||||
}, () -> Players.localPlayer().isMoving(), Calculations.random(1200, 1300), 50)) {
|
||||
marksPickedUp++;
|
||||
}
|
||||
};
|
||||
|
||||
return Calculations.random(250, 400);
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ public class Constants {
|
||||
|
||||
// Actions
|
||||
public static final String USE = "Use";
|
||||
public static final String TAKE = "Take";
|
||||
public static final String USE_ROD = "Use-rod";
|
||||
public static final String INTERACT = "Interact";
|
||||
public static final String PICK_UP = "Pick-up";
|
||||
|
Loading…
x
Reference in New Issue
Block a user