mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
Allow selection of tree/ore to collect
This commit is contained in:
Generated
+7
-1
@@ -3,7 +3,13 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="3ab8e8a0-ccfd-4b0b-9547-98173085dc38" name="Default Changelist" comment="">
|
||||
<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/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/Ores.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Ores.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Trees.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Trees.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/strategies/WoodcutTree.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/WoodcutTree.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$/target/classes/config.xml" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/config.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package ParaScript.data;
|
||||
|
||||
import ParaScript.data.variables.Ores;
|
||||
import ParaScript.data.variables.Trees;
|
||||
import ParaScript.data.variables.Zone;
|
||||
import org.rev317.min.api.wrappers.Tile;
|
||||
@@ -14,8 +15,16 @@ public class Variables {
|
||||
// Login Panel
|
||||
private static String username = "";
|
||||
private static String password = "";
|
||||
|
||||
// Settings Panel
|
||||
public static String skill_to_train = "Woodcutting";
|
||||
|
||||
// Woodcutting
|
||||
public static int[] woodcutting_tree_selected = Trees.NORMAL.getIDs();
|
||||
|
||||
// Mining
|
||||
public static int[] mining_ore_selected = Ores.COPPER_TIN.getIDs();
|
||||
|
||||
// Used for slave accounts
|
||||
public static String slaveMaster = "";
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum Ores {
|
||||
COPPER_TIN("Copper & Tin", new int[]{2090, 2094}),
|
||||
COPPER("Copper", new int[]{2090}),
|
||||
TIN("Tin", new int[]{2094}),
|
||||
COPPER_TIN("Copper & Tin", new int[]{2090, 2094}),
|
||||
IRON ("Iron", new int[]{2092}),
|
||||
COAL("Coal", new int[]{});
|
||||
|
||||
@@ -31,6 +31,8 @@ public enum Ores {
|
||||
return(simpleArray);
|
||||
}
|
||||
|
||||
public String getName() { return this.name; }
|
||||
|
||||
public int[] getIDs() {
|
||||
return this.ids;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ public enum Trees {
|
||||
return(simpleArray);
|
||||
}
|
||||
|
||||
public String getName() { return this.name; }
|
||||
|
||||
public int[] getIDs() {
|
||||
return this.ids;
|
||||
}
|
||||
|
||||
@@ -41,11 +41,13 @@ public class Mine implements Strategy {
|
||||
}
|
||||
|
||||
private SceneObject ore(){
|
||||
int[] ore_to_mine = Ores.COPPER_TIN.getIDs();
|
||||
if (Inventory.getCount(437) >= 14)
|
||||
ore_to_mine = Ores.TIN.getIDs();
|
||||
if (Inventory.getCount(439) >= 14)
|
||||
ore_to_mine = Ores.COPPER.getIDs();
|
||||
int[] ore_to_mine = Variables.mining_ore_selected;
|
||||
if (ore_to_mine == Ores.COPPER_TIN.getIDs()) {
|
||||
if (Inventory.getCount(437) >= 14)
|
||||
ore_to_mine = Ores.TIN.getIDs();
|
||||
if (Inventory.getCount(439) >= 14)
|
||||
ore_to_mine = Ores.COPPER.getIDs();
|
||||
}
|
||||
for(SceneObject ore : SceneObjects.getNearest(ore_to_mine)){
|
||||
if(Variables.VARROCK_EAST_MINE_ZONE.inTheZoneObject(ore)) {
|
||||
return ore;
|
||||
|
||||
@@ -37,7 +37,8 @@ public class WoodcutTree implements Strategy {
|
||||
}
|
||||
|
||||
private SceneObject tree(){
|
||||
for(SceneObject tree : SceneObjects.getNearest(Trees.NORMAL.getIDs())){
|
||||
int[] tree_to_cut = Variables.woodcutting_tree_selected;
|
||||
for(SceneObject tree : SceneObjects.getNearest(tree_to_cut)){
|
||||
if(tree != null){
|
||||
if(Variables.LUMBRIDGE_NORMAL_TREE_ZONE.inTheZoneObject(tree)) {
|
||||
return tree;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package ParaScript.ui;
|
||||
|
||||
import ParaScript.data.variables.Ores;
|
||||
import ParaScript.data.variables.Trees;
|
||||
import ParaScript.data.Variables;
|
||||
import org.rev317.min.api.methods.Game;
|
||||
@@ -21,12 +22,15 @@ public class UI extends JFrame {
|
||||
private JCheckBox autoLogin = new JCheckBox();
|
||||
// Settings
|
||||
private JComboBox skillSelect = new JComboBox();
|
||||
private JRadioButton bank = new JRadioButton("Bank");
|
||||
private JRadioButton drop = new JRadioButton("Drop");
|
||||
// Woodcutting
|
||||
private JComboBox treeSelect = 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();
|
||||
// Our colors
|
||||
private Color Color_MidnightBlue = new Color(44, 62, 80);
|
||||
private Color Color_WetAsphalt = new Color(52, 73, 94);
|
||||
@@ -107,12 +111,12 @@ public class UI extends JFrame {
|
||||
"Bank Runner",
|
||||
}));
|
||||
skillSelect.setBounds(20, 40, 150, 20);
|
||||
settingsPanel.add(skillSelect);
|
||||
skillSelect.addActionListener (new ActionListener () {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
Variables.skill_to_train = skillSelect.getSelectedItem().toString();
|
||||
}
|
||||
});
|
||||
settingsPanel.add(skillSelect);
|
||||
|
||||
/*
|
||||
* Woodcutting Panel
|
||||
@@ -131,8 +135,35 @@ public class UI extends JFrame {
|
||||
woodcuttingPanel.add(lblTree);
|
||||
treeSelect.setModel(new DefaultComboBoxModel(Trees.toStringArray()));
|
||||
treeSelect.setBounds(20, 40, 150, 20);
|
||||
treeSelect.addActionListener (new ActionListener () {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
for (Trees tree : Trees.values()) {
|
||||
if (tree.getName().equalsIgnoreCase(treeSelect.getSelectedItem().toString())) {
|
||||
Variables.mining_ore_selected = tree.getIDs();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
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 lblLocation = new JLabel("Location");
|
||||
lblLocation.setBounds(200, 20, 73, 20);
|
||||
@@ -142,18 +173,6 @@ public class UI extends JFrame {
|
||||
location.setBounds(200, 40, 150, 20);
|
||||
woodcuttingPanel.add(location);
|
||||
|
||||
JLabel lblMethod = new JLabel("Method");
|
||||
lblMethod.setBounds(20, 120, 73, 20);
|
||||
woodcuttingPanel.add(lblMethod);
|
||||
|
||||
woodcutOptionButtonGroup.add(bank);
|
||||
bank.setSelected(true);
|
||||
bank.setBounds(20, 140, 80, 20);
|
||||
woodcuttingPanel.add(bank);
|
||||
|
||||
woodcutOptionButtonGroup.add(drop);
|
||||
drop.setBounds(20, 160, 80, 20);
|
||||
woodcuttingPanel.add(drop);
|
||||
|
||||
JLabel lblBirdsNest = new JLabel("Bird nests");
|
||||
lblBirdsNest.setForeground(WhiteSmoke);
|
||||
@@ -180,6 +199,34 @@ public class UI extends JFrame {
|
||||
});
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mining Panel
|
||||
*/
|
||||
|
||||
JPanel miningPanel = new JPanel();
|
||||
miningPanel.setForeground(Color_WhiteSmoke);
|
||||
miningPanel.setBackground(Color_WetAsphalt);
|
||||
tabbedPane.addTab("Mining", null, miningPanel, null);
|
||||
miningPanel.setLayout(null);
|
||||
|
||||
// Select which ore to mine
|
||||
JLabel lblOre = new JLabel("Ore");
|
||||
lblOre.setForeground(Color_WhiteSmoke);
|
||||
lblOre.setBounds(20, 20, 73, 20);
|
||||
miningPanel.add(lblOre);
|
||||
oreSelect.setModel(new DefaultComboBoxModel(Ores.toStringArray()));
|
||||
oreSelect.setBounds(20, 40, 150, 20);
|
||||
oreSelect.addActionListener (new ActionListener () {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
for (Ores ore : Ores.values()) {
|
||||
if (ore.getName().equalsIgnoreCase(oreSelect.getSelectedItem().toString())) {
|
||||
Variables.mining_ore_selected = ore.getIDs();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
miningPanel.add(oreSelect);
|
||||
|
||||
/*
|
||||
* Slave Panel
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<config>
|
||||
<jars basedir="C:/Users/Dan-j/Documents/GitHub/ParaScript/target/">
|
||||
<jars basedir="C:/Users/Dan-j/IdeaProjects/ParaScript/target/">
|
||||
<jar in="1000204.jar" out="/home/ci/jars/1000204.jar"/>
|
||||
</jars>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user