mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-03 00:38:36 +00:00
add initial fishing
This commit is contained in:
@@ -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