Need help/ gaming

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
LuckyS1337
Posts: 55
Joined: 20 Mar 2023, 12:59

Need help/ gaming

Post by LuckyS1337 » 30 Mar 2023, 20:59

this code below works 100%, any idea how to make it for pixels? for example same function but for pixel 0xFF0000

Example:

Code: Select all

image := "C:\Users\User1\AppData\Roaming\Script\Images\X.png" 
end := A_TickCount + wait
wait  := 603
x1    := 451
y1    := 198
x2    := 772
y2    := 532


If FileExist(image)
 img := imgSize(image)
Loop {
sleep, 1
    ImageSearch , x, y, x1, y1, x2, y2, % image
} Until !ErrorLevel || A_TickCount > end
    If !ErrorLevel {
MouseClick ,, x + img.w / 2, y + img.h / 2
} Else
Return

imgSize(img) { 
 SplitPath img, fn, dir
 objShell := ComObjCreate("Shell.Application")
 objFolder := objShell.NameSpace(dir), objFolderItem := objFolder.ParseName(fn)
 scale := StrSplit(RegExReplace(objFolder.GetDetailsOf(objFolderItem, 31), ".(.+).", "$1"), " x ")
 Return {w: scale.1, h: scale.2}
}

[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: Need help/ gaming

Post by mikeyww » 30 Mar 2023, 21:14

Hello,

AutoHotkey has a :arrow: PixelSearch command that might fit your need.

LuckyS1337
Posts: 55
Joined: 20 Mar 2023, 12:59

Re: Need help/ gaming

Post by LuckyS1337 » 30 Mar 2023, 21:57

@mikeyww i tried but it didn't work somehow

User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: Need help/ gaming

Post by mikeyww » 31 Mar 2023, 04:36

Tried what script?

Post Reply

Return to “Ask for Help (v1)”