Jump to content

Welcome to DreamBot!

Download for Free

Supercharge Your Bots

Run unlimited bots today using DreamBot's Covert Mode and
stay more protected.

Upgrade Now
Frequently Asked Questions
  • Are you not able to open the client? Make sure you have Java 8 installed
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
OSRS Gambling

Interested in advertising your business? Reach out today!

Download the DreamBot client today!
Sign in to follow this  
hoke2012

need help with .jar

Recommended Posts

Hey guys, i wrote this for practice with dreambots api and im trying to test it. i have it in the correct folder "svripts" in dreambot 
but it is appearing. any ideas on what i need to fix?











import org.dreambot.api.methods.Calculations;
import org.dreambot.api.script.AbstractScript;
import org.dreambot.api.script.ScriptManifest;
import org.dreambot.api.script.Category;
import org.dreambot.api.wrappers.interactive.NPC;

@ScriptManifest(author = "Hoke2012", name = "FreeFlyFisher", version = 1.0, description = "Flyfish Anywhere!", category = Category.FISHING
)
public class test extends AbstractScript {

    public void onStart() {
        log("Welcome to FreeFlyFisher by Hoke2012.");
        log("If you experience any issues while running this script please report them to me on the forums.");
        log("Enjoy the script, gain some fishing levels!.");
    }

    private enum State {
        FISH, DROP, WAIT
    };

    private State getState() {
        NPC Fishing_spot = getNpcs().closest(fis -> fis != null && fis.getName().equals("Rod Fishing Spot"));
        if (getInventory().isFull()) {
            return State.DROP;
        }

        if (Fishing_spot != null) {
            return State.FISH;
        }
        return State.WAIT;
    }

    public void onExit() {

    }
    @Override
    public int onLoop() {
        switch (getState()) {
            case FISH:
                NPC Fishing_spot = getNpcs().closest(fis -> fis != null && fis.getName().equals("Rod Fishing Spot"));
                if (Fishing_spot != null) {
                    Fishing_spot.interact("Lure");
                }
                break;
            case DROP:
                getInventory().dropAll("Trout", "Salmon");
                break;
            case WAIT:
                sleep(Calculations.random(500, 600));
                break;
        }
        return Calculations.random(500, 600);
    }
}

 

 

 

 

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...