I have written a script that uses Inventory.get() and Item.interact(), but the script doesn't work properly if the user forgets to open the inventory before running it. When Item.interact() is called, I see the mouse cursor moving to where the item would be in the inventory, but if the inventory is not open, this has no effect.
I can't seem to use the script because it keeps giving this error when I click "Start Miner":
[ERROR] PaintListener threw an exception
java.lang.NullPointerException
at org.dreambot.api.Client.getLevels(Client.java)
at org.dreambot.api.methods.skills.Skill.getLevel(Skill.java)
at org.dreambot.api.methods.skills.Skills.getRealLevel(Skills.java)
at e.onPaint(e.java:66)
at org.dreambot.api.script.event.impl.PaintEvent.dispatch(PaintEvent.java)
at org.dreambot.4h.8(4h.java)
at org.dreambot.4h.0(4h.java)
at org.dreambot.3L.1(3L.java)
at org.dreambot.3L.0(3L.java)
at org.dreambot.3L.getGraphics(3L.java)
at af.f(Unknown Source)
at client.ar(Unknown Source)
at as.t(Unknown Source)
at as.run(Unknown Source)
at java.base/java.lang.Thread.run(Thread.java:829)
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.