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
  • How to load script?


    HinataShoyo

    Recommended Posts

    So heres my script, nothing serious just casual.

    I tried exporting settings to the scripts folder in dreambot file but it still dont work, it's exported as .jar file too but when i load the local scripts nothing appears. I've tried refreshing that wont do anything either. Thanks you :)

     

     

    package basics;
    
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    
    import java.awt.*;
    
    import static org.dreambot.api.script.Category.WOODCUTTING;
    
    @ScriptManifest(category = WOODCUTTING,name ="Basic woodcutter" ,author ="HinataShoyo" ,version = 1.0)
    
    public class Main extends AbstractScript{
    
    
        @Override
        public void onStart(){
            log("The script have started!");
    
    
        }
    
        @Override
        public int onLoop() {
            GameObject tree = getGameObjects().closest(gameObject -> gameObject!=null && gameObject.getName().equals("Tree")&& gameObject.hasAction("Chop down") );
            tree.interact("Chop down");
            return 1000;
        }
    
        @Override
        public void onExit(){
            super.onExit();
        }
    
        @Override
        public void onPaint(Graphics graphics){
            super.onPaint(graphics);
        }
    }
    Link to comment
    Share on other sites

    • 2 years later...

    Hello I was having similar issue with my script, and I was getting very desperate after several hours of researching the internet but without any help...

    My problem was that i was using wrong JRE version. After a while i stumbled upon the .log file in .\DreamBot\logs directory
     

    2021-04-21 22:56:53 [ERROR] Error loading script class: C:\Users\jvotm\DreamBot\Scripts\turhascript.jar![botscripts/Abot.class]
    java.lang.UnsupportedClassVersionError: botscripts/Abot has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 52.0
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClass(Unknown Source)
    	at java.security.SecureClassLoader.defineClass(Unknown Source)
    	at java.net.URLClassLoader.defineClass(Unknown Source)
    	at java.net.URLClassLoader.access$100(Unknown Source)
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at org.dreambot.core.ap.k(ap.java)
    	at org.dreambot.core.ap.e(ap.java)
    	at org.dreambot.core.ap.j(ap.java)
    	at org.dreambot.core.ap.c(ap.java)
    	at org.dreambot.core.ap.h(ap.java)
    	at org.dreambot.J.lambda$refreshScripts$8(J.java)
    	at java.lang.Thread.run(Unknown Source)

    Class file version 59.0 tells me that I am using  JRE 15. 
    Class file version 52 is asking me to use JRE 1.8 (java 8)

    All I had to do in eclipse was change the execution environment from JavaSe- 15 to JavaSE- 1.8.

    I had to go to project properties, to Java Build Path, go to Libraries tab, select the current JRE System Library [JavaSe - 15], click edit and select right JRE version, apply.

    After doing this I exported my project once more and was able to see the script in the DB3 client. happy now. and my script worked well :)

    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.