mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-03 00:38:36 +00:00
Add drop, bank, fletch methods. Add Bank runner
This commit is contained in:
@@ -44,6 +44,7 @@ public class Main extends Script implements MessageListener, Paintable {
|
||||
if(Variables.skill_to_train == null) {
|
||||
strategies.add(new Bank());
|
||||
strategies.add(new Walk());
|
||||
strategies.add(new PickupItems());
|
||||
}
|
||||
strategies.add(new HandleLogin());
|
||||
provide(strategies);
|
||||
|
||||
@@ -28,9 +28,11 @@ public class Variables {
|
||||
|
||||
// Woodcutting
|
||||
public static Trees woodcutting_tree_selected = Trees.NORMAL;
|
||||
public static String woodcutting_method = "Fletch";
|
||||
|
||||
// Mining
|
||||
public static Ores mining_ore_selected = Ores.COPPER_TIN;
|
||||
public static String mining_method = "Bank";
|
||||
|
||||
// Used for slave accounts
|
||||
public static String slaveMaster = "";
|
||||
@@ -100,4 +102,38 @@ public class Variables {
|
||||
if (skill_to_train == null) return;
|
||||
expGained = skill_to_train.getExperience() - baseExperience;
|
||||
}
|
||||
|
||||
public static boolean shouldBankItems(){
|
||||
if (skill_to_train == null) return true;
|
||||
switch (skill_to_train.getName()){
|
||||
case "Woodcutting":
|
||||
return woodcutting_method.equalsIgnoreCase("Bank");
|
||||
case "Mining":
|
||||
return mining_method.equalsIgnoreCase("Bank");
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldDropItems(){
|
||||
if (skill_to_train == null) return false;
|
||||
switch (skill_to_train.getName()){
|
||||
case "Woodcutting":
|
||||
return woodcutting_method.equalsIgnoreCase("Drop");
|
||||
case "Mining":
|
||||
return mining_method.equalsIgnoreCase("Drop");
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldFletchItems(){
|
||||
if (skill_to_train == null) return false;
|
||||
switch (skill_to_train.getName()){
|
||||
case "Woodcutting":
|
||||
return woodcutting_method.equalsIgnoreCase("Fletch");
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class Bank implements Strategy {
|
||||
public boolean activate() {
|
||||
return Variables.running
|
||||
&& Game.isLoggedIn()
|
||||
&& Variables.shouldBankItems()
|
||||
&& (Variables.getStatus() == "none" || Variables.getStatus() == "banking items")
|
||||
&& Inventory.isFull();
|
||||
}
|
||||
@@ -36,10 +37,14 @@ public class Bank implements Strategy {
|
||||
banker[0].interact(Npcs.Option.BANK);
|
||||
Time.sleep(3000);
|
||||
if (Game.getOpenInterfaceId() == 5292) {
|
||||
//Pick Axes
|
||||
org.rev317.min.api.methods.Bank.depositAllExcept(1266, 1268, 1270, 1272, 1274, 1276);
|
||||
//Axes
|
||||
//org.rev317.min.api.methods.Bank.depositAllExcept(1350, 1352, 1354, 1356, 1358, 1360, 6740);
|
||||
if (Variables.skill_to_train == Skill.MINING)
|
||||
org.rev317.min.api.methods.Bank.depositAllExcept(1266, 1268, 1270, 1272, 1274, 1276);
|
||||
if (Variables.skill_to_train == Skill.WOODCUTTING)
|
||||
org.rev317.min.api.methods.Bank.depositAllExcept(1350, 1352, 1354, 1356, 1358, 1360, 6740);
|
||||
if (Variables.skill_to_train == null) {
|
||||
org.rev317.min.api.methods.Bank.depositAllExcept(1350, 1352, 1354, 1356, 1358, 1360, 6740);
|
||||
Variables.addItemGained(Inventory.getCount(true));
|
||||
}
|
||||
Variables.setStatus("none");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import ParaScript.data.variables.Ores;
|
||||
import org.parabot.environment.api.utils.Time;
|
||||
import org.parabot.environment.scripts.framework.Strategy;
|
||||
import org.rev317.min.api.methods.Inventory;
|
||||
import org.rev317.min.api.methods.Items;
|
||||
import org.rev317.min.api.methods.Players;
|
||||
import org.rev317.min.api.methods.SceneObjects;
|
||||
import org.rev317.min.api.wrappers.SceneObject;
|
||||
@@ -32,6 +33,9 @@ public class Mine implements Strategy {
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
if (Variables.shouldDropItems()) {
|
||||
if (Inventory.getCount(441) >= 1) Inventory.getItem(441).interact(Items.Option.DROP);
|
||||
}
|
||||
ore.interact(SceneObjects.Option.MINE);
|
||||
Time.sleep(1000);
|
||||
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000);
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package ParaScript.strategies;
|
||||
|
||||
import ParaScript.data.Variables;
|
||||
import ParaScript.data.variables.Ores;
|
||||
import org.parabot.environment.api.utils.Time;
|
||||
import org.parabot.environment.scripts.framework.Strategy;
|
||||
import org.rev317.min.api.methods.GroundItems;
|
||||
import org.rev317.min.api.methods.Inventory;
|
||||
import org.rev317.min.api.methods.Players;
|
||||
import org.rev317.min.api.methods.SceneObjects;
|
||||
import org.rev317.min.api.wrappers.GroundItem;
|
||||
import org.rev317.min.api.wrappers.SceneObject;
|
||||
|
||||
public class PickupItems implements Strategy {
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
if (Variables.running
|
||||
&& (Variables.getStatus() == "none" || Variables.getStatus() == "picking up items")
|
||||
&& Variables.VARROCK_EAST_MINE_ZONE.inTheZone()
|
||||
&& !Players.getMyPlayer().isInCombat()
|
||||
&& Players.getMyPlayer().getAnimation() == -1
|
||||
&& !Inventory.isFull()) {
|
||||
Variables.setStatus("picking up items");
|
||||
return true;
|
||||
}
|
||||
Variables.setStatus("none");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
GroundItem[] items = GroundItems.getNearest(436, 438, 440);
|
||||
for (GroundItem item : items) {
|
||||
item.take();
|
||||
Time.sleep(1500);
|
||||
if (Inventory.isFull()){
|
||||
Variables.setStatus("none");
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (Exception err){
|
||||
System.out.println("Pickup items error: ¯\\_(ツ)_/¯");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,21 +17,25 @@ import java.awt.event.ActionListener;
|
||||
public class UI extends JFrame {
|
||||
private final ButtonGroup woodcutOptionButtonGroup = new ButtonGroup();
|
||||
private JPanel contentPane;
|
||||
|
||||
// Login tab
|
||||
private JTextField username = new JTextField();
|
||||
private JPasswordField password = new JPasswordField();
|
||||
private JCheckBox autoLogin = new JCheckBox();
|
||||
|
||||
// Settings
|
||||
private JComboBox skillSelect = new JComboBox();
|
||||
|
||||
// Woodcutting
|
||||
private JComboBox treeSelect = new JComboBox();
|
||||
private JComboBox woodcuttingMethod = new JComboBox();
|
||||
private JComboBox location = new JComboBox();
|
||||
private JCheckBox birdsNest = new JCheckBox();
|
||||
private JRadioButton woodcutting_bank = new JRadioButton("Bank");
|
||||
private JRadioButton woodcutting_drop = new JRadioButton("Drop");
|
||||
private JRadioButton woodcutting_fletch = new JRadioButton("Fletch");
|
||||
|
||||
// Mining
|
||||
private JComboBox oreSelect = new JComboBox();
|
||||
private JComboBox miningMethod = new JComboBox();
|
||||
|
||||
// Our colors
|
||||
private Color Color_MidnightBlue = new Color(44, 62, 80);
|
||||
private Color Color_WetAsphalt = new Color(52, 73, 94);
|
||||
@@ -138,7 +142,7 @@ public class UI extends JFrame {
|
||||
// Select which tree to cut
|
||||
JLabel lblTree = new JLabel("Tree");
|
||||
lblTree.setForeground(Color_WhiteSmoke);
|
||||
lblTree.setBounds(20, 20, 73, 20);
|
||||
lblTree.setBounds(20, 20, 150, 20);
|
||||
woodcuttingPanel.add(lblTree);
|
||||
treeSelect.setModel(new DefaultComboBoxModel(Trees.toStringArray()));
|
||||
treeSelect.setBounds(20, 40, 150, 20);
|
||||
@@ -154,22 +158,22 @@ public class UI extends JFrame {
|
||||
woodcuttingPanel.add(treeSelect);
|
||||
|
||||
// What should we do with our logs
|
||||
JLabel lblMethod = new JLabel("Method");
|
||||
lblMethod.setBounds(20, 120, 73, 20);
|
||||
woodcuttingPanel.add(lblMethod);
|
||||
|
||||
woodcutOptionButtonGroup.add(woodcutting_bank);
|
||||
woodcutting_bank.setSelected(true);
|
||||
woodcutting_bank.setBounds(20, 140, 80, 20);
|
||||
woodcuttingPanel.add(woodcutting_bank);
|
||||
|
||||
woodcutOptionButtonGroup.add(woodcutting_drop);
|
||||
woodcutting_drop.setBounds(20, 160, 80, 20);
|
||||
woodcuttingPanel.add(woodcutting_drop);
|
||||
|
||||
woodcutOptionButtonGroup.add(woodcutting_fletch);
|
||||
woodcutting_fletch.setBounds(20, 180, 80, 20);
|
||||
woodcuttingPanel.add(woodcutting_fletch);
|
||||
JLabel lblWoodcuttingMethod = new JLabel("Method");
|
||||
lblWoodcuttingMethod.setForeground(Color_WhiteSmoke);
|
||||
lblWoodcuttingMethod.setBounds(20, 60, 150, 20);
|
||||
woodcuttingPanel.add(lblWoodcuttingMethod);
|
||||
woodcuttingMethod.setModel(new DefaultComboBoxModel(new String[]{
|
||||
"Fletch",
|
||||
"Bank",
|
||||
"Drop",
|
||||
}));
|
||||
woodcuttingMethod.setBounds(20, 80, 150, 20);
|
||||
woodcuttingMethod.addActionListener (new ActionListener () {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Variables.woodcutting_method = woodcuttingMethod.getSelectedItem().toString();
|
||||
}
|
||||
});
|
||||
woodcuttingPanel.add(woodcuttingMethod);
|
||||
|
||||
/*
|
||||
JLabel lblLocation = new JLabel("Location");
|
||||
@@ -234,6 +238,23 @@ public class UI extends JFrame {
|
||||
});
|
||||
miningPanel.add(oreSelect);
|
||||
|
||||
// What should we do with our ores
|
||||
JLabel lblMiningMethod = new JLabel("Method");
|
||||
lblMiningMethod.setForeground(Color_WhiteSmoke);
|
||||
lblMiningMethod.setBounds(20, 60, 150, 20);
|
||||
miningPanel.add(lblMiningMethod);
|
||||
miningMethod.setModel(new DefaultComboBoxModel(new String[]{
|
||||
"Bank",
|
||||
"Drop",
|
||||
}));
|
||||
miningMethod.setBounds(20, 80, 150, 20);
|
||||
miningMethod.addActionListener (new ActionListener () {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Variables.mining_method = miningMethod.getSelectedItem().toString();
|
||||
}
|
||||
});
|
||||
miningPanel.add(miningMethod);
|
||||
|
||||
/*
|
||||
* Slave Panel
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user