1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bug NullpointerException

Discussion in 'Developer Support' started by itzDot, Sep 2, 2015.

  1. itzDot

    Joined:
    Sep 1, 2015
    Messages:
    9
    Likes Received:
    3
    Hi, I tried converting one of my scripts bots from a different api onto runemate api and when I try to run the script bot I get this error
    java.lang.NullPointerException
    at com.itzDot.bots.AdvWineGrabber.tasks.WalkToLocation.execute(WalkToLocation.java:22)
    at com.runemate.game.api.script bot.framework.task.TaskScript.onLoop(spb:231)
    at com.runemate.game.api.script bot.framework.LoopingScript.run(gwb:14)
    at com.runemate.game.api.script bot.framework.AbstractScript.start(jpb:51)
    at app.TM.run(znb:227)
    --- Double Post Merged, Sep 2, 2015, Original Post Date: Sep 2, 2015 ---
    and the line 22 i'm using the webpath which looks like
    final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(new Coordinate(2931, 3515, 0));
    path.step();
     
  2. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
    Check the path for null.

    finalWebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(new Coordinate(2931, 3515, 0));

    if(path != null) {
    path.step();
    }
     
  3. itzDot

    Joined:
    Sep 1, 2015
    Messages:
    9
    Likes Received:
    3
    that did help stop giving me a null error but my script bot seems to not run, i'm extending the mainclass off taskscript and on my onStart() i have this
    public void onStart(String... args){
    iniTime = System.currentTimeMillis();
    iniXp = Skill.MAGIC.getExperience();
    setLoopDelay(450, 600);
    add(new TeleGrab(), new Bank(), new TeleportToFally(), new WalkToBank(), new WalkToLocation());}

    am I missing anything else in order for the taskscript to loop through?
     
  4. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    @Cloud under what conditions does the path return null?
     
  5. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    It returns null whenever it cannot generate a path that is reasonably accurate. That's usually because the area isn't mapped.
     

Share This Page

Loading...