maximiliano1 Posted September 21, 2021 Share Posted September 21, 2021 Hi, my Scripts needs exact time of xp drops, there's no such event handler for this (I couldn't find myself from the javadocs)? Quote Link to comment Share on other sites More sharing options...
Heiz Posted September 21, 2021 Share Posted September 21, 2021 (edited) Maybe you can store current xp in a global variable, and then check if your variable is different from current xp public class MyAwesomeBot extends Script { private int currentExp; @Override public void onStart() { currentExp = getExperienceTracker().getGainedXP(Skill.STRENGTH); } @Override public int onLoop() { if(currentExp != getExperienceTracker().getGainedXP(Skill.STRENGTH)){ log("Exp changed!"); currentExp = getExperienceTracker().getGainedXP(Skill.STRENGTH); } return 500; } } Edited September 21, 2021 by Heiz identation Quote Link to comment Share on other sites More sharing options...
maximiliano1 Posted September 21, 2021 Author Share Posted September 21, 2021 @HeizThanks, but I'm making a pking script, so I need exact time of the XP drop not the one that is based on the onLoop callback... Quote Link to comment Share on other sites More sharing options...
ProjectPact Posted September 21, 2021 Share Posted September 21, 2021 3 hours ago, maximiliano1 said: @HeizThanks, but I'm making a pking script, so I need exact time of the XP drop not the one that is based on the onLoop callback... Game ticks occur every ~600 ms Quote Link to comment Share on other sites More sharing options...
maximiliano1 Posted September 21, 2021 Author Share Posted September 21, 2021 37 minutes ago, ProjectPact said: Game ticks occur every ~600 ms So you're saying that the tick == update of the game and consequently the xp updates happen on tick updates? Didn't know that Quote Link to comment Share on other sites More sharing options...
maximiliano1 Posted September 22, 2021 Author Share Posted September 22, 2021 On 9/21/2021 at 9:45 PM, ProjectPact said: Game ticks occur every ~600 ms I've tested as you advised by computing the xp change directly through the onGameTick and then computing via ExperienceTracker, but still after capturing the video and checking the timings, it seems that ExperienceTracker lags behind couple ticks compared to the actual xp change. Quote Link to comment Share on other sites More sharing options...