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
  • Null pointer exception


    Bladez

    Recommended Posts

    Hello all, i'm making a firemaking script and wrote some code to define whether i'm standing on a fire or not.
    The only problem is i'm getting a null pointer exception which is making the script hang.
    Can anyone see anything wrong with my code?
    Many thanks in advance
     

    		Tile fire = getLocalPlayer().getTile();
        	GameObject Firelocation = getGameObjects().getTopObjectOnTile(fire);
    		GameObject Fireobject = getGameObjects().closest(FireID -> FireID.getID() == 26185);
    
                if(Firelocation != null && Firelocation == Fireobject) {
            		getWalking().walk(FIREAREA.getRandomTile());
                	sleepUntil(() -> !getLocalPlayer().isAnimating(), 3000);
                	log("Walking");
                }
    • 14:20:31: Exception has occurred while running! Please report error to developer if problem persists: java.lang.NullPointerException at Firemaker.onLoop(Firemaker.java:46) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:264) at java.lang.Thread.run(Unknown Source)
    Link to comment
    Share on other sites

    It actually turned out to be the way of clicking randomly in inventory, it was working perfectly earlier?
                    getInventory().getRandom(item -> item != null && item.hasAction("Logs")).interact("Use");

    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.