esge / PoE-HarvestVendor

Tool for getting the list of crafts out of Horticrafting station in Path of exile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi :) suggested function

BanditTech opened this issue · comments

I was checking out your AHK code, and was impressed you were able to get capture2text working with AHK correctly! Last time I tried and was unsuccessful. But anywho, I noticed you are having the user input their dpi scaling manually, and remembered I wrote up a function for that scaling a while back.

  Get_Dpi() {
    return A_ScreenDPI=96?1:A_ScreenDPI/96
  }
Scale_Position(val){
  Return val / Get_Dpi()
}

I hope this helps you! :D

commented

oh wow, i didnt know you can do it like this, i will certainly look into plugging that in. whats the val that is input in scale_position?

and for capture2text working, had to make it write into a text file and then read that, the feature where it puts the ocr result into clipboard wasnt doing anything.

The val is any pixel location, this just scales the value based on the DPI factor

Gotchu, was trying and trying and never got the clipboard to update.... lol ok

I tried to avoid using the method of writing it to disk for myself, since I am doing a constant loop in my script.
I have been using another fast AHK based OCR, called FindText but it requires a symbol library to be created in order to function, so it only works for that specific resolution. But my god is it fast XD

so lets say you have this:

x := 100
y := 200

you would plug in:

scaledX := Scale_Position(x)
scaledY := Scale_Position(y)