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
  • Try asking for help in the chatbox
  • Script won't start, no logs


    carellqs
     Share

    Recommended Posts

    Hello,
      I started new script and trying to test it.
      I exported JAR and it appears in local scripts, but when i select it and press "START" nothing happens. No logs in debug console, just nothing.
      Every other script is fine and running, except for this.

    I can't find any answer, tried deleting Dreambot folder and restarting client. I'm running on ubuntu 18.10 with eclipse and running on oracle jdk 8.

    Does anyone had same problem or know how to solve it?

    Attached screenshot of script which i started.

     

    Screenshot_20190201_215214.png

    Link to comment
    Share on other sites

    Hi,  I think your problem is caused by line 14 because you've assigned to the ash field too early, had something similar happen to me atleast.

    try assigning ash  during the onLoop() method as I assume you want to continually pick up ash, probably worth also including a sleep so you're not constantly clicking on the item like:

    GroundItem ash;
    
    @Override
    public int onLoop() {
        ash = getGroundItems().closest(c -> c != null && c.getName().equals("Ash"));
    
        if (!getInventory().isFull()) {
            if (geArea.contains(getLocalPlayer())) {
                if (ash != null) {
                    ash.interact("Take");
                    sleepUntil(() -> !ash.exists(), Calculations.random(2302, 3021));
                }
            }
        }
        return Calculations.random(600, 1025);
    }

    If you did want to assign to 'ash ' only once do it during the onStart() method

    Link to comment
    Share on other sites

    No worries, I'm not sure exactly but I guess it's something to do with the getGameObject method being unavailable before the script has properly started.

    Edited by Vhagar
    Link to comment
    Share on other sites

    • 9 months later...
    On 2/2/2019 at 1:22 PM, Vhagar said:
    On 2/2/2019 at 1:22 PM, Vhagar said:

    Hi,  I think your problem is caused by line 14 because you've assigned to the ash field too early, had something similar happen to me atleast.

    try assigning ash  during the onLoop() method as I assume you want to continually pick up ash, probably worth also including a sleep so you're not constantly clicking on the item like:

    
    GroundItem ash;
    
    @Override
    public int onLoop() {
        ash = getGroundItems().closest(c -> c != null && c.getName().equals("Ash"));
    
        if (!getInventory().isFull()) {
            if (geArea.contains(getLocalPlayer())) {
                if (ash != null) {
                    ash.interact("Take");
                    sleepUntil(() -> !ash.exists(), Calculations.random(2302, 3021));
                }
            }
        }
        return Calculations.random(600, 1025);
    }

    If you did want to assign to 'ash ' only once do it during the onStart() method

    Bro I fking love you. Ty

     

    Link to comment
    Share on other sites

    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • 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.