Update fishing

This commit is contained in:
Danial
2021-10-07 12:26:03 +13:00
parent 41a3d37290
commit 570c1c9b70
3 changed files with 10 additions and 7 deletions
+4
View File
@@ -50,6 +50,10 @@ public class Main extends Script implements MessageListener, Paintable {
strategies.add(new Bank());
strategies.add(new Walk());
}
if(Variables.skill_to_train == Skill.SMITHING) {
strategies.add(new Smelt());
strategies.add(new BankSmithing());
}
if(Variables.skill_to_train == Skill.THIEVING) {
strategies.add(new Thieving());
}
@@ -177,6 +177,8 @@ public class Variables {
return new int[]{woodcutting_tree_selected.getItemID()};
case "Mining":
return mining_rock_selected.getItemID();
case "Fishing":
return fishing_spot_selected.getItemIDs();
case "Attack":
return fighting_item_ids;
default:
@@ -17,7 +17,8 @@ public class Fish implements Strategy {
&& fishingSpot != null
&& (Variables.getStatus() == "none" || Variables.getStatus() == "fishing")
&& !Players.getMyPlayer().isInCombat()
&& Players.getMyPlayer().getAnimation() == -1) {
&& Players.getMyPlayer().getAnimation() == -1
&& !Inventory.isFull()) {
Variables.setStatus("fishing");
return true;
}
@@ -28,11 +29,7 @@ public class Fish implements Strategy {
@Override
public void execute() {
try {
if (Variables.shouldDropItems()) {
if (Inventory.getCount(441) >= 1) Inventory.getItem(441).interact(Items.Option.DROP);
}
fishingSpot.interact(Variables.fishing_type_selected);
fishingSpot.interact(Variables.fishing_spot_selected.actionType);
Time.sleep(1000);
// Wait for the Player to finish fishing (max 60 seconds)
@@ -44,7 +41,7 @@ public class Fish implements Strategy {
private Npc fishingSpot(){
try {
for (Npc spot : Npcs.getNearest(316)) {
for(Npc spot : Npcs.getNearest(Variables.fishing_spot_selected.getIDs())){
if (spot != null)
return spot;
}