Jump to content
datpigeon

need help determining the next game tick

Recommended Posts

i need help determining when the next game tick will be to help with a script i'm writing.  I essentially want to do only 1 action during that game tick, and i've tried all the GameTickListener and the deprecated method onGameTick() and i couldn't get either of them to work.  So i was wondering if there was anyway to read each game tick and increment a value whenever a new game tick takes place.

btw i've tried checking the API for any information and couldn't find a single thing

Link to comment
Share on other sites

5 hours ago, datpigeon said:

i need help determining when the next game tick will be to help with a script i'm writing.  I essentially want to do only 1 action during that game tick, and i've tried all the GameTickListener and the deprecated method onGameTick() and i couldn't get either of them to work.  So i was wondering if there was anyway to read each game tick and increment a value whenever a new game tick takes place.

btw i've tried checking the API for any information and couldn't find a single thing

If you the timestamp of any tick reliant change, you can just use that to find when the next tick will occur.

Where did you find GameTickListener and onGameTick() ? These are not specified in the OSBot API

  • Boge 1
Link to comment
Share on other sites

5 hours ago, FrostBug said:

If you the timestamp of any tick reliant change, you can just use that to find when the next tick will occur.

Where did you find GameTickListener and onGameTick() ? These are not specified in the OSBot API

I was thinking about that and using prayer points but I decided there was a good chance that I wouldn't lose a prayer point every game tick, if you don't mind telling me how you do it in pm or something as watching your fire cape bot video did inspire me to find a way to detect the game ticks (im not making a fire cape bot btw).  I have a few ideas on how you might be able to determine it, but since I have created this thread I used this code to find a general idea of when the ticks happen (this is in the onPaint method so it updates really fast)

gameTick = (int)java.lang.Math.floor((double)getBot().getClient().gameClockMs() / 600);
g.drawString("Current Game Tick:  " + gameTick,10,250);

I know it's probably not the most efficient process, but it was all I could think of right before I went to sleep.

I found those methods way before when I was browsing through the possible methods to call (i am probably using the wrong terminology btw, im pretty new to programming in general) like for example:

17bb1a1abc26e6e716a7a66d4def361c.gif

I generally find it more useful browsing through that than wasting time looking at the API, since in the API it NEVER tells you the exact "vaules" that could be returned like for instance a MessageType TypeID returns these values based off of the message:

 proximity message - TypeID = 2
 private message - TypeID = 3
 clan message - TypeID = 9
 game message - TypeID = 27
 autochat message - TypeID = 90
 trade message - TypeID = 101
 

That kind of information is nowhere to be found in the API AT ALL, which imo makes the API pretty much useless.  Sorry the majority of this post was off topic, but I hope i learn something from you or other experienced people on this forum.

 

EDIT: just now after testing, I was able to 1 tick flick for a while while only looking at the current game tick that i used, so it should be sufficient enough

Edited by datpigeon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

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