Hey guys, I'm posting first time here so sorry if any mistake or broke any rule.
I'm just trying autohotkey first time. Here is my script.
PixelSearch, A, B, 0, 0, A_ScreenWidth, A_ScreenHeight, 0xFFD8FF, 3, Fast
MouseMove, A, B
Click
Nothing much.
So the script is working and click at pixel position but not on other program. I mean it is working on desktop but not clicking on Memu emulator.
Thank you.
Trying to use PixelSearch and Click Topic is solved
Re: Trying to use PixelSearch and Click
Please anyone. ![Smile :)](./images/smilies/icon_e_smile.gif)
![Smile :)](./images/smilies/icon_e_smile.gif)
Re: Trying to use PixelSearch and Click
Try:
Also make sure, that your color is in the right format - here you have to use the Blue-Green-Red (BGR) format - or use the RGB option.
The emulator might run with elevated rights - then run your script as admin... also, many games don't work in fullscreen mode with AHK . perhaps it is the same with this emulator. Try "windowed" mode instead.
Also, this might help: https://autohotkey.com/boards/viewtopic.php?t=11084
edited: The %s are not needed, it seems - these commands accept expressions, too...
Code: Select all
CoordMode, Pixel, Screen ; because you want to use the whole screen for the search
PixelSearch, A, B, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%, 0xFFD8FF, 3, Fast
CoordMode, Mouse, Screen
MouseMove, %A%, %B%
Click
The emulator might run with elevated rights - then run your script as admin... also, many games don't work in fullscreen mode with AHK . perhaps it is the same with this emulator. Try "windowed" mode instead.
Also, this might help: https://autohotkey.com/boards/viewtopic.php?t=11084
edited: The %s are not needed, it seems - these commands accept expressions, too...
Re: Trying to use PixelSearch and Click
hey m8. this didnt work. it says that mousemove needs 2 parametres
Re: Trying to use PixelSearch and Click
Well, I count two...
Re: Trying to use PixelSearch and Click
yeah me to ![Smile :)](./images/smilies/icon_e_smile.gif)
however I have a hard time managing different windows since this moves my mouse. do you know if it is possible that I can use like a Controlclick command with the pixel search. so I can stay in another window, while it does the clicking.
right now I'm using
if I change
with
it works, but I have no control of the mouse
sincerely
![Smile :)](./images/smilies/icon_e_smile.gif)
however I have a hard time managing different windows since this moves my mouse. do you know if it is possible that I can use like a Controlclick command with the pixel search. so I can stay in another window, while it does the clicking.
right now I'm using
Code: Select all
IfWinNotActive, Sketchbook, , WinActivate, Sketchbook,
!Q::reload
!s::
loop,5
{
WinGet, id, ID, Sketchbook,
PixelSearch, X, Y, 2439, 544, 370, 33, 0x18FC00, 0, fast, rgb
if ErrorLevel
MsgBox Not Found!
Else
controlClick,%x% %y%,SKetchbook,Left
}
Code: Select all
controlClick,%x% %y%,SKetchbook,Left
Code: Select all
Click,%x% %y%,SKetchbook,Left
sincerely
Re: Trying to use PixelSearch and Click
Not all programs or games work with ControlClick. That said, your syntax seems off, the parameters don't match the documentation.
You probably need smth like this:
Also the comma between fast and rgb in the Pixelsearch line seems wrong. It's the same parameter - just use a space between them.
PS: Perhaps SKetchbook doesn't hurt in Click,%x% %y%,SKetchbook,Left (and just gets ignored because it doesn't contain letters which match a Click option), but Click doesn't have a WinTitle parameter... it's definitely safer to remove it.
You probably need smth like this:
Code: Select all
ControlClick, x%x% y%y%, SKetchbook, , Left ; or leave the button out since Left is the default anyway
PS: Perhaps SKetchbook doesn't hurt in Click,%x% %y%,SKetchbook,Left (and just gets ignored because it doesn't contain letters which match a Click option), but Click doesn't have a WinTitle parameter... it's definitely safer to remove it.
Re: Trying to use PixelSearch and Click
i've also tried using ControlClick, x%x% y%y% it didnt work.
I was not aware that there is certain windows that cannot be supported by ControlClick. perhaps that is all there is to it. Autoit doesn't seem to support it either. since the windows has no Control ID. how sad
I was not aware that there is certain windows that cannot be supported by ControlClick. perhaps that is all there is to it. Autoit doesn't seem to support it either. since the windows has no Control ID. how sad
Who is online
Users browsing this forum: mexican scientist and 75 guests