Code: Select all
z::
Send {f2}
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, druid.png
If(ErrorLevel == 0){
Click, %foundX%, %foundY%
}else{
MsgBox, Image not found.
}
return
Code: Select all
z::
Send {f2}
ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, druid.png
If(ErrorLevel == 0){
Click, %foundX%, %foundY%
}else{
MsgBox, Image not found.
}
return
can u give me a example on how to use itBoBo wrote:Means, you've to know the images size and do some math using its final position coordinate and the Random-command? Good luck
BoBo wrote:Here we go! This contains even two examples!
https://autohotkey.com/docs/commands/Random.htm
BTW, is it for a game?
BoBo wrote:Here we go! This contains even two examples!
https://autohotkey.com/docs/commands/Random.htm
BTW, is it for a game?
Code: Select all
imgx := 10 ; your img width is 10 px ...
imgy := 10 ; your img height is 10 px
Random, xPos,% foundx,% foundx+imgx
Random, yPos,% foundy,% foundy+imgy
BoBo wrote:Not tested.Code: Select all
imgx := 10 ; your img width is 10 px ... imgy := 10 ; your img height is 10 px Random, xPos,% foundx,% foundx+imgx Random, yPos,% foundy,% foundy+imgy
Found a Working Image Search Scripttustoneey3 wrote:i been trying to get it to click randomly inside the img instead of always the same spot
Code: Select all
z:: Send {f2} ImageSearch, foundX, foundY, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, druid.png If(ErrorLevel == 0){ Click, %foundX%, %foundY% }else{ MsgBox, Image not found. } return
Code: Select all
f::
Coordmode, mouse, Screen
ImageSearch, xp, yp, 0, 0, 793, 726, *50 f.png
If ErrorLevel=0
{
MouseMove, xp, yp, 0
send {LButton}
}
Return
Users browsing this forum: Rohwedder and 79 guests