AutoHotkey Community

It is currently May 27th, 2012, 10:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 9th, 2007, 4:00 am 
Offline

Joined: December 9th, 2007, 3:55 am
Posts: 16
So, I am sitting about an hour on my first AHK script. Its my very first, I do know how to write in different languages, but this drives me crazy.

My aim is to let AHK automatically press the "left" Button when the color red (0x0000CC) appears in a specific window.

This is how i thought it should work:
Code:
x::
Loop,10
{   
   PixelSearch, FoundX, FoundY, 584, 629, 586, 637, 0x0000CC, 3, Fast   
   if ErrorLevel = 0
   break
}
Send {Left}
return


So, that obv doesnt work. Even
Code:
x::
Send {Left}

Does not work. Wtf did I wrong?

Thanks for your help


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 4:35 am 
Offline

Joined: November 28th, 2007, 10:00 pm
Posts: 25
Location: USA
try it like this

Code:
x::
send, {left}


with a comma in there


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 4:55 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
nickromano wrote:
with a comma in there


Does it really make a difference? :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 4:58 am 
Offline

Joined: November 28th, 2007, 10:00 pm
Posts: 25
Location: USA
it worked for me. i don't know if it matters or not though :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 5:10 am 
Offline

Joined: July 15th, 2007, 1:43 am
Posts: 1320
For the space inbeteen the function name and first parameter it does not matter:

Code:
Send {Left}

Is the same as:

Send, {Left}

However.

MouseClick Left 200, 100

Is different then

MouseClick Left, 200, 200


In other words, only paramater must be seperated by commas.

_________________
Religion is false. >_>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 4:17 pm 
Offline

Joined: December 9th, 2007, 3:55 am
Posts: 16
Alright, i figured out, that the flash file does not recognice a short press of a button.

Code:
Send {Left down}
Sleep 100
Send {Left up}

Seems to work.

Thanks anyways for your help


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, chaosad, specter333 and 75 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group