Zappster Posted December 1, 2015 Share Posted December 1, 2015 (edited) This has been partially solved, please scroll down to my next reply for the solution So for my script I need to find out which way my NPC is walking. I've checked the API and did some googling to find that: npcs.closest(id).getRotation would work, however it looks like it has been depricated in the API. I can't see anything in the NPCS that would help me find the solution to this. I know I could grab 2 positions of the NPC and work out the direction myself, but my script is heavily reliant on timing and leaves me with not much room to do this calculation. I could make it work for my script so it's not the end of the world, it's just that I'd like to aviod rewriting functions. So, any clean way to get the rotation of an NPC without having to take 2 positions? Thanks. Edited December 1, 2015 by zappa2010 Quote Link to comment Share on other sites More sharing options...
Alvin Posted December 1, 2015 Share Posted December 1, 2015 It should be getRoation(), just saying. As I'm not a coder in OSBot yet, I can't answer any of your other questions well... Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted December 1, 2015 Share Posted December 1, 2015 (edited) Good question, I have no idea why getRotation() is deprecated. Probably a new method somewhere hidden in the client xD Haven't used it in a while. Khaleesi Edited December 1, 2015 by Khaleesi Scripts Quote Link to comment Share on other sites More sharing options...
Zappster Posted December 1, 2015 Author Share Posted December 1, 2015 Hey, I managed to resolve the problem thanks to FrostBug. Dumbass me had the wrong type. Here's my line of code: Entity npc1 = npcs.closest(id); The .getRotation belongs to the Character type and needs casting from NPC. So if you have this problem and need to get the N/E/S/W position of an NPC, you need to change the type to NPC like so: NPC npc1 = npcs.closest(id); int rot = npc1.getRotation(); I'm still stuck on what .getRotation returns. Is this correct? 1-North 2- East 3- South 4- West or is it.. 0-North 1-East 2-South 3-West or something I've missed completly? Quote Link to comment Share on other sites More sharing options...
Lordsthan Posted December 1, 2015 Share Posted December 1, 2015 (edited) Values from .getRotation() when walking into a new tile: North: 1024 Northeast: 1280 East: 1536 Southeast: 1792 South: 0 Southwest: 256 West: 512 Northwest: 768When interacting with a NPC/Entity, subtract 1 from these values (Ex: North: 1024 if walking; 1023 if interacting). Edited December 1, 2015 by Lordsthan 1 Quote Link to comment Share on other sites More sharing options...