| View previous topic :: View next topic |
| Author |
Message |
Savaron
Joined: 09 Dec 2007 Posts: 16
|
Posted: Sun Dec 09, 2007 3:00 am Post subject: How to let AHK press the left button?? |
|
|
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
Does not work. Wtf did I wrong?
Thanks for your help |
|
| Back to top |
|
 |
nickromano
Joined: 28 Nov 2007 Posts: 25 Location: USA
|
Posted: Sun Dec 09, 2007 3:35 am Post subject: |
|
|
try it like this
with a comma in there |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6264
|
Posted: Sun Dec 09, 2007 3:55 am Post subject: |
|
|
| nickromano wrote: | | with a comma in there |
Does it really make a difference?  |
|
| Back to top |
|
 |
nickromano
Joined: 28 Nov 2007 Posts: 25 Location: USA
|
Posted: Sun Dec 09, 2007 3:58 am Post subject: |
|
|
it worked for me. i don't know if it matters or not though  |
|
| Back to top |
|
 |
Trikster
Joined: 15 Jul 2007 Posts: 1224 Location: Enterprise, Alabama
|
Posted: Sun Dec 09, 2007 4:10 am Post subject: |
|
|
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 |
|
 |
Savaron
Joined: 09 Dec 2007 Posts: 16
|
Posted: Sun Dec 09, 2007 3:17 pm Post subject: |
|
|
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 |
|
 |
|