Jump to content

interact and onmessage


fre024

Recommended Posts

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 by fre024
Link to comment
Share on other sites

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

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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...