diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c831a73..f8f17ef 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,9 @@ - - + + + diff --git a/src/main/java/ParaScript/data/Variables.java b/src/main/java/ParaScript/data/Variables.java index b2b8785..2647716 100644 --- a/src/main/java/ParaScript/data/Variables.java +++ b/src/main/java/ParaScript/data/Variables.java @@ -2,6 +2,7 @@ package ParaScript.data; import ParaScript.data.variables.*; import org.parabot.environment.api.utils.Timer; +import org.rev317.min.api.methods.Npcs; import org.rev317.min.api.methods.Skill; import org.rev317.min.api.wrappers.Tile; import org.rev317.min.api.wrappers.TilePath; @@ -38,6 +39,8 @@ public class Variables { public static ThievingNpcs thieving_npc_selected = ThievingNpcs.MAN_WOMAN; //public static String thieving_method = "None"; + // Fishing + public static Npcs.Option fishing_type_selected = Npcs.Option.NET; // Used for slave accounts public static String slaveMaster = ""; diff --git a/src/main/java/ParaScript/strategies/Fish.java b/src/main/java/ParaScript/strategies/Fish.java index 82c1c77..0399fee 100644 --- a/src/main/java/ParaScript/strategies/Fish.java +++ b/src/main/java/ParaScript/strategies/Fish.java @@ -9,6 +9,7 @@ import org.rev317.min.api.wrappers.SceneObject; public class Fish implements Strategy { private Npc fishingSpot; + private int[] items = new int[]{317, 321}; @Override public boolean activate() { @@ -28,9 +29,10 @@ public class Fish implements Strategy { @Override public void execute() { try { - fishingSpot.interact(Npcs.Option.NET); + fishingSpot.interact(Variables.fishing_type_selected); Time.sleep(1000); - Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 30000); + // Wait for the Player to finish fishing (max 60 seconds) + Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 60000); } catch (Exception err){ System.out.println("Fishing error: ¯\\_(ツ)_/¯"); } diff --git a/src/main/java/ParaScript/strategies/Killer.java b/src/main/java/ParaScript/strategies/Killer.java deleted file mode 100644 index aa76f63..0000000 --- a/src/main/java/ParaScript/strategies/Killer.java +++ /dev/null @@ -1,45 +0,0 @@ -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.Inventory; -import org.rev317.min.api.methods.Npcs; -import org.rev317.min.api.methods.Players; -import org.rev317.min.api.methods.SceneObjects; -import org.rev317.min.api.wrappers.Npc; -import org.rev317.min.api.wrappers.SceneObject; - -public class Killer implements Strategy { - private Npc victim; - - @Override - public boolean activate() { - victim = victim(); // set the local Variable - if (Variables.running - && victim != null - && !Players.getMyPlayer().isInCombat() - && Players.getMyPlayer().getAnimation() == -1 - && !Inventory.isFull()) { - return true; - } - return false; - } - - @Override - public void execute() { - victim.interact(Npcs.Option.ATTACK); - Time.sleep(1000); - //Wait for the Player to finish pickpocketing - Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 500); - } - - private Npc victim(){ - for(Npc victim : Npcs.getNearest(41)){ - if(victim != null){ - return victim; - } - } - return null; - } -} \ No newline at end of file diff --git a/src/main/java/ParaScript/ui/UI.java b/src/main/java/ParaScript/ui/UI.java index 9b2dda1..8ef6084 100644 --- a/src/main/java/ParaScript/ui/UI.java +++ b/src/main/java/ParaScript/ui/UI.java @@ -3,6 +3,7 @@ package ParaScript.ui; import ParaScript.data.variables.*; import ParaScript.data.Variables; import org.rev317.min.api.methods.Game; +import org.rev317.min.api.methods.Npcs; import org.rev317.min.api.methods.Players; import org.rev317.min.api.methods.Skill; import org.rev317.min.api.wrappers.Player; @@ -47,6 +48,9 @@ public class UI extends JFrame { private JLabel lblThievingNpcCustomID = new JLabel("Custom NPC IDs"); private JTextField thievingNpcCustomID = new JTextField(); + // Fishing + private JComboBox fishingTypeSelect = new JComboBox(); + // Our colors private Color Color_MidnightBlue = new Color(44, 62, 80); private Color Color_WetAsphalt = new Color(52, 73, 94); @@ -467,6 +471,39 @@ public class UI extends JFrame { lblThievingNpcCustomID.setVisible(false); thievingNpcCustomID.setVisible(false); + /* + * Fishing Panel + */ + + JPanel fishingPanel = new JPanel(); + fishingPanel.setForeground(Color_WhiteSmoke); + fishingPanel.setBackground(Color_WetAsphalt); + tabbedPane.addTab("Fishing", fishingPanel); + fishingPanel.setLayout(null); + + // Select which npc should be our victim + JLabel lblFishingTypeSelect = new JLabel("Fishing Type"); + lblFishingTypeSelect.setForeground(Color_WhiteSmoke); + lblFishingTypeSelect.setBounds(20, 20, 73, 20); + fishingPanel.add(lblFishingTypeSelect); + fishingTypeSelect.setModel(new DefaultComboBoxModel(new String[]{ + Npcs.Option.NET.name(), + Npcs.Option.BAIT.name(), + Npcs.Option.CAGE.name(), + Npcs.Option.HARPOON.name(), + })); + fishingTypeSelect.setBounds(20, 40, 150, 20); + fishingTypeSelect.addActionListener (new ActionListener () { + public void actionPerformed(ActionEvent e) { + for (Npcs.Option option : Npcs.Option.values()) { + if (option.name().equalsIgnoreCase(fishingTypeSelect.getSelectedItem().toString())) { + Variables.fishing_type_selected = option; + } + } + } + }); + fishingPanel.add(fishingTypeSelect); + /* * Slave Panel *