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
  • Try asking for help in the chatbox
  • Scripts not showing up.


    itorch
     Share

    Recommended Posts

    I'm having a problem where I cannot see any of the scripts. It's just an empty list, even though I have added a local script to the dreambot script folder and added one free script from the website. I tried refreshing, restarting the bot.. Am I missing something?

    Link to comment
    Share on other sites

    Maybe the local script has errors in it which causes it to not show any scripts. Try removing the .jar from the Scripts folder and try again. If it works, the flaw is in the local script.

    Link to comment
    Share on other sites

    Maybe the local script has errors in it which causes it to not show any scripts. Try removing the .jar from the Scripts folder and try again. If it works, the flaw is in the local script.

    Apparently that is the case, however now I'm unable to find the mistake in the code. I'm following a tutorial from the forums and have followed the given steps one to one. Perhaps I've missed something as a beginner? Below is the short piece of the code, supposed to detect nearby Trees and gather logs from them until inventory is full:

    package woodcutter;
    
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    
    import java.awt.*;
    
    @ScriptManifest(category = Category.WOODCUTTING, name = "Basic Woodcutter", author = "itorch", version = 1.0)
    public class Main extends AbstractScript{
    
        @Override
        public void onStart(){
            log("hi!");
        }
    
        @Override
        public int onLoop() {
            GameObject tree = getGameObjects().closest(gameObject -> gameObject!=null && gameObject.getName().equals("Tree"));
            if (!getInventory().isFull() && tree.interact("Chop down")) {
                int countLog = getInventory().count("Logs");
                sleepUntil(()-> getInventory().count("Logs")>countLog , 8000);
            }
            
            return 500;
        }
    
        @Override
        public void onExit() {
    
        }
    
        @Override
        public void onPaint(Graphics graphics) {
        }
    }
    
    
    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.