AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

click in game

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
netanelbi
Guest





PostPosted: Tue Mar 09, 2010 7:55 pm    Post subject: click in game Reply with quote

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

PostPosted: Tue Mar 09, 2010 8:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
netanelbi
Guest





PostPosted: Tue Mar 09, 2010 8:32 pm    Post subject: Reply with quote

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

PostPosted: Tue Mar 09, 2010 8:36 pm    Post subject: Reply with quote

netanelbi wrote:
its like the game blocks ahk keybord/mouse


It probably is.

Have you tried SendInput, SendPlay, SendRaw ?
Back to top
View user's profile Send private message
netanelbi
Guest





PostPosted: Tue Mar 09, 2010 8:44 pm    Post subject: Reply with quote

yes tried right now, not working,... ty for ur help
Back to top
Alawar



Joined: 09 Mar 2010
Posts: 7

PostPosted: Mon May 17, 2010 10:24 am    Post subject: Reply with quote

Try to launch your script in "Administrator mode".
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group