HinataShoyo 0 Share Posted August 10, 2018 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 More sharing options...
sadgonzer 46 Featured Comment Share Posted August 10, 2018 follow this guide thats what i did when i started to learn and it always worked . Link to comment Share on other sites More sharing options...
HinataShoyo 0 Author Share Posted August 10, 2018 Thank you! I had to change my directory in artifacts. Link to comment Share on other sites More sharing options...
sadgonzer 46 Share Posted August 10, 2018 2 hours ago, HinataShoyo said: Thank you! I had to change my directory in artifacts. you are welcome glade i helped Link to comment Share on other sites More sharing options...
miikadbotter 1 Share Posted April 21, 2021 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.