- Thread Author
- #1
First time trying to make myself a bot.
I am relatively new to Java, and Runemate.
Error message and the files:
I am relatively new to Java, and Runemate.
Error message and the files:
java.lang.NullPointerException
at com.Omrudon.bot.Smelter.Branch.oreInInventory.validate(oreInInventory.java:32)
at com.runemate.game.api.script.framework.tree.TreeBot.onLoop(hdc:29)
at com.runemate.game.api.script.framework.LoopingBot.run(rcc:200)
at com.runemate.game.api.script.framework.AbstractBot.start(mbc:8508)
at nul.IIIiIIiiIiiii.run(mmc:154)
Code:
package com.Omrudon.bot.Smelter.Branch;
import com.Omrudon.bot.Smelter.OMBot;
import com.runemate.game.api.hybrid.local.hud.interfaces.Inventory;
import com.runemate.game.api.script.framework.tree.BranchTask;
import com.runemate.game.api.script.framework.tree.TreeTask;
public class oreInInventory extends BranchTask {
public OMBot omBot;
public oreInInventory(OMBot omBot) {
omBot = omBot;
}
public portableExists portableExists = new portableExists(omBot);
public isBankOpen isBankOpen = new isBankOpen(omBot);
@Override
public TreeTask failureTask() {
return isBankOpen;
}
@Override
public TreeTask successTask() {
return portableExists;
}
@Override
public boolean validate() {
return Inventory.contains(omBot.Settings.materialName);
}
}
Code:
package com.Omrudon.bot.Smelter;
import com.Omrudon.Util.AntiBot;
import com.Omrudon.bot.Smelter.Branch.oreInInventory;
import com.runemate.game.api.script.framework.tree.TreeBot;
import com.runemate.game.api.script.framework.tree.TreeTask;
public class OMBot extends TreeBot {
public Settings Settings = new Settings();
public AntiBot antiBot = new AntiBot();
@Override
public TreeTask createRootTask() {
return new oreInInventory(this);
}
}
Code:
package com.Omrudon.bot.Smelter;
public class Settings {
public final String materialName = <<Some string>>;
<< ++ other variables >>
}