sudoinit6 Posted December 8, 2016 Share Posted December 8, 2016 I am attempting to make the bot flee if he is under attack by anything. I tried this: if ((myPlayer().getHealthPercent() < 100)){ return state.WALK_TO_BANK; But it doesn't have the desired effect, if hi gets hurt he still just does his thing. Any tips? Thanks! Quote Link to comment Share on other sites More sharing options...
Chris Posted December 8, 2016 Share Posted December 8, 2016 http://osbot.org/api/org/osbot/rs07/api/model/Character.html Quote Link to comment Share on other sites More sharing options...
tampera666 Posted December 8, 2016 Share Posted December 8, 2016 Ended losing 3 red phats in 2010 Quote Link to comment Share on other sites More sharing options...
01053 Posted December 9, 2016 Share Posted December 9, 2016 isUnderAttack() checking if the health percent is below 100 will likely fail in most situations depending on your defence / whether the npc deals damage. Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 9, 2016 Share Posted December 9, 2016 Check if your in combat or interacting with the NPC Quote Link to comment Share on other sites More sharing options...
sudoinit6 Posted December 9, 2016 Author Share Posted December 9, 2016 Check if your in combat or interacting with the NPC Thanks, that works! if ((myPlayer().isUnderAttack())){ return state.GTFO; Quote Link to comment Share on other sites More sharing options...