botmaker_01 1 Posted September 20, 2021 Hi everyone, I've tried to use the GameTickListener interface but it didn't seem to work. Any suggestions? Other interface like ExperienceListener worked just fine. import org.dreambot.api.methods.MethodProvider; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.script.listener.GameTickListener; @ScriptManifest(name = "Test script", description = "this is a test script", author = "Developer Name", version = 1.0, category = Category.COMBAT, image = "") public class TestScript extends AbstractScript implements GameTickListener { @Override public void onStart() { MethodProvider.log("on start"); } @Override public void onGameTick() { MethodProvider.log("gametick: " + System.currentTimeMillis()); } @Override public int onLoop() { log("On Loop"); return 1000; } }
Pandemic 2818 Posted September 20, 2021 Hey there, the GameTickListener isn't implemented yet, I've marked it as deprecated and updated the Javadocs to show that in future updates. It'll eventually work, it's just not added right now
botmaker_01 1 Author Posted September 21, 2021 Thanks for quick reply, hopefully it can be added soon. It's kinda critical for my script
trtl 2 Posted September 21, 2021 5 hours ago, botmaker_01 said: Thanks for quick reply, hopefully it can be added soon. It's kinda critical for my script Now I'm curious what the script is about if knowing the exact tick is critical to it...
Hosfad 155 Posted September 21, 2021 9 hours ago, trtl said: Now I'm curious what the script is about if knowing the exact tick is critical to it... Problem is that he wont be in sync with the actual gametick , even if its implemented
Axolotl 31 Posted September 22, 2021 2 hours ago, Hosfad said: Problem is that he wont be in sync with the actual gametick , even if its implemented You can get it pretty dang close by using System.currentTimeMillis() with a method call checking xp drops / animation timing. Although its next to impossible to account for server lag / internet delay / map loading that will offset the System time slightly. I'm sure with tweaks/testing a method could account for this
Hosfad 155 Posted September 22, 2021 5 minutes ago, Axolotl said: server lag / internet delay / map loading Thats exactly why im saying you cant be in sync
botmaker_01 1 Author Posted September 22, 2021 20 hours ago, Hosfad said: Problem is that he wont be in sync with the actual gametick , even if its implemented Really? I thought it uses the information of the server/client of osrs state information directly just in same way as the RuneLite does? I'm not that familiar of how the API accesses the actual game information though, not even sure how reflection and injection works. 17 hours ago, Axolotl said: You can get it pretty dang close by using System.currentTimeMillis() with a method call checking xp drops / animation timing. Although its next to impossible to account for server lag / internet delay / map loading that will offset the System time slightly. I'm sure with tweaks/testing a method could account for this Obviously if you keep local gameTick which occurs every 600ms it won't ever be in sync with the actual game tick? so it won't work
playing2win 0 Posted September 23, 2021 On 9/21/2021 at 7:15 AM, Pandemic said: Hey there, the GameTickListener isn't implemented yet, I've marked it as deprecated and updated the Javadocs to show that in future updates. It'll eventually work, it's just not added right now when this is added i will be getting that elite donor rank. i have also have a script which would really benefit from game tick listener so hoping this comes soon.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.