Image Search with changing image resolution

Ask gaming related questions (AHK v1.1 and older)
Blocksers
Posts: 1
Joined: 15 May 2021, 04:16

Image Search with changing image resolution

15 May 2021, 04:38

Hi,
Im not an expert with autohotkey and im wondering if any one of you guys could help me out. Im trying to write a bot for a game, but the problem that im facing is the following: every time you restart the game, and zoom out all the way, the resolution of the image that i am searching on screen is a tiny bit different. I think the amount that you can zoom out after every restart of the game is somehow randomized, maybe to make it harder for people like me trying to bot it lol. My first thought was to use some sort of image Search and then reducing the confidence so that the script recocnizes the image if its slitly different nur im not beeing verry successfull with my aproach (my coding skills arent verry good annyways). I would Love to hear some suggestions from you guys and would love to hear how a more knolagable Person might approach this :)
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Image Search with changing image resolution

15 May 2021, 06:22

  • establish a known marker that is always available upon login(eg some gui element/terrain feature/landmark/etc)
  • screenshot it. call that scale 1. thats gonna be ur reference scale
  • then, screenshot the thing ure trying to imagesearch for. thats also gonna be in scale 1
  • relog
  • screenshot the known marker(which presumably is now scaled differently)
  • resize ur stored scale 1 marker and compare it against the new one until it matches the new one(to a given degree)
  • from that, compute the scaling factor
  • scale ur scale 1 imgsearch image by that amount
  • hope imgsearch finds it now
of course, this is hardly going to be foolproof and ull likely have to do some further image processing(eg discard details, etc) to account for the implementation differences of the scaling algorithms used(unless u can find out exactly which algorithm the game uses)
so its probably going to be easier to just read whatever it is u need off of process memory instead

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 56 guests