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
  • BUG : getGameObjects().closest(); breaking my code


    Warrior627
     Share

    Recommended Posts

    Update: After reinstalling my dreambot files, my script executes fine, however all objects that are found with getGameObjects().all() are all null.

    For example, getGameObjects().all().size() returns 7801, however when I loop through these objects, they are all null.


    The following works:
     

    @Override
    public int onLoop() {
        log("Running");
    	GameObject test;
        return 500;
    }

    It outputs: 

    1. Running
    2. Running
    3. Running
    4. Running
    5. ect...

    The following doesn't work:
     

    @Override
    public int onLoop() {
        log("Running");
    	GameObject test = getGameObjects().closest("Tree");
        return 500;
    }

    It outputs:

    1. Running

    And that's it, the script get stucks, no errors are thrown and the bot continues to run, except it never finishes executing getGameObjects().closest();

    Edited by Warrior627
    Some Fixes
    Link to comment
    Share on other sites

    Here's my output:

    [INFO] Connecting to server...
    [INFO] Connected to server!
    log4j:WARN No such property [conversionPattern] in org.apache.log4j.PatternLayout.
    log4j:WARN No such property [conversionPattern] in org.apache.log4j.PatternLayout.
    log4j:WARN No such property [maxFileSize] in org.apache.log4j.RollingFileAppender.
    log4j:WARN No such property [file] in org.apache.log4j.RollingFileAppender.
    log4j:WARN File option not set for appender [LocalFile].
    log4j:WARN Are you using FileAppender instead of ConsoleAppender?
    [INFO] Logged in successfully! You may now open a tab!
    [INFO] Your current rank(s):
            [VIP]
    [INFO] Tab Count: 0
    [INFO] Successfully loaded 182 worlds!
    [INFO] Starting new instance...
    [INFO] Attempting to connect to OSRS...
    [INFO] Connection successful!
    [INFO] Attempting to start new applet...
    [INFO] Opened gamepack connection!
    [INFO] Successfully started new applet!
    [INFO] Loaded 372 field definitions!
    [INFO] Loaded 5318 web nodes successfully!
    [INFO] Successfully started new instance!
    [INFO] Successfully initialized 18 cache index files!
    [INFO] Starting game state listener!
    [INFO] Started game state listener!
    [INFO] Starting message listener...
    [INFO] Started message listener!
    [INFO] Script set to running!
    Running
    log4j:ERROR No output stream or file set for the appender named [LocalFile].

     

    Looks okay to me? Not sure what this output stream / file is for...

    I'm using JDK 1.8.0_144 x86
                     JRE 1.8.0_191 x86

    Edited by Warrior627
    Link to comment
    Share on other sites

    1 hour ago, Warrior627 said:

    Here's my output:

    [INFO] Connecting to server...
    [INFO] Connected to server!
    log4j:WARN No such property [conversionPattern] in org.apache.log4j.PatternLayout.
    log4j:WARN No such property [conversionPattern] in org.apache.log4j.PatternLayout.
    log4j:WARN No such property [maxFileSize] in org.apache.log4j.RollingFileAppender.
    log4j:WARN No such property [file] in org.apache.log4j.RollingFileAppender.
    log4j:WARN File option not set for appender [LocalFile].
    log4j:WARN Are you using FileAppender instead of ConsoleAppender?
    [INFO] Logged in successfully! You may now open a tab!
    [INFO] Your current rank(s):
            [VIP]
    [INFO] Tab Count: 0
    [INFO] Successfully loaded 182 worlds!
    [INFO] Starting new instance...
    [INFO] Attempting to connect to OSRS...
    [INFO] Connection successful!
    [INFO] Attempting to start new applet...
    [INFO] Opened gamepack connection!
    [INFO] Successfully started new applet!
    [INFO] Loaded 372 field definitions!
    [INFO] Loaded 5318 web nodes successfully!
    [INFO] Successfully started new instance!
    [INFO] Successfully initialized 18 cache index files!
    [INFO] Starting game state listener!
    [INFO] Started game state listener!
    [INFO] Starting message listener...
    [INFO] Started message listener!
    [INFO] Script set to running!
    Running
    log4j:ERROR No output stream or file set for the appender named [LocalFile].

     

    Looks okay to me? Not sure what this output stream / file is for...

    I'm using JDK 1.8.0_144 x86
                     JRE 1.8.0_191 x86

    Strange. Did you used quickstart? Do you have an onStart method and if yes show us the code. We might need more context.

    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.