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:
Generated
+2
@@ -5,6 +5,8 @@
|
|||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Bank.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Bank.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Mine.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Mine.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public class Main extends Script implements MessageListener, Paintable {
|
|||||||
if(Variables.skill_to_train == null) {
|
if(Variables.skill_to_train == null) {
|
||||||
strategies.add(new Bank());
|
strategies.add(new Bank());
|
||||||
strategies.add(new Walk());
|
strategies.add(new Walk());
|
||||||
|
strategies.add(new PickupItems());
|
||||||
}
|
}
|
||||||
strategies.add(new HandleLogin());
|
strategies.add(new HandleLogin());
|
||||||
provide(strategies);
|
provide(strategies);
|
||||||
|
|||||||
@@ -28,9 +28,11 @@ public class Variables {
|
|||||||
|
|
||||||
// Woodcutting
|
// Woodcutting
|
||||||
public static Trees woodcutting_tree_selected = Trees.NORMAL;
|
public static Trees woodcutting_tree_selected = Trees.NORMAL;
|
||||||
|
public static String woodcutting_method = "Fletch";
|
||||||
|
|
||||||
// Mining
|
// Mining
|
||||||
public static Ores mining_ore_selected = Ores.COPPER_TIN;
|
public static Ores mining_ore_selected = Ores.COPPER_TIN;
|
||||||
|
public static String mining_method = "Bank";
|
||||||
|
|
||||||
// Used for slave accounts
|
// Used for slave accounts
|
||||||
public static String slaveMaster = "";
|
public static String slaveMaster = "";
|
||||||
@@ -100,4 +102,38 @@ public class Variables {
|
|||||||
if (skill_to_train == null) return;
|
if (skill_to_train == null) return;
|
||||||
expGained = skill_to_train.getExperience() - baseExperience;
|
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() {
|
public boolean activate() {
|
||||||
return Variables.running
|
return Variables.running
|
||||||
&& Game.isLoggedIn()
|
&& Game.isLoggedIn()
|
||||||
|
&& Variables.shouldBankItems()
|
||||||
&& (Variables.getStatus() == "none" || Variables.getStatus() == "banking items")
|
&& (Variables.getStatus() == "none" || Variables.getStatus() == "banking items")
|
||||||
&& Inventory.isFull();
|
&& Inventory.isFull();
|
||||||
}
|
}
|
||||||
@@ -36,10 +37,14 @@ public class Bank implements Strategy {
|
|||||||
banker[0].interact(Npcs.Option.BANK);
|
banker[0].interact(Npcs.Option.BANK);
|
||||||
Time.sleep(3000);
|
Time.sleep(3000);
|
||||||
if (Game.getOpenInterfaceId() == 5292) {
|
if (Game.getOpenInterfaceId() == 5292) {
|
||||||
//Pick Axes
|
if (Variables.skill_to_train == Skill.MINING)
|
||||||
org.rev317.min.api.methods.Bank.depositAllExcept(1266, 1268, 1270, 1272, 1274, 1276);
|
org.rev317.min.api.methods.Bank.depositAllExcept(1266, 1268, 1270, 1272, 1274, 1276);
|
||||||
//Axes
|
if (Variables.skill_to_train == Skill.WOODCUTTING)
|
||||||
//org.rev317.min.api.methods.Bank.depositAllExcept(1350, 1352, 1354, 1356, 1358, 1360, 6740);
|
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");
|
Variables.setStatus("none");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ParaScript.data.variables.Ores;
|
|||||||
import org.parabot.environment.api.utils.Time;
|
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.Inventory;
|
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.Players;
|
||||||
import org.rev317.min.api.methods.SceneObjects;
|
import org.rev317.min.api.methods.SceneObjects;
|
||||||
import org.rev317.min.api.wrappers.SceneObject;
|
import org.rev317.min.api.wrappers.SceneObject;
|
||||||
@@ -32,6 +33,9 @@ public class Mine implements Strategy {
|
|||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
try {
|
try {
|
||||||
|
if (Variables.shouldDropItems()) {
|
||||||
|
if (Inventory.getCount(441) >= 1) Inventory.getItem(441).interact(Items.Option.DROP);
|
||||||
|
}
|
||||||
ore.interact(SceneObjects.Option.MINE);
|
ore.interact(SceneObjects.Option.MINE);
|
||||||
Time.sleep(1000);
|
Time.sleep(1000);
|
||||||
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 3000);
|
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 {
|
public class UI extends JFrame {
|
||||||
private final ButtonGroup woodcutOptionButtonGroup = new ButtonGroup();
|
private final ButtonGroup woodcutOptionButtonGroup = new ButtonGroup();
|
||||||
private JPanel contentPane;
|
private JPanel contentPane;
|
||||||
|
|
||||||
// Login tab
|
// Login tab
|
||||||
private JTextField username = new JTextField();
|
private JTextField username = new JTextField();
|
||||||
private JPasswordField password = new JPasswordField();
|
private JPasswordField password = new JPasswordField();
|
||||||
private JCheckBox autoLogin = new JCheckBox();
|
private JCheckBox autoLogin = new JCheckBox();
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
private JComboBox skillSelect = new JComboBox();
|
private JComboBox skillSelect = new JComboBox();
|
||||||
|
|
||||||
// Woodcutting
|
// Woodcutting
|
||||||
private JComboBox treeSelect = new JComboBox();
|
private JComboBox treeSelect = new JComboBox();
|
||||||
|
private JComboBox woodcuttingMethod = new JComboBox();
|
||||||
private JComboBox location = new JComboBox();
|
private JComboBox location = new JComboBox();
|
||||||
private JCheckBox birdsNest = new JCheckBox();
|
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
|
// Mining
|
||||||
private JComboBox oreSelect = new JComboBox();
|
private JComboBox oreSelect = new JComboBox();
|
||||||
|
private JComboBox miningMethod = new JComboBox();
|
||||||
|
|
||||||
// Our colors
|
// Our colors
|
||||||
private Color Color_MidnightBlue = new Color(44, 62, 80);
|
private Color Color_MidnightBlue = new Color(44, 62, 80);
|
||||||
private Color Color_WetAsphalt = new Color(52, 73, 94);
|
private Color Color_WetAsphalt = new Color(52, 73, 94);
|
||||||
@@ -138,7 +142,7 @@ public class UI extends JFrame {
|
|||||||
// Select which tree to cut
|
// Select which tree to cut
|
||||||
JLabel lblTree = new JLabel("Tree");
|
JLabel lblTree = new JLabel("Tree");
|
||||||
lblTree.setForeground(Color_WhiteSmoke);
|
lblTree.setForeground(Color_WhiteSmoke);
|
||||||
lblTree.setBounds(20, 20, 73, 20);
|
lblTree.setBounds(20, 20, 150, 20);
|
||||||
woodcuttingPanel.add(lblTree);
|
woodcuttingPanel.add(lblTree);
|
||||||
treeSelect.setModel(new DefaultComboBoxModel(Trees.toStringArray()));
|
treeSelect.setModel(new DefaultComboBoxModel(Trees.toStringArray()));
|
||||||
treeSelect.setBounds(20, 40, 150, 20);
|
treeSelect.setBounds(20, 40, 150, 20);
|
||||||
@@ -154,22 +158,22 @@ public class UI extends JFrame {
|
|||||||
woodcuttingPanel.add(treeSelect);
|
woodcuttingPanel.add(treeSelect);
|
||||||
|
|
||||||
// What should we do with our logs
|
// What should we do with our logs
|
||||||
JLabel lblMethod = new JLabel("Method");
|
JLabel lblWoodcuttingMethod = new JLabel("Method");
|
||||||
lblMethod.setBounds(20, 120, 73, 20);
|
lblWoodcuttingMethod.setForeground(Color_WhiteSmoke);
|
||||||
woodcuttingPanel.add(lblMethod);
|
lblWoodcuttingMethod.setBounds(20, 60, 150, 20);
|
||||||
|
woodcuttingPanel.add(lblWoodcuttingMethod);
|
||||||
woodcutOptionButtonGroup.add(woodcutting_bank);
|
woodcuttingMethod.setModel(new DefaultComboBoxModel(new String[]{
|
||||||
woodcutting_bank.setSelected(true);
|
"Fletch",
|
||||||
woodcutting_bank.setBounds(20, 140, 80, 20);
|
"Bank",
|
||||||
woodcuttingPanel.add(woodcutting_bank);
|
"Drop",
|
||||||
|
}));
|
||||||
woodcutOptionButtonGroup.add(woodcutting_drop);
|
woodcuttingMethod.setBounds(20, 80, 150, 20);
|
||||||
woodcutting_drop.setBounds(20, 160, 80, 20);
|
woodcuttingMethod.addActionListener (new ActionListener () {
|
||||||
woodcuttingPanel.add(woodcutting_drop);
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
Variables.woodcutting_method = woodcuttingMethod.getSelectedItem().toString();
|
||||||
woodcutOptionButtonGroup.add(woodcutting_fletch);
|
}
|
||||||
woodcutting_fletch.setBounds(20, 180, 80, 20);
|
});
|
||||||
woodcuttingPanel.add(woodcutting_fletch);
|
woodcuttingPanel.add(woodcuttingMethod);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
JLabel lblLocation = new JLabel("Location");
|
JLabel lblLocation = new JLabel("Location");
|
||||||
@@ -234,6 +238,23 @@ public class UI extends JFrame {
|
|||||||
});
|
});
|
||||||
miningPanel.add(oreSelect);
|
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
|
* Slave Panel
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user