igetbanned Posted August 31, 2014 Share Posted August 31, 2014 (edited) I finished (or so I think) the functionality part of my script, but upon running it in OSBot, the bot just stands there. I've tried everything to my level of understanding, yet nothing works. Restarting the bot/script won't fix it. Here's all the code: package org.igetbanned.barbfisher; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; /** * Created by ${igetbanned} on 8/30/2014. */ @ScriptManifest( author = "igetbanned", info = "Powerfishes barbarian style", name = "BarbarianFisher", version = 0.1, logo = "Cool" ) public class BarbarianFIsher extends Script { private static final int[] FISHING_ID = {14882}; public void onStart(){ log("Barbarian Fisher Started!"); } private enum State { FISHING, DROPPING } private State getState() { if (inventory.isFull()) return State.DROPPING; return State.FISHING; } public int onLoop() throws InterruptedException { switch (getState()) { case FISHING: if (!myPlayer().isAnimating()) { RS2Object Fishing_spot = objects.closest(FISHING_ID); if (!inventory.isFull()){ Fishing_spot.interact("Use-rod"); } } break; case DROPPING: inventory.dropAllExcept(11323, 314); break; } return random(200, 300); } public void onPaint(Graphics g) { } //code to be executed on exit public void onExit(){ log("Script stopped!"); } } Edited August 31, 2014 by igetbanned Link to comment Share on other sites More sharing options...
Extreme Scripts Posted August 31, 2014 Share Posted August 31, 2014 Ahhhh a common mistake here is that Fishing spots are actually not RS2Objects, they are in fact NPC's. Change the object type and it should work fine, just make sure you update the ID as well if needed^_^ 1 Link to comment Share on other sites More sharing options...
Laz Posted August 31, 2014 Share Posted August 31, 2014 Make sure your using OSBot 2.2.20 as there were bugs in the isFull() methods in prior releases too. Link to comment Share on other sites More sharing options...
igetbanned Posted August 31, 2014 Author Share Posted August 31, 2014 Works now! Thank you both so much Link to comment Share on other sites More sharing options...