Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Bug NullpointerException

Joined
Sep 1, 2015
Messages
9
Hi, I tried converting one of my scripts from a different api onto runemate api and when I try to run the script I get this error
java.lang.NullPointerException
at com.itzDot.bots.AdvWineGrabber.tasks.WalkToLocation.execute(WalkToLocation.java:22)
at com.runemate.game.api.script.framework.task.TaskScript.onLoop(spb:231)
at com.runemate.game.api.script.framework.LoopingScript.run(gwb:14)
at com.runemate.game.api.script.framework.AbstractScript.start(jpb:51)
at app.TM.run(znb:227)
 
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();
 
12 year old normie
Joined
Jan 8, 2015
Messages
2,768
Check the path for null.

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

if(path != null) {
path.step();
}
 
Joined
Sep 1, 2015
Messages
9
that did help stop giving me a null error but my script 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?
 
Top