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
  • Scripts not showing up.


    itorch

    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

    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.