 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
newpie
Joined: 16 Nov 2007 Posts: 135
|
Posted: Mon Nov 19, 2007 2:22 am Post subject: |
|
|
Hello, here is my first one, this is for the display setting #1.
| Code: |
f1::
ImageSearch,,, 0, 0, 1279, 799, C:\test.bmp
if ErrorLevel = 2
Send, !o
else if ErrorLevel = 1
send, !o
else
Send, {ALTDOWN}g{ALTUP}{TAB}{SPACE}{DOWN}{SPACE}!o
return
|
I would use the same code above, but different bmp file as follows for the second display setting.
| Code: |
ImageSearch,,, 0, 0, 1279, 799, C:\test2.bmp
if ErrorLevel = 2
Send, !o
else if ErrorLevel = 1
send, !o
else
Send, {ALTDOWN}g{ALTUP}{TAB}{SPACE}{DOWN}{SPACE}!o
return
|
Hope this helps a tad. |
|
| Back to top |
|
 |
newpie
Joined: 16 Nov 2007 Posts: 135
|
Posted: Mon Nov 19, 2007 2:49 am Post subject: |
|
|
I forgot to mention that I am running script on JAVA that I have to mouseclick the coordinates so this is another reason why I created two different scripts for different screen displays.
An example:
| Code: |
f1::
Send, {ENTER}{TAB 11}{RIGHT 6}^c
sleep, 2000
MouseClick, left, 1200, 455
return
|
Thanks |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Mon Nov 19, 2007 4:31 pm Post subject: |
|
|
| Code: |
F1::
If A_ScreenWidth = 1600
Image = C:\test.bmp
else If A_ScreenWidth = 1680
Image = C:\test2.bmp
else
{
Msgbox bad resolution
Return
}
ImageSearch,,, 0, 0, 1279, 799, %Image%
if ErrorLevel
Send, !o
else
Send, !g{TAB} {DOWN} !o
return
|
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
newpie
Joined: 16 Nov 2007 Posts: 135
|
Posted: Tue Nov 20, 2007 3:01 am Post subject: |
|
|
| Thanks engunneer, that is very thoughtful script that is very efficient. I hope you have a good day. |
|
| Back to top |
|
 |
newpie
Joined: 16 Nov 2007 Posts: 135
|
Posted: Tue Nov 20, 2007 3:59 am Post subject: |
|
|
Engunneer, can I do the same thing wih coordinates, I tried a couple of times, but keep getting it wrong. Here is what I have so far:
| Code: |
If A_ScreenWidth = 1600
Coord = 400, 500
else If A_ScreenWidth = 1680
Coord = 500, 500
else
{
Msgbox bad resolution,please choose 1600x900 or 1680x450
Return
}
run, notepad
sleep, 500
MouseClick,left, %Coord%
send, Hello
return
|
|
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6847 Location: Pacific Northwest, US
|
Posted: Tue Nov 20, 2007 5:23 am Post subject: |
|
|
use two seperate variables for x and y coords. you can't combine them so easily. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
newpie
Joined: 16 Nov 2007 Posts: 135
|
Posted: Tue Nov 20, 2007 11:43 pm Post subject: |
|
|
| Modified script, works wonderfully. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|