mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-03 00:38:36 +00:00
Show items gained, exp gained
This commit is contained in:
Generated
+11
-11
@@ -3,13 +3,13 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="3ab8e8a0-ccfd-4b0b-9547-98173085dc38" name="Default Changelist" comment="">
|
<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$/.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.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/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/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/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/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$/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>
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@@ -55,21 +55,21 @@
|
|||||||
<key name="ExtractSuperBase.RECENT_KEYS">
|
<key name="ExtractSuperBase.RECENT_KEYS">
|
||||||
<recent name="ParaScript" />
|
<recent name="ParaScript" />
|
||||||
</key>
|
</key>
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
|
||||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript" />
|
|
||||||
</key>
|
|
||||||
<key name="CopyClassDialog.RECENTS_KEY">
|
|
||||||
<recent name="ParaScript.strategies" />
|
|
||||||
<recent name="ParaScript.data.variables" />
|
|
||||||
<recent name="ParaScript.ui" />
|
|
||||||
<recent name="ParaScript.data" />
|
|
||||||
<recent name="ParaScript" />
|
|
||||||
</key>
|
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\src\main" />
|
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\src\main" />
|
||||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\src" />
|
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\src" />
|
||||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\main\java" />
|
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\main\java" />
|
||||||
</key>
|
</key>
|
||||||
|
<key name="CopyClassDialog.RECENTS_KEY">
|
||||||
|
<recent name="ParaScript" />
|
||||||
|
<recent name="ParaScript.strategies" />
|
||||||
|
<recent name="ParaScript.data.variables" />
|
||||||
|
<recent name="ParaScript.ui" />
|
||||||
|
<recent name="ParaScript.data" />
|
||||||
|
</key>
|
||||||
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript" />
|
||||||
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunDashboard">
|
<component name="RunDashboard">
|
||||||
<option name="ruleStates">
|
<option name="ruleStates">
|
||||||
|
|||||||
@@ -69,18 +69,22 @@ public class Main extends Script implements MessageListener, Paintable {
|
|||||||
|
|
||||||
g.setColor(Color.WHITE);
|
g.setColor(Color.WHITE);
|
||||||
g.setFont(new Font("Arial", 1, 14));
|
g.setFont(new Font("Arial", 1, 14));
|
||||||
g.drawString("AIOWoodcutter", 360, 247);
|
g.drawString("ParaScript", 360, 247);
|
||||||
g.setFont(new Font("Arial", 1, 11));
|
g.setFont(new Font("Arial", 1, 11));
|
||||||
g.drawString("Status: " + Variables.getStatus(), 360, 270);
|
g.drawString("Status: " + Variables.getStatus(), 360, 270);
|
||||||
g.drawString("Logs(P/H): " + 10 + "(" + 120 + ")", 360, 290);
|
g.drawString("Items(P/H): " + Methods.formatNumber(Variables.itemsGained) + "(" + Methods.formatNumber(Variables.SCRIPT_TIMER.getPerHour(Variables.itemsGained)) + ")", 360, 290);
|
||||||
g.drawString("EXP(P/H): " + 1000 + "(" + 12685 + ")", 360, 310);
|
g.drawString("EXP(P/H): " + Methods.formatNumber((int) Variables.expGained) + "(" + Methods.formatNumber(Variables.SCRIPT_TIMER.getPerHour((int) Variables.expGained)) + ")", 360, 310);
|
||||||
g.drawString("Runtime: " + "02:22:20", 360, 330);
|
g.drawString("Runtime: " + Variables.SCRIPT_TIMER.toString(), 360, 330);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void messageReceived(MessageEvent message) {
|
public void messageReceived(MessageEvent message) {
|
||||||
switch (message.getType()) {
|
switch (message.getType()) {
|
||||||
case 0:
|
case 0:
|
||||||
|
if (message.getMessage().startsWith("You manage to ")) {
|
||||||
|
Variables.addItemGained(1);
|
||||||
|
Variables.addExpGained();
|
||||||
|
}
|
||||||
if (message.getMessage().contains("Congratulations, you advanced a woodcutting level.")) {
|
if (message.getMessage().contains("Congratulations, you advanced a woodcutting level.")) {
|
||||||
// add in level up to paint
|
// add in level up to paint
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package ParaScript;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
public class Methods {
|
||||||
|
public static String formatNumber(int number) {
|
||||||
|
DecimalFormat nf = new DecimalFormat("0.0");
|
||||||
|
double i = number;
|
||||||
|
if (i >= 1000000) {
|
||||||
|
return nf.format((i / 1000000)) + "M";
|
||||||
|
}
|
||||||
|
if (i >= 1000) {
|
||||||
|
return nf.format((i / 1000)) + "K";
|
||||||
|
}
|
||||||
|
return "" + number;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,14 +3,19 @@ package ParaScript.data;
|
|||||||
import ParaScript.data.variables.Ores;
|
import ParaScript.data.variables.Ores;
|
||||||
import ParaScript.data.variables.Trees;
|
import ParaScript.data.variables.Trees;
|
||||||
import ParaScript.data.variables.Zone;
|
import ParaScript.data.variables.Zone;
|
||||||
|
import org.parabot.environment.api.utils.Timer;
|
||||||
import org.rev317.min.api.wrappers.Tile;
|
import org.rev317.min.api.wrappers.Tile;
|
||||||
import org.rev317.min.api.wrappers.TilePath;
|
import org.rev317.min.api.wrappers.TilePath;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Variables {
|
public class Variables {
|
||||||
|
public static final Timer SCRIPT_TIMER = new Timer();
|
||||||
|
|
||||||
public static boolean running = false;
|
public static boolean running = false;
|
||||||
private static String currentStatus = "none";
|
private static String currentStatus = "none";
|
||||||
|
public static int itemsGained = 0;
|
||||||
|
public static double expGained = 0;
|
||||||
|
|
||||||
// Login Panel
|
// Login Panel
|
||||||
private static String username = "";
|
private static String username = "";
|
||||||
@@ -20,10 +25,10 @@ public class Variables {
|
|||||||
public static String skill_to_train = "Woodcutting";
|
public static String skill_to_train = "Woodcutting";
|
||||||
|
|
||||||
// Woodcutting
|
// Woodcutting
|
||||||
public static int[] woodcutting_tree_selected = Trees.NORMAL.getIDs();
|
public static Trees woodcutting_tree_selected = Trees.NORMAL;
|
||||||
|
|
||||||
// Mining
|
// Mining
|
||||||
public static int[] mining_ore_selected = Ores.COPPER_TIN.getIDs();
|
public static Ores mining_ore_selected = Ores.COPPER_TIN;
|
||||||
|
|
||||||
// Used for slave accounts
|
// Used for slave accounts
|
||||||
public static String slaveMaster = "";
|
public static String slaveMaster = "";
|
||||||
@@ -79,4 +84,21 @@ public class Variables {
|
|||||||
|
|
||||||
public static String getAccountPassword() { return password; }
|
public static String getAccountPassword() { return password; }
|
||||||
public static void setAccountPassword(String i) { password = i; }
|
public static void setAccountPassword(String i) { password = i; }
|
||||||
|
|
||||||
|
public static void addItemGained(int amount){
|
||||||
|
itemsGained += amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addExpGained(){
|
||||||
|
double xp_to_add = 0;
|
||||||
|
switch(skill_to_train){
|
||||||
|
case "woodcutting":
|
||||||
|
xp_to_add = woodcutting_tree_selected.getXP();
|
||||||
|
break;
|
||||||
|
case "mining":
|
||||||
|
xp_to_add = mining_ore_selected.getXP();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
expGained += xp_to_add;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,18 +5,20 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public enum Ores {
|
public enum Ores {
|
||||||
COPPER_TIN("Copper & Tin", new int[]{2090, 2094}),
|
COPPER_TIN("Copper & Tin", new int[]{2090, 2094}, 17.5),
|
||||||
COPPER("Copper", new int[]{2090}),
|
COPPER("Copper", new int[]{2090}, 17.5),
|
||||||
TIN("Tin", new int[]{2094}),
|
TIN("Tin", new int[]{2094}, 17.5),
|
||||||
IRON ("Iron", new int[]{2092}),
|
IRON ("Iron", new int[]{2092}, 35),
|
||||||
COAL("Coal", new int[]{});
|
COAL("Coal", new int[]{}, 50);
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private int[] ids;
|
private int[] ids;
|
||||||
|
private double xp;
|
||||||
|
|
||||||
Ores(String name, int[] ids) {
|
Ores(String name, int[] ids, double xp) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.ids = ids;
|
this.ids = ids;
|
||||||
|
this.xp = xp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] toStringArray() {
|
public static String[] toStringArray() {
|
||||||
@@ -33,7 +35,7 @@ public enum Ores {
|
|||||||
|
|
||||||
public String getName() { return this.name; }
|
public String getName() { return this.name; }
|
||||||
|
|
||||||
public int[] getIDs() {
|
public int[] getIDs() { return this.ids; }
|
||||||
return this.ids;
|
|
||||||
}
|
public double getXP() { return this.xp; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,17 +5,19 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public enum Trees {
|
public enum Trees {
|
||||||
NORMAL("Normal", new int[]{1276, 1278, 1279}),
|
NORMAL("Normal", new int[]{1276, 1278, 1279}, 25),
|
||||||
OAK("Oak", new int[]{1281}),
|
OAK("Oak", new int[]{1281}, 37.5),
|
||||||
WILLOW ("Willow", new int[]{5551, 1308, 5553, 5552}),
|
WILLOW ("Willow", new int[]{5551, 1308, 5553, 5552}, 47.5),
|
||||||
MAPLE("Maple", new int[]{1307});
|
MAPLE("Maple", new int[]{1307}, 100);
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private int[] ids;
|
private int[] ids;
|
||||||
|
private double xp;
|
||||||
|
|
||||||
Trees(String name, int[] ids) {
|
Trees(String name, int[] ids, double xp) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.ids = ids;
|
this.ids = ids;
|
||||||
|
this.xp = xp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] toStringArray() {
|
public static String[] toStringArray() {
|
||||||
@@ -32,7 +34,7 @@ public enum Trees {
|
|||||||
|
|
||||||
public String getName() { return this.name; }
|
public String getName() { return this.name; }
|
||||||
|
|
||||||
public int[] getIDs() {
|
public int[] getIDs() { return this.ids; }
|
||||||
return this.ids;
|
|
||||||
}
|
public double getXP() { return this.xp; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class Mine implements Strategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private SceneObject ore(){
|
private SceneObject ore(){
|
||||||
int[] ore_to_mine = Variables.mining_ore_selected;
|
int[] ore_to_mine = Variables.mining_ore_selected.getIDs();
|
||||||
if (ore_to_mine == Ores.COPPER_TIN.getIDs()) {
|
if (ore_to_mine == Ores.COPPER_TIN.getIDs()) {
|
||||||
if (Inventory.getCount(437) >= 14)
|
if (Inventory.getCount(437) >= 14)
|
||||||
ore_to_mine = Ores.TIN.getIDs();
|
ore_to_mine = Ores.TIN.getIDs();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class WoodcutTree implements Strategy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private SceneObject tree(){
|
private SceneObject tree(){
|
||||||
int[] tree_to_cut = Variables.woodcutting_tree_selected;
|
int[] tree_to_cut = Variables.woodcutting_tree_selected.getIDs();
|
||||||
for(SceneObject tree : SceneObjects.getNearest(tree_to_cut)){
|
for(SceneObject tree : SceneObjects.getNearest(tree_to_cut)){
|
||||||
if(tree != null){
|
if(tree != null){
|
||||||
if(Variables.LUMBRIDGE_NORMAL_TREE_ZONE.inTheZoneObject(tree)) {
|
if(Variables.LUMBRIDGE_NORMAL_TREE_ZONE.inTheZoneObject(tree)) {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ public class UI extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
for (Trees tree : Trees.values()) {
|
for (Trees tree : Trees.values()) {
|
||||||
if (tree.getName().equalsIgnoreCase(treeSelect.getSelectedItem().toString())) {
|
if (tree.getName().equalsIgnoreCase(treeSelect.getSelectedItem().toString())) {
|
||||||
Variables.mining_ore_selected = tree.getIDs();
|
Variables.woodcutting_tree_selected = tree;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ public class UI extends JFrame {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
for (Ores ore : Ores.values()) {
|
for (Ores ore : Ores.values()) {
|
||||||
if (ore.getName().equalsIgnoreCase(oreSelect.getSelectedItem().toString())) {
|
if (ore.getName().equalsIgnoreCase(oreSelect.getSelectedItem().toString())) {
|
||||||
Variables.mining_ore_selected = ore.getIDs();
|
Variables.mining_ore_selected = ore;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user