FreshEyes 0 Share Posted February 24, 2022 Hi Guys, new to bot scripting and Java. I've checked the API's Java docs and the forums for all of the search terms I can think of but can't find a simple way to determine if the home teleport is on cooldown, or even if the Home teleport has failed because of a cooldown. Before I try to interrogate the chat box to see if there is a cooldown message, or check the current users tile, before/after teleport to determine success is there a simpler/more elegant solution to determining if a user can use the home teleport or not? Cheers Link to comment Share on other sites More sharing options...
pharaoh 130 Share Posted February 24, 2022 i think the easiest way would be to listen for the chat message after interacting with the spell because it sends the game message saying youre unable to use it. i think that is the only check available for using the home teleport. you can implement the ChatListener then use the onGameMessage function it provides Link to comment Share on other sites More sharing options...
Beyond GP 7 Share Posted March 1, 2022 The message listener approach would probably be the best, but there are other options. Another option could maybe be to wait till your character no longer does the home teleport animation. But it's not a very elegant solution. After making sure you have clicked the home teleport spell; MethodProvider.sleep(700, 900); MethodProvider.sleepUntil((() -> Client.getLocalPlayer().getAnimation() != 1234), 3000); Link to comment Share on other sites More sharing options...
nocheatingcsg 9 Share Posted March 1, 2022 Not that I know of. As others have said: parse the cooldown message extract and the remaining time/save timestamp after teleporting and base your logic on that. Works great. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.