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 

How to let AHK press the left button??

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Savaron



Joined: 09 Dec 2007
Posts: 16

PostPosted: Sun Dec 09, 2007 3:00 am    Post subject: How to let AHK press the left button?? Reply with quote

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
Back to top
View user's profile Send private message
nickromano



Joined: 28 Nov 2007
Posts: 25
Location: USA

PostPosted: Sun Dec 09, 2007 3:35 am    Post subject: Reply with quote

try it like this

Code:
x::
send, {left}


with a comma in there
Back to top
View user's profile Send private message Visit poster's website AIM Address
SKAN



Joined: 26 Dec 2005
Posts: 6264

PostPosted: Sun Dec 09, 2007 3:55 am    Post subject: Reply with quote

nickromano wrote:
with a comma in there


Does it really make a difference? Rolling Eyes
Back to top
View user's profile Send private message
nickromano



Joined: 28 Nov 2007
Posts: 25
Location: USA

PostPosted: Sun Dec 09, 2007 3:58 am    Post subject: Reply with quote

it worked for me. i don't know if it matters or not though Confused
Back to top
View user's profile Send private message Visit poster's website AIM Address
Trikster



Joined: 15 Jul 2007
Posts: 1224
Location: Enterprise, Alabama

PostPosted: Sun Dec 09, 2007 4:10 am    Post subject: Reply with quote

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.
_________________
ScriptPad | ~dieom | dieom | izwian2k7 | Ian | God
Back to top
View user's profile Send private message
Savaron



Joined: 09 Dec 2007
Posts: 16

PostPosted: Sun Dec 09, 2007 3:17 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   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