B1llymayz 0 Share Posted November 20, 2018 I have been trying many things but this is issue has seemed to stump me. I am trying to create a hunter bot. I cannot seem to figure out how code this because I am unsure of what makes an object null in Runescape. I would like to do something like if(bird snare has not been placed) { then lay the bird snare on the ground } I know how to do the bird snare actions and all that but I do not know how to tell if it has not been placed Link to comment Share on other sites More sharing options...
DeadmanVlei 1 Share Posted November 20, 2018 GameObjects gm = getGameObjects().closest("Bird snare"); if (gm!=null) { dostuff(); } Link to comment Share on other sites More sharing options...
B1llymayz 0 Author Share Posted November 21, 2018 Wow, I am pretty mad at myself right now. I could of swore I tried that. It works thank you very much! Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted November 21, 2018 14 hours ago, B1llymayz said: Wow, I am pretty mad at myself right now. I could of swore I tried that. It works thank you very much! You may also want to consider checking the 'setup' tile for any existing snares, else you may end up trying to place a snare on an invalid tile! Best of luck. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.