mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
add initial fishing
This commit is contained in:
Generated
+11
-8
@@ -4,7 +4,10 @@
|
||||
<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$/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/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/strategies/PickupItems.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/PickupItems.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>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@@ -41,7 +44,7 @@
|
||||
<property name="GenerateAntBuildDialog.generateSingleFile" value="true" />
|
||||
<property name="GenerateAntBuildDialog.outputFileNameProperty" value="parascript" />
|
||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../2006rebotted" />
|
||||
<property name="project.structure.last.edited" value="Modules" />
|
||||
<property name="project.structure.proportion" value="0.15" />
|
||||
<property name="project.structure.side.proportion" value="0.2" />
|
||||
@@ -51,10 +54,8 @@
|
||||
<key name="ExtractSuperBase.RECENT_KEYS">
|
||||
<recent name="ParaScript" />
|
||||
</key>
|
||||
<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" />
|
||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\main\java" />
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript" />
|
||||
</key>
|
||||
<key name="CopyClassDialog.RECENTS_KEY">
|
||||
<recent name="ParaScript.strategies" />
|
||||
@@ -64,8 +65,10 @@
|
||||
<recent name="ParaScript.ui" />
|
||||
<recent name="ParaScript.data" />
|
||||
</key>
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript" />
|
||||
<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" />
|
||||
<recent name="C:\Users\Dan-j\Documents\GitHub\ParaScript\main\java" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunDashboard">
|
||||
|
||||
@@ -55,6 +55,9 @@ public class Main extends Script implements MessageListener, Paintable {
|
||||
strategies.add(new BuryBones());
|
||||
strategies.add(new Fighting());
|
||||
}
|
||||
if(Variables.skill_to_train == Skill.FISHING) {
|
||||
strategies.add(new Fish());
|
||||
}
|
||||
if(Variables.skill_to_train == null) {
|
||||
strategies.add(new Bank());
|
||||
strategies.add(new Walk());
|
||||
@@ -101,6 +104,7 @@ public class Main extends Script implements MessageListener, Paintable {
|
||||
switch (message.getType()) {
|
||||
case 0:
|
||||
if (message.getMessage().startsWith("You manage to ") || // woodcutting, mining
|
||||
message.getMessage().startsWith("You catch some") || // fishing
|
||||
message.getMessage().startsWith("You pick the ")) { // pickpockets
|
||||
Variables.addItemGained(1);
|
||||
Variables.updateExpGained();
|
||||
|
||||
@@ -19,7 +19,7 @@ public enum Ores {
|
||||
RUNE("Rune", new int[] { 14859, 14860, 2106, 2107 }, 85, 125, 20, 166, new int[] { 451 }),
|
||||
GRANITE("Granite", new int[] { 10947 }, 45, 75, 10, 10, new int[] { 6979, 6981, 6983 }),
|
||||
SANDSTONE("Sandstone", new int[] { 10946 }, 35, 60, 5, 5, new int[] { 6971, 6973, 6975, 6977 }),
|
||||
GEM("Gem", new int[] {2111}, 40, 65, 6, 120, new int[] {1});
|
||||
GEM("Gem", new int[] {2111}, 40, 65, 6, 120, new int[] {});
|
||||
|
||||
private final String name;
|
||||
private final int levelReq, mineTimer, respawnTimer, xp;
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package ParaScript.strategies;
|
||||
|
||||
import ParaScript.data.Variables;
|
||||
import org.parabot.environment.api.utils.Time;
|
||||
import org.parabot.environment.scripts.framework.Strategy;
|
||||
import org.rev317.min.api.methods.*;
|
||||
import org.rev317.min.api.wrappers.Npc;
|
||||
import org.rev317.min.api.wrappers.SceneObject;
|
||||
|
||||
public class Fish implements Strategy {
|
||||
private Npc fishingSpot;
|
||||
|
||||
@Override
|
||||
public boolean activate() {
|
||||
fishingSpot = fishingSpot(); // set the local Variable
|
||||
if (Variables.running
|
||||
&& fishingSpot != null
|
||||
&& (Variables.getStatus() == "none" || Variables.getStatus() == "fishing")
|
||||
&& !Players.getMyPlayer().isInCombat()
|
||||
&& Players.getMyPlayer().getAnimation() == -1) {
|
||||
Variables.setStatus("fishing");
|
||||
return true;
|
||||
}
|
||||
Variables.setStatus("none");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
fishingSpot.interact(Npcs.Option.NET);
|
||||
Time.sleep(1000);
|
||||
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 30000);
|
||||
} catch (Exception err){
|
||||
System.out.println("Fishing error: ¯\\_(ツ)_/¯");
|
||||
}
|
||||
}
|
||||
|
||||
private Npc fishingSpot(){
|
||||
for(Npc spot : Npcs.getNearest(316)){
|
||||
if (spot != null)
|
||||
return spot;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,7 @@ public class UI extends JFrame {
|
||||
Skill.MINING.getName(),
|
||||
Skill.ATTACK.getName(),
|
||||
Skill.THIEVING.getName(),
|
||||
Skill.FISHING.getName(),
|
||||
"Bank Runner",
|
||||
}));
|
||||
skillSelect.setBounds(20, 40, 150, 20);
|
||||
@@ -468,7 +469,9 @@ public class UI extends JFrame {
|
||||
|
||||
/*
|
||||
* Slave Panel
|
||||
*/
|
||||
*
|
||||
* DISABLED FOR NOW
|
||||
|
||||
JPanel slavePanel = new JPanel();
|
||||
slavePanel.setForeground(Color_WhiteSmoke);
|
||||
slavePanel.setBackground(Color_WetAsphalt);
|
||||
@@ -488,6 +491,7 @@ public class UI extends JFrame {
|
||||
Variables.slaveMaster = slaveMaster.getText();
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
JButton start = new JButton("START");
|
||||
start.addActionListener(new ActionListener() {
|
||||
|
||||
Reference in New Issue
Block a user