Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • 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/Crypto gold? You can purchase vouchers from other users
  • need help with .jar


    HTM

    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);
        }
    }

     

     

     

     

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.