Posted 15 October 2015 - 09:06 AM
(I posted here because this question is not CC related)
I'm coding a Bot (for a game. just to see if it is possible) that "replays" a replay (which would result in getting the same score all the time). Parsing the replay and extracting the mouse-movement wasn't a problem, but scaling the coordinates is harder than I thought.
My actual screen-size is 1920/1080 px. The game window has a resolution of 1080/720 (It has to be windowed because otherwise I can't extract information from the game window-title) and the mouse movement is recorded on a 512/384 grid/whatever (<- these are no integers but floats so they have a decimal point)
I tried something like this:
Does anyone have an idea?
I'm coding a Bot (for a game. just to see if it is possible) that "replays" a replay (which would result in getting the same score all the time). Parsing the replay and extracting the mouse-movement wasn't a problem, but scaling the coordinates is harder than I thought.
My actual screen-size is 1920/1080 px. The game window has a resolution of 1080/720 (It has to be windowed because otherwise I can't extract information from the game window-title) and the mouse movement is recorded on a 512/384 grid/whatever (<- these are no integers but floats so they have a decimal point)
I tried something like this:
half_of_screen - half_of_window + coords
Which resulted in my cursor jumping around.Does anyone have an idea?
Edited on 15 October 2015 - 07:09 AM