1stTimeDev Posted July 11, 2016 Share Posted July 11, 2016 How would I grab if the Npc is walking? n.isMoving will return true or false depending when the script grabs the npc. So if a guard is walking when the script gets to it, it will return true or if its stationary, it will return false but as we all know all guards will walk. Hope this made sense and any help is appreciated. Quote Link to comment Share on other sites More sharing options...
Explv Posted July 11, 2016 Share Posted July 11, 2016 2 Quote Link to comment Share on other sites More sharing options...
1stTimeDev Posted July 11, 2016 Author Share Posted July 11, 2016 (edited) Well, for example public boolean dump(NPC n) { log("Is npc moving" + "" + n.isMoving()); } Only one npc around me, so if the npc is moving it will return true, but when the npc stops it will return false. It works the same way when writing to pastebin. It isn't right. Edited July 11, 2016 by 1stTimeDev Quote Link to comment Share on other sites More sharing options...
Explv Posted July 11, 2016 Share Posted July 11, 2016 (edited) Well, for example public boolean dump(NPC n) { log("Is npc moving" + "" + n.isMoving()); } Only one npc around me, so if the npc is moving it will return true, but when the npc stops it will return false. It works the same way when writing to pastebin. It isn't right. So you are saying the method "isMoving" should return true even if the npc is not moving? The method is called isMoving() not canMove() Edited July 11, 2016 by Explv Quote Link to comment Share on other sites More sharing options...
1stTimeDev Posted July 11, 2016 Author Share Posted July 11, 2016 So you are saying the method "isMoving" should return true even if the npc is not moving? The method is called isMoving() not canMove() Okay, so the script will grab the initial movement for an NPC. You're right, it should return true if the npc is walking, but the problem is that the npc has two phases - Walks and stops. If the npc has stopped moving when the script is writing about it it will return false which is wrong. So, if the goblin is stationary when the script finds it it will return false, and if one goblin is active when the script finds it it will return true, whereas we know, all goblins move. Is there any way we could actually check if the npc has walked in a given time and if not, it would return false. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 12, 2016 Share Posted July 12, 2016 I think you misunderstand primitives in java. They are nothing but values; not references to something somewhere. A boolean value is never going to change by itself, and is immediately stale if you declare one for whether the NPC is moving or not. Just keep checking npc.isMoving directly; whether or not he was moving 10 minutes ago is most likely irrelevant Quote Link to comment Share on other sites More sharing options...