Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Need Noob Help


    LubeGuyBaller

    Recommended Posts

    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

    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

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.