Stormscythe 263 Share Posted March 18, 2015 Hello I get this NPE occassionally with my Monk Killer. In the client, there is no info about the NPE (apart from saying there is a NPE, no details about it though) but the console logs the following. What could be the cause of this? java.lang.NullPointerException at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source) at sun.reflect.UnsafeObjectFieldAccessorImpl.get(Unknown Source) at java.lang.reflect.Field.get(Unknown Source) at org.dreambot.core.b.a.b.a(b.java:47) at org.dreambot.core.b.a.b.a(b.java:40) at org.dreambot.api.wrappers.interactive.NPC.getReflectComposite(NPC.jav a:42) at org.dreambot.api.wrappers.interactive.NPC.getID(NPC.java:53) at org.dreambot.api.wrappers.interactive.NPC.getRealID(NPC.java:83) at org.dreambot.api.wrappers.interactive.NPC.getComposite(NPC.java:35) at org.dreambot.api.wrappers.interactive.NPC.getActions(NPC.java:48) at org.dreambot.api.wrappers.interactive.Character.isInCombat(Character. java:423) at dreamBotMonkKiller.getState(dreamBotMonkKiller.java:49) at dreamBotMonkKiller.onLoop(dreamBotMonkKiller.java:57) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:167) at java.lang.Thread.run(Unknown Source) java.lang.NullPointerException at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source) at sun.reflect.UnsafeObjectFieldAccessorImpl.get(Unknown Source) at java.lang.reflect.Field.get(Unknown Source) at org.dreambot.core.b.a.b.a(b.java:47) at org.dreambot.core.b.a.b.a(b.java:40) at org.dreambot.api.wrappers.interactive.NPC.getReflectComposite(NPC.jav a:42) at org.dreambot.api.wrappers.interactive.NPC.getID(NPC.java:53) at org.dreambot.api.wrappers.interactive.NPC.getRealID(NPC.java:83) at org.dreambot.api.wrappers.interactive.NPC.getComposite(NPC.java:35) at org.dreambot.api.wrappers.interactive.NPC.getActions(NPC.java:48) at org.dreambot.api.wrappers.interactive.Character.isInCombat(Character. java:423) at dreamBotMonkKiller.getState(dreamBotMonkKiller.java:49) at dreamBotMonkKiller.onLoop(dreamBotMonkKiller.java:57) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:167) at java.lang.Thread.run(Unknown Source) java.lang.NullPointerException at sun.reflect.UnsafeFieldAccessorImpl.ensureObj(Unknown Source) at sun.reflect.UnsafeObjectFieldAccessorImpl.get(Unknown Source) at java.lang.reflect.Field.get(Unknown Source) at org.dreambot.core.b.a.b.a(b.java:47) at org.dreambot.core.b.a.b.a(b.java:40) at org.dreambot.api.wrappers.interactive.NPC.getReflectComposite(NPC.jav a:42) at org.dreambot.api.wrappers.interactive.NPC.getID(NPC.java:53) at org.dreambot.api.wrappers.interactive.NPC.getRealID(NPC.java:83) at org.dreambot.api.wrappers.interactive.NPC.getComposite(NPC.java:35) at org.dreambot.api.wrappers.interactive.NPC.getActions(NPC.java:48) at org.dreambot.api.wrappers.interactive.Character.isInCombat(Character. java:423) at dreamBotMonkKiller.getState(dreamBotMonkKiller.java:49) at dreamBotMonkKiller.onLoop(dreamBotMonkKiller.java:57) at org.dreambot.api.script.AbstractScript.run(AbstractScript.java:167) at java.lang.Thread.run(Unknown Source) The two lines of my script is: private State getState() { if(getPlayers().myPlayer().getHealthPercent() <= 30) 48: return State.HEALING; 49: if(!getLocalPlayer().isInCombat() && getPlayers().myPlayer().getHealthPercent() >= 30) 50: return State.ATTACK; return State.FIGHTING; } 55: public int onLoop() { 56: 57: switch(getState()){ 58: case HEALING: 59: status = "Healing!"; Link to comment Share on other sites More sharing options...
Chris 154 Share Posted March 18, 2015 I experience this occasionally also. Does it happen at login? Could be because the player object isn't ready when you're trying to run it. When I get home today, I'll look into it, if it hasn't by then. Just got to work Link to comment Share on other sites More sharing options...
Stormscythe 263 Author Share Posted March 18, 2015 I experience this occasionally also. Does it happen at login? Could be because the player object isn't ready when you're trying to run it. When I get home today, I'll look into it, if it hasn't by then. Just got to work No, this happens at random times while the script is running, and logs me out due to inactivity. Link to comment Share on other sites More sharing options...
Chris 154 Share Posted March 18, 2015 Try using getPlayers().myPlayer() instead of getLocalPlayer() for now. I believe that's an ongoing issue at the moment Link to comment Share on other sites More sharing options...
Stormscythe 263 Author Share Posted March 18, 2015 Try using getPlayers().myPlayer() instead of getLocalPlayer() for now. I believe that's an ongoing issue at the moment They both throw the NPE. I originally used getPlayers().myPlayer() but I changed it to getLocalPlayer() to see if that fixed it. Link to comment Share on other sites More sharing options...
Nuclear Nezz 1995 Share Posted March 18, 2015 It's a cache issue. It's trying to find a composite in the cache, and is failing to find it. I may or may not know the issue already, but I'll take a look into it later (If Chris doesn't get a chance to) Ericthecmh 1 Link to comment Share on other sites More sharing options...
Recommended Posts