Jump to content

Bot does nothing?


Recommended Posts

Posted (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 by igetbanned
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...