Page 1 of 1

In-game time in Dota 2

Posted: 21 Feb 2017, 09:51
by Cage
I want to write a simple script for Dota 2 replay viewer.
I need to press the Y button (Send, y) at 10:00 in-game time, which switches in-game stats.
How to access the in-game time in the replay? Is it possible to do with AHK?

Re: In-game time in Dota 2

Posted: 23 Feb 2017, 05:52
by John
Quite a few ways to deal with it, only limiting factor is what you can do in order to actually implement it.
Memory reading is one option, but if you're not comfy with it there's a good chance you might get yourself banned while looking for the offsets+address.
You could use one of the many OCR libraries/functions to read the numbers, but they tend to be complex and also heavy. Way heavier than needed just to determine a max 6 long string of 10 possible characters.
That leaves either writing your own simplified OCR 'system' or determining which screen (main menu, in game, etc.) you're on with a handful of "pixelgetcolors", getting the "a_tickcount" as soon as you go from hero selection to in game, subtracting pause durations and having a fairly accurate representation of the current time.

Re: In-game time in Dota 2

Posted: 24 Feb 2017, 08:24
by Cage
Thank you for response.
John wrote:Memory reading is one option ... there's a good chance you might get yourself banned
How can I do this by AHK?
Is that really possible to get ban just because of reading memory?
John wrote:writing your own simplified OCR 'system'
Don't realy like OCR here, because positive result will depend on game resolution and can be broken by mouse pointer moving over the in-game time.
John wrote:subtracting pause durations
Too complicated and not enough accurate method, IMHO.

Re: In-game time in Dota 2

Posted: 27 Feb 2017, 10:28
by eventhorizon
Dota 2 uses VAC anti-cheat software. Although a simple process memory read is benign, you can never be certain you won't get a VAC ban if the vac is upgraded by the devs at some point. Another method might be to write a simple AHK Timer routine you can sync with the onscreen timer that doesn't actually interfere with the game. Once the timer is sync'd properly with the game time, the timer routine could initiate whatever actions you want automatically once the timer reaches a predetermined value. The timer could read the up and down arrow keys, for example, to activate the syncronization so the timer value is within some valid range with the onscreen timer. Just a thought