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
  • NullPointerException


    Scorpius
     Share

    Recommended Posts

    Sometimes my script throws a NullPointerException when using getWalking().toggleRun()

    [ERROR]11:29:20: Exception has occurred while running! Please report error to developer if problem persists:
        java.lang.NullPointerException
        at org.dreambot.api.methods.walking.impl.Walking.toggleRun(Walking.java:220)
        at MYSCRIPT.Tasks.DrinkStaminaPotion.accept(DrinkStaminaPotion.java:20)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at org.dreambot.api.script.impl.TaskScript.onLoop(TaskScript.java:73)
        at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:250)
        at java.lang.Thread.run(Unknown Source)
    

    Nevermind, this occurs if the game is loading (due to a world hop)

    Edited by zScorpio
    Link to comment
    Share on other sites

    Sometimes my script throws a NullPointerException when using getWalking().toggleRun()

    [ERROR]11:29:20: Exception has occurred while running! Please report error to developer if problem persists:
        java.lang.NullPointerException
        at org.dreambot.api.methods.walking.impl.Walking.toggleRun(Walking.java:220)
        at MYSCRIPT.Tasks.DrinkStaminaPotion.accept(DrinkStaminaPotion.java:20)
        at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at org.dreambot.api.script.impl.TaskScript.onLoop(TaskScript.java:73)
        at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:250)
        at java.lang.Thread.run(Unknown Source)
    

    Nevermind, this occurs if the game is loading (due to a world hop)

    It nulls out because it can't  find the "run" widget. Maybe it's a good idea to place your hopping algorithm into a separate method handler so your script won't loop while it's hopping/loading.

    Link to comment
    Share on other sites

    It nulls out because it can't  find the "run" widget. Maybe it's a good idea to place your hopping algorithm into a separate method handler so your script won't loop while it's hopping/loading.

    I got around it by null checking

    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.