fre024 Posted September 17, 2014 Share Posted September 17, 2014 (edited) Anything wrong with this code? public void onMessage(Message message) throws InterruptedException { if (message.toString().contains("stunned")) { log("am stunned, pausing."); sleep(random(1000, 4000)); } if (message.toString().contains("during")) { log("In combat."); map.walk(new Position(3266, 3415, 0)); } } solved: need to use message.getMessage().toString().contains("stunned") npc.interact seem to walk with minimap way to often. Even it the npc is just 4 tiles away it walks on minimap somtimes... Edited September 17, 2014 by fre024 Link to comment Share on other sites More sharing options...
Extreme Scripts Posted September 17, 2014 Share Posted September 17, 2014 That's just the default algorithm for the walking in OSBot. If you want to use the Game screen all the time i'm pretty sure there is a method like localwalker.walkOnScreen() or something like that (if it ported from OSBot 1). Have a look through the API. Link to comment Share on other sites More sharing options...
Alek Posted September 17, 2014 Share Posted September 17, 2014 message.getMessage() returns the string you are looking for. message is the object. Link to comment Share on other sites More sharing options...
Apaec Posted September 17, 2014 Share Posted September 17, 2014 Maybe there are other lines ingame which have 'during' in them, perhaps make it more definite. Also I believe this stuff is case sensitive, maybe you could do toString().toLowerCase() or something? Link to comment Share on other sites More sharing options...
fre024 Posted September 17, 2014 Author Share Posted September 17, 2014 That's just the default algorithm for the walking in OSBot. If you want to use the Game screen all the time i'm pretty sure there is a method like localwalker.walkOnScreen() or something like that (if it ported from OSBot 1). Have a look through the API. I don't want it to walk at all, i just want it to interact with the npc without first walking to it. Link to comment Share on other sites More sharing options...
Swizzbeat Posted September 18, 2014 Share Posted September 18, 2014 I don't want it to walk at all, i just want it to interact with the npc without first walking to it. Raise the walking distance threshold. Link to comment Share on other sites More sharing options...
fre024 Posted September 18, 2014 Author Share Posted September 18, 2014 Raise the walking distance threshold. That is a good idea, how do i do this? Cannot find anything about this in the API. Link to comment Share on other sites More sharing options...
Precise Posted September 18, 2014 Share Posted September 18, 2014 That is a good idea, how do i do this? Cannot find anything about this in the API. look into WalkingEvent. i think this is your best bet. Link to comment Share on other sites More sharing options...
fre024 Posted September 19, 2014 Author Share Posted September 19, 2014 look into WalkingEvent. i think this is your best bet. I looked into events before, but cannot figure out how to use them Can someone point me in the right direction? THx Link to comment Share on other sites More sharing options...
Precise Posted September 19, 2014 Share Posted September 19, 2014 I looked into events before, but cannot figure out how to use them Can someone point me in the right direction? THx please attempt to do it, if you're still stuck, post the specific issue and we'll gladly help Link to comment Share on other sites More sharing options...