b14 6 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
b14 6 Author 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.