LubeGuyBaller 0 Share Posted March 7, 2019 New to scripting, I've followed the guides made the first script to log "Hi" on loop. But I get an error when trying to run the script. Here is the error: Quote [ERROR]10:30:00: Error occurred while trying to start script: java.lang.IllegalAccessException: Class org.dreambot.api.script.ScriptManager can not access a member of class main with modifiers "" at sun.reflect.Reflection.ensureMemberAccess(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.dreambot.api.script.ScriptManager.start(ScriptManager.java:107) at org.dreambot.1.3.0.1.2.4(2.java:189) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Here is the code: import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(name = "MyWoodCutter", author = "LubeGuyBaller", description = "BasicWoodcut", version = 0.1, category = Category.WOODCUTTING) class main extends AbstractScript { @Override public int onLoop() { log("hi"); return 1000; } } Anyone know what I've done wrong? Link to comment Share on other sites More sharing options...
k0ni 6 Share Posted March 8, 2019 @Override public int onLoop() { log("hi"); return 1000; } } Try it that way Link to comment Share on other sites More sharing options...
k0ni 6 Share Posted March 8, 2019 i tested it for you and this wasnt the problem, turns out there was a problem with your } that closes the main class, idk why try this one instead: import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; @ScriptManifest(name = "MyWoodCutter", author = "LubeGuyBaller", description = "BasicWoodcut", version = 0.1, category = Category.WOODCUTTING) class main extends AbstractScript{ @Override public int onLoop() { log("hi"); return 300; } } Link to comment Share on other sites More sharing options...
LubeGuyBaller 0 Author Share Posted March 8, 2019 Odd I'm still getting the same error. Later tonight I'm going to try to we write it from scratch and see if that works. Thanks for trying Link to comment Share on other sites More sharing options...
NovaGTX 106 Share Posted March 8, 2019 16 hours ago, k0ni said: @Override public int onLoop() { log("hi"); return 1000; } } Try it that way You literally changed nothing lmao. Your problem is that you're missing the public access specifier for your class. should be: public class Main extends AbstractScript { Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now