iamonkey Posted October 31, 2019 Posted October 31, 2019 (edited) Does anyone know how to implement a game tick counter? This is what I tried, but it seems like onGameTick() is never called (tickCount never increments). Class Declaration: class GameTickCounter implements GameTickListener{ private int tickCount = 0; @Override public void onGameTick(){ this.tickCount++; } public int getCurrentTick(){ return this.tickCount; } } Object Init in main: private GameTickCounter tickCounter = new GameTickCounter(); Implementation: if(tickCounter.getCurrentTick() > currentTick){ currentTick = tickCounter.getCurrentTick(); log("Tick: " + currentTick); } Edited October 31, 2019 by iamonkey
Eagle Scripts Posted October 31, 2019 Posted October 31, 2019 (edited) Make sure to add and remove the listener! @Override public void onStart() { getBot().addGameTickListener(gameTickListener); } @Override public void onExit() { getBot().removeGameTickListener(gameTickListener); } Edited October 31, 2019 by Eagle Scripts
iamonkey Posted October 31, 2019 Author Posted October 31, 2019 (edited) I added that line in my onStart() (and remove onExit) but I'm still not seeing any incrementing getBot().addGameTickListener(tickCounter); Edited October 31, 2019 by iamonkey
Token Posted October 31, 2019 Posted October 31, 2019 The game tick listener was fixed in .60, make sure you use the dev build 2