mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-03 00:38:36 +00:00
Update banking and mining
This commit is contained in:
@@ -3,6 +3,7 @@ package ParaScript.data;
|
|||||||
import ParaScript.data.variables.Trees;
|
import ParaScript.data.variables.Trees;
|
||||||
import ParaScript.data.variables.Zone;
|
import ParaScript.data.variables.Zone;
|
||||||
import org.rev317.min.api.wrappers.Tile;
|
import org.rev317.min.api.wrappers.Tile;
|
||||||
|
import org.rev317.min.api.wrappers.TilePath;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ public class Variables {
|
|||||||
private static String currentStatus = "none";
|
private static String currentStatus = "none";
|
||||||
private static String username = "";
|
private static String username = "";
|
||||||
private static String password = "";
|
private static String password = "";
|
||||||
|
public static TilePath pathToWalk;
|
||||||
|
|
||||||
public static String getStatus() {
|
public static String getStatus() {
|
||||||
return currentStatus;
|
return currentStatus;
|
||||||
@@ -23,6 +25,39 @@ public class Variables {
|
|||||||
|
|
||||||
public final static Zone LUMBRIDGE_NORMAL_TREE_ZONE = new Zone(new Tile(3140, 3260), new Tile(3206, 3206));
|
public final static Zone LUMBRIDGE_NORMAL_TREE_ZONE = new Zone(new Tile(3140, 3260), new Tile(3206, 3206));
|
||||||
|
|
||||||
|
// Mining Varrock
|
||||||
|
|
||||||
|
public final static Zone VARROCK_EAST_BANK_ZONE = new Zone(new Tile(3250, 3424), new Tile(3257, 3416));
|
||||||
|
public final static Zone VARROCK_EAST_MINE_ZONE = new Zone(new Tile(3278, 3372), new Tile(3295, 3358));
|
||||||
|
|
||||||
|
public final static Tile[] VARROCK_EAST_MINE_PATH_TO_BANK = new Tile[]{
|
||||||
|
new Tile(3289, 3373),
|
||||||
|
new Tile(3289, 3373),
|
||||||
|
new Tile(3290, 3384),
|
||||||
|
new Tile(3290, 3395),
|
||||||
|
new Tile(3289, 3406),
|
||||||
|
new Tile(3281, 3416),
|
||||||
|
new Tile(3275, 3425),
|
||||||
|
new Tile(3264, 3426),
|
||||||
|
new Tile(3253, 3425),
|
||||||
|
new Tile(3253, 3420),
|
||||||
|
};
|
||||||
|
|
||||||
|
public final static Tile[] VARROCK_EAST_BANK_PATH_TO_MINE = new Tile[] {
|
||||||
|
new Tile(3253, 3423),
|
||||||
|
new Tile(3253, 3423),
|
||||||
|
new Tile(3262, 3427),
|
||||||
|
new Tile(3273, 3427),
|
||||||
|
new Tile(3280, 3418),
|
||||||
|
new Tile(3288, 3408),
|
||||||
|
new Tile(3290, 3397),
|
||||||
|
new Tile(3290, 3386),
|
||||||
|
new Tile(3288, 3375),
|
||||||
|
new Tile(3287, 3371),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String getAccountUsername() { return username; }
|
public static String getAccountUsername() { return username; }
|
||||||
public static void setAccountUsername(String i) { username = i; }
|
public static void setAccountUsername(String i) { username = i; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,44 @@
|
|||||||
package ParaScript.strategies;
|
package ParaScript.strategies;
|
||||||
|
|
||||||
|
import ParaScript.data.Variables;
|
||||||
|
import org.parabot.environment.api.utils.Time;
|
||||||
import org.parabot.environment.scripts.framework.Strategy;
|
import org.parabot.environment.scripts.framework.Strategy;
|
||||||
import org.rev317.min.api.methods.SceneObjects;
|
import org.rev317.min.api.methods.*;
|
||||||
import org.rev317.min.api.wrappers.SceneObject;
|
import org.rev317.min.api.wrappers.Npc;
|
||||||
|
import org.rev317.min.api.wrappers.TilePath;
|
||||||
|
|
||||||
public class Bank implements Strategy {
|
public class Bank implements Strategy {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
return true;
|
return Game.isLoggedIn()
|
||||||
|
&& (Variables.getStatus() == "none" || Variables.getStatus() == "banking items")
|
||||||
|
&& Inventory.isFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
for (SceneObject i : SceneObjects.getNearest(100)) {
|
Variables.pathToWalk = new TilePath(Variables.VARROCK_EAST_MINE_PATH_TO_BANK);
|
||||||
i.interact(SceneObjects.Option.MINE);
|
Variables.setStatus("banking items");
|
||||||
|
while (Variables.pathToWalk != null && !Variables.pathToWalk.hasReached()) {
|
||||||
|
Variables.pathToWalk.traverse();
|
||||||
|
Time.sleep(1000, 2000);
|
||||||
|
}
|
||||||
|
depositItems();
|
||||||
|
}
|
||||||
|
public void depositItems() {
|
||||||
|
Npc banker[] = Npcs.getNearest(494);
|
||||||
|
|
||||||
|
if (banker != null) {
|
||||||
|
banker[0].interact(Npcs.Option.BANK);
|
||||||
|
Time.sleep(3000);
|
||||||
|
if (Game.getOpenInterfaceId() == 5292) {
|
||||||
|
//Pick Axes
|
||||||
|
org.rev317.min.api.methods.Bank.depositAllExcept(1266, 1352, 1354, 1356, 1358, 1360, 6740);
|
||||||
|
//Axes
|
||||||
|
//org.rev317.min.api.methods.Bank.depositAllExcept(1350, 1352, 1354, 1356, 1358, 1360, 6740);
|
||||||
|
Variables.setStatus("none");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ public class Mine implements Strategy {
|
|||||||
if (Variables.running
|
if (Variables.running
|
||||||
&& ore != null
|
&& ore != null
|
||||||
&& (Variables.getStatus() == "none" || Variables.getStatus() == "mining")
|
&& (Variables.getStatus() == "none" || Variables.getStatus() == "mining")
|
||||||
|
&& Variables.VARROCK_EAST_MINE_ZONE.inTheZone()
|
||||||
&& !Players.getMyPlayer().isInCombat()
|
&& !Players.getMyPlayer().isInCombat()
|
||||||
&& Players.getMyPlayer().getAnimation() == -1
|
&& Players.getMyPlayer().getAnimation() == -1
|
||||||
&& !Inventory.isFull()) {
|
&& !Inventory.isFull()) {
|
||||||
@@ -42,8 +43,8 @@ public class Mine implements Strategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private SceneObject ore(){
|
private SceneObject ore(){
|
||||||
for(SceneObject tree : SceneObjects.getNearest(Ores.COPPER_TIN.getIDs())){
|
for(SceneObject ore : SceneObjects.getNearest(Ores.COPPER_TIN.getIDs())){
|
||||||
if(tree != null){
|
if(Variables.VARROCK_EAST_MINE_ZONE.inTheZoneObject(ore)) {
|
||||||
return ore;
|
return ore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package ParaScript.strategies;
|
||||||
|
|
||||||
|
import ParaScript.data.Variables;
|
||||||
|
import org.parabot.environment.api.utils.Time;
|
||||||
|
import org.parabot.environment.scripts.framework.Strategy;
|
||||||
|
import org.rev317.min.api.methods.Game;
|
||||||
|
import org.rev317.min.api.methods.Inventory;
|
||||||
|
import org.rev317.min.api.wrappers.TilePath;
|
||||||
|
|
||||||
|
public class Walk implements Strategy {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean activate() {
|
||||||
|
return Game.isLoggedIn()
|
||||||
|
&& (Variables.getStatus() == "none" || Variables.getStatus() == "walking to mine")
|
||||||
|
&& !Inventory.isFull()
|
||||||
|
&& Variables.VARROCK_EAST_BANK_ZONE.inTheZone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() {
|
||||||
|
Variables.setStatus("walking to mine");
|
||||||
|
Variables.pathToWalk = new TilePath(Variables.VARROCK_EAST_BANK_PATH_TO_MINE);
|
||||||
|
//Variables.setBotStatus("walking to " + Variables.getTree().getName());
|
||||||
|
while (Variables.pathToWalk != null && !Variables.pathToWalk.hasReached()) {
|
||||||
|
Variables.pathToWalk.traverse();
|
||||||
|
Time.sleep(1000, 2000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user