| View previous topic :: View next topic |
| Author |
Message |
netanelbi Guest
|
Posted: Tue Mar 09, 2010 7:55 pm Post subject: click in game |
|
|
i try to make auto clicker that searchimage and click it my code for now is that:
| Code: | Loop
{
ImageSearch, FoundX, FoundY, 0,0, A_ScreenWidth, A_ScreenHeight, C:\test2.bmp
if ErrorLevel = 1
MsgBox Icon could not be found on the screen
else
click %FoundX%,%FoundY%
Sleep 10000
} |
the problem is that on desktop it works and mouse clicks where i want it
but in game its not working not click/mouseclick/mousemove/sendevent...but it does find the picture in the game. the game is Freestyle Street Basketball plz help |
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Tue Mar 09, 2010 8:20 pm Post subject: |
|
|
| Quote: | | The names of the variables in which to store the X and Y coordinates of the upper-left pixel of where the image was found on the screen (if no match is found, the variables are made blank). Coordinates are relative to the active window unless CoordMode was used to change that. |
So maybe you are clicking the 'wrong spot' of the image. Since it matches the top left most corner of the image, this exact spot may not be the active spot.
Try adding something like,
| Code: | FoundX += 20
Found& += 20
click %FoundX%,%FoundY% |
This will instead move over and down 20pix and click there. Though don't include that inside the loop or else each itteration of the loop will add 20 to X and Y thus messing up the click coords. |
|
| Back to top |
|
 |
netanelbi Guest
|
Posted: Tue Mar 09, 2010 8:32 pm Post subject: |
|
|
| not its not working at all...i tried even just to click but not working, its like the game blocks ahk keybord/mouse, i even tried keybord mouse and send {NumPad5} but no not working |
|
| Back to top |
|
 |
Carcophan
Joined: 24 Dec 2008 Posts: 1308 Location: :noitacoL
|
Posted: Tue Mar 09, 2010 8:36 pm Post subject: |
|
|
| netanelbi wrote: | | its like the game blocks ahk keybord/mouse |
It probably is.
Have you tried SendInput, SendPlay, SendRaw ? |
|
| Back to top |
|
 |
netanelbi Guest
|
Posted: Tue Mar 09, 2010 8:44 pm Post subject: |
|
|
| yes tried right now, not working,... ty for ur help |
|
| Back to top |
|
 |
Alawar
Joined: 09 Mar 2010 Posts: 7
|
Posted: Mon May 17, 2010 10:24 am Post subject: |
|
|
| Try to launch your script in "Administrator mode". |
|
| Back to top |
|
 |
|