Balthazar 0 Share Posted January 19, 2021 Hello! Starting to jump into programming again after a couple of years. Hopefully I can explain this. In the following example, I'm attempting to log the state of the game to the console. I want the type of the log to be 'Debug'. However, I cannot resolve the LogType enum. import org.dreambot.api.Client; import org.dreambot.api.methods.MethodProvider; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(name = "Tutorial Island", description = "Tutorial script for Tutorial Island!", author = "Balthazar", version = 1.0, category = Category.MISC, image = "") public class Tutorial extends AbstractScript { @Override public int onLoop() { MethodProvider.log(MethodProvider.LogType.Debug, Client.getGameState().toString()); return 1000; } } I've also tried the following. Thinking that it would resolve because the MethodProvider class is imported. import org.dreambot.api.methods.MethodProvider; ... ... MethodProvider.log(LogType.Debug, Client.getGameState().toString()); My thoughts are that I'm missing something with the enum being embedded in another class? But, I'm not really certain. Link to comment Share on other sites More sharing options...
Pandemic 2675 Share Posted January 19, 2021 All of the log enum values should be fully capitalized (DEBUG, INFO, etc.), maybe that's your issue? Link to comment Share on other sites More sharing options...
Balthazar 0 Author Share Posted January 20, 2021 Thank you! I fixed that. Still isn't resolving, unfortunately. I noticed that MethodProvider$LogType.DEBUG will successfully resolve. But, then I get a type mismatch because the log function is expecting LogType and not MethodProvider$LogType. Also, I'm not too certain why the $ is in there or why that resolves and MethodProvider.LogType doesn't. Couldn't find a good answer online. Link to comment Share on other sites More sharing options...
Gorn 4 Share Posted January 20, 2021 You have to put the entire path there MethodProvider.log(org.dreambot.api.methods.MethodProvider$LogType.ERROR, Client.getGameState().toString()); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.