b14 6 Share Posted May 14, 2020 Hey! So I started working on a fairly complex script today, but I ran into a little issue that I can't figure out... So basically when I code I like to use multiple classes and packages to keep things more organized for myself to improve the speed at which I code. But I noticed that as soon as I access another class using an object in my main class the script will not run: With this code the script will run: package me.b14.main; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(author = "B14", name = "Test", version = 1, description = "Test", category = Category.MISC) public class Main extends AbstractScript { //Breaks breaks = new Breaks(); @Override public void onStart() { log("----------------------- TEST ----------------------"); log("Starting Test..."); log("-----------------------------------------------------------------------------"); } @Override public void onExit() { log("----------------------- TEST ----------------------"); log("Ending Test..."); log("-----------------------------------------------------------------------------"); } @Override public int onLoop() { //breaks.logout(); log("test"); return 600; } } But as soon as I remove the comment marks by the breaks object the script will no longer run: package me.b14.main; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(author = "B14", name = "Test", version = 1, description = "Test", category = Category.MISC) public class Main extends AbstractScript { Breaks breaks = new Breaks(); @Override public void onStart() { log("----------------------- TEST ----------------------"); log("Starting Test..."); log("-----------------------------------------------------------------------------"); } @Override public void onExit() { log("----------------------- TEST ----------------------"); log("Ending Test..."); log("-----------------------------------------------------------------------------"); } @Override public int onLoop() { //breaks.logout(); log("test"); return 600; } } So my question is this: Does dreambot not recognize multiple classes? Am I doing something wrong? Does dreambot not recognize multi-class objects? Thank you for any help you can provide Link to comment Share on other sites More sharing options...
Stoned 52 Share Posted May 14, 2020 Are the class files in the same package? If not, try importing it. Link to comment Share on other sites More sharing options...
b14 6 Author Share Posted May 14, 2020 32 minutes ago, StonedFarmer said: Are the class files in the same package? If not, try importing it. Yeah they're in the same package, this is such a weird issue to run into I've tried changing my modifiers and everything but still no luck Link to comment Share on other sites More sharing options...
Pandemic 2675 Share Posted May 14, 2020 Are you seeing any errors in the debug console? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.