mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
Script timer won't start until you click start
This commit is contained in:
Generated
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="14d0b690-21f2-4a9c-b8cf-803e9cc87ab5" name="Default Changelist" comment="">
|
<list default="true" id="14d0b690-21f2-4a9c-b8cf-803e9cc87ab5" 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/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/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/MakeArrowShafts.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/MakeArrowShafts.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" />
|
||||||
</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" />
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ParaScript.strategies.*;
|
|||||||
import ParaScript.ui.UI;
|
import ParaScript.ui.UI;
|
||||||
import org.parabot.environment.api.interfaces.Paintable;
|
import org.parabot.environment.api.interfaces.Paintable;
|
||||||
import org.parabot.environment.api.utils.Time;
|
import org.parabot.environment.api.utils.Time;
|
||||||
|
import org.parabot.environment.api.utils.Timer;
|
||||||
import org.parabot.environment.scripts.Script;
|
import org.parabot.environment.scripts.Script;
|
||||||
import org.parabot.environment.scripts.framework.Strategy;
|
import org.parabot.environment.scripts.framework.Strategy;
|
||||||
import org.parabot.environment.scripts.Category;
|
import org.parabot.environment.scripts.Category;
|
||||||
@@ -21,6 +22,7 @@ public class Main extends Script implements MessageListener, Paintable {
|
|||||||
|
|
||||||
private final ArrayList<Strategy> strategies = new ArrayList<Strategy>();
|
private final ArrayList<Strategy> strategies = new ArrayList<Strategy>();
|
||||||
private UI ui = new UI();
|
private UI ui = new UI();
|
||||||
|
public static Timer SCRIPT_TIMER;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onExecute() {
|
public boolean onExecute() {
|
||||||
@@ -29,6 +31,8 @@ public class Main extends Script implements MessageListener, Paintable {
|
|||||||
Time.sleep(300);
|
Time.sleep(300);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCRIPT_TIMER = new Timer();
|
||||||
|
|
||||||
Variables.setBaseExp();
|
Variables.setBaseExp();
|
||||||
|
|
||||||
strategies.add(new ScriptState());
|
strategies.add(new ScriptState());
|
||||||
@@ -86,9 +90,10 @@ public class Main extends Script implements MessageListener, Paintable {
|
|||||||
g.drawString("2006 AIO", 360, 247);
|
g.drawString("2006 AIO", 360, 247);
|
||||||
g.setFont(new Font("Arial", Font.BOLD, 11));
|
g.setFont(new Font("Arial", Font.BOLD, 11));
|
||||||
g.drawString("Status: " + Variables.getStatus(), 360, 270);
|
g.drawString("Status: " + Variables.getStatus(), 360, 270);
|
||||||
g.drawString("Items(P/H): " + Methods.formatNumber(Variables.itemsGained) + "(" + Methods.formatNumber(Variables.SCRIPT_TIMER.getPerHour(Variables.itemsGained)) + ")", 360, 290);
|
if (SCRIPT_TIMER == null) return;
|
||||||
g.drawString("EXP(P/H): " + Methods.formatNumber((int) Variables.expGained) + "(" + Methods.formatNumber(Variables.SCRIPT_TIMER.getPerHour((int) Variables.expGained)) + ")", 360, 310);
|
g.drawString("Items(P/H): " + Methods.formatNumber(Variables.items_gained) + "(" + Methods.formatNumber(SCRIPT_TIMER.getPerHour(Variables.items_gained)) + ")", 360, 290);
|
||||||
g.drawString("Runtime: " + Variables.SCRIPT_TIMER.toString(), 360, 330);
|
g.drawString("EXP(P/H): " + Methods.formatNumber((int) Variables.exp_gained) + "(" + Methods.formatNumber(SCRIPT_TIMER.getPerHour((int) Variables.exp_gained)) + ")", 360, 310);
|
||||||
|
g.drawString("Runtime: " + SCRIPT_TIMER.toString(), 360, 330);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,16 +6,12 @@ import org.rev317.min.api.methods.Skill;
|
|||||||
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;
|
|
||||||
|
|
||||||
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 current_status = "none";
|
||||||
public static int itemsGained = 0;
|
public static int items_gained = 0;
|
||||||
public static double baseExperience = 0;
|
public static double base_experience = 0;
|
||||||
public static double expGained = 0;
|
public static double exp_gained = 0;
|
||||||
|
|
||||||
// Login Panel
|
// Login Panel
|
||||||
private static String username = "";
|
private static String username = "";
|
||||||
@@ -50,11 +46,11 @@ public class Variables {
|
|||||||
public static TilePath pathToWalk;
|
public static TilePath pathToWalk;
|
||||||
|
|
||||||
public static String getStatus() {
|
public static String getStatus() {
|
||||||
return currentStatus;
|
return current_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setStatus(String i) {
|
public static void setStatus(String i) {
|
||||||
currentStatus = i;
|
current_status = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
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));
|
||||||
@@ -144,19 +140,19 @@ public class Variables {
|
|||||||
public static void setAccountPassword(String i) { password = i; }
|
public static void setAccountPassword(String i) { password = i; }
|
||||||
|
|
||||||
public static void addItemGained(int amount){
|
public static void addItemGained(int amount){
|
||||||
itemsGained += amount;
|
items_gained += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setBaseExp(){
|
public static void setBaseExp(){
|
||||||
if (skill_to_train == null) return;
|
if (skill_to_train == null) return;
|
||||||
if (skill_to_train == Skill.ATTACK) baseExperience = Skill.ATTACK.getExperience() + Skill.STRENGTH.getExperience() + Skill.DEFENSE.getExperience() + Skill.HITPOINTS.getExperience() + Skill.RANGE.getExperience() + Skill.MAGIC.getExperience() + Skill.PRAYER.getExperience();
|
if (skill_to_train == Skill.ATTACK) base_experience = Skill.ATTACK.getExperience() + Skill.STRENGTH.getExperience() + Skill.DEFENSE.getExperience() + Skill.HITPOINTS.getExperience() + Skill.RANGE.getExperience() + Skill.MAGIC.getExperience() + Skill.PRAYER.getExperience();
|
||||||
else baseExperience = skill_to_train.getExperience();
|
else base_experience = skill_to_train.getExperience();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateExpGained(){
|
public static void updateExpGained(){
|
||||||
if (skill_to_train == null) return;
|
if (skill_to_train == null) return;
|
||||||
if (skill_to_train == Skill.ATTACK) expGained = Skill.ATTACK.getExperience() + Skill.STRENGTH.getExperience() + Skill.DEFENSE.getExperience() + Skill.HITPOINTS.getExperience() + Skill.RANGE.getExperience() + Skill.MAGIC.getExperience() + Skill.PRAYER.getExperience() - baseExperience;
|
if (skill_to_train == Skill.ATTACK) exp_gained = Skill.ATTACK.getExperience() + Skill.STRENGTH.getExperience() + Skill.DEFENSE.getExperience() + Skill.HITPOINTS.getExperience() + Skill.RANGE.getExperience() + Skill.MAGIC.getExperience() + Skill.PRAYER.getExperience() - base_experience;
|
||||||
else expGained = skill_to_train.getExperience() - baseExperience;
|
else exp_gained = skill_to_train.getExperience() - base_experience;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int[] getItemIDs(){
|
public static int[] getItemIDs(){
|
||||||
|
|||||||
Reference in New Issue
Block a user