Go L Den
Member

- Joined
- May 1, 2007
- Sythe Gold
- 0
- Messages
- 84
Hey guys, I'm very new to scripting for RsBot, and I was wondering if someone could give me some help with a Nullpointer error.
I created an extremely simple script using a tutorial to open a bank booth, but I keep getting a nullpointer error whenever I run it.
Here is the script code:
and here is the nullpointer error that I get whenever I run the script (it occurs after the object is found):
If someone could tell me what I did incorrectly and how I should have done it to avoid this error, I would greatly appreciate it.
Thanks,
Go L Den
I created an extremely simple script using a tutorial to open a bank booth, but I keep getting a nullpointer error whenever I run it.
Here is the script code:
Code:
}
import java.awt.*;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.wrappers.*;
public class AutoBank extends Script implements PaintListener {
public void onRepaint(Graphics g)
{
Bot.getEventManager().addListener(PaintListener.class, this);
}
public double getVersion()
{
return 1.0;
}
public String getScriptCategory()
{
return "Auto Bank";
}
public String getName()
{
return "AutoBank";
}
public String getAuthor()
{
return "Go_L_Den";
}
public boolean onStart(String[] args)
{
return true;
}
public void onFinish() {
}
int id1 = 36831;
boolean first = true;
boolean foundobject = false;
RSObject bankbooth = findObject(id1);
public int loop() {
if(first) {
foundobject = true;
log("Found an object!");
first = false;
}
if(foundobject,"Use-quickly") {
atObject(bankbooth);
}
return 1000;
}
}
and here is the nullpointer error that I get whenever I run the script (it occurs after the object is found):
Code:
java.lang.NullPointerException
at com.speljohan.rsbot.script.Methods.atObject(Methods.java:2081)
at AutoBank.loop(AutoBank.java:62)
at com.speljohan.rsbot.script.Script.run(Script.java:102)
at com.speljohan.rsbot.script.ScriptHandler$1.run(ScriptHandler.java:70)
at java.lang.Thread.run(Thread.java:619)
If someone could tell me what I did incorrectly and how I should have done it to avoid this error, I would greatly appreciate it.
Thanks,
Go L Den

