 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Chrisa Guest
|
Posted: Mon Mar 01, 2010 2:33 am Post subject: Is it possible to group several clicks with a variable? |
|
|
I am very new to this, so this may be obvious, but is it possible to define several clicks with a variable and then just refer to the variable? I will be reusing a few click sets several times and for clarity I would like to use a variable (or something) rather then repeating the code. Example:
Option1 =
Click 754, 239, D
Sleep, 100
Click 754, 239, U
Sleep, 100
Click 756, 236, D
Sleep, 100
Click 756, 236, U
Sleep, 100
Click 331, 237, D
Sleep, 100
Click 331, 237, U
Sleep, 100
If someone could point me in the right direction that would be wonderful. Thanks for your help! |
|
| Back to top |
|
 |
Guest
|
Posted: Mon Mar 01, 2010 2:39 am Post subject: |
|
|
| u can define a label for them and call them by using GoSub |
|
| Back to top |
|
 |
jl34567
Joined: 03 Jan 2010 Posts: 262
|
Posted: Mon Mar 01, 2010 2:55 am Post subject: |
|
|
GooSub would look like this
| Code: |
if sky=blue
GoSub, Option1
else
if sky=gray
GoSub, Option2
Return
Option1:
Click 754, 239, D
Sleep, 100
Click 754, 239, U
Sleep, 100
Click 756, 236, D
Sleep, 100
Click 756, 236, U
Sleep, 100
Click 331, 237, D
Sleep, 100
Click 331, 237, U
Sleep, 100
Return
Option2:
Some other crap here
Return
|
|
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
|
| Back to top |
|
 |
poo_noo
Joined: 08 Dec 2006 Posts: 248 Location: Sydney Australia
|
Posted: Mon Mar 01, 2010 2:57 am Post subject: |
|
|
You could also put your click sets under particular keys. EG see below for F10 & F11 keys
| Code: | F10::
Msgbox About to send clickset 1
Click 754, 239, D
Sleep, 100
Click 754, 239, U
Sleep, 100
Click 756, 236, D
Sleep, 100
Click 756, 236, U
Sleep, 100
Click 331, 237, D
Sleep, 100
Click 331, 237, U
Sleep, 100
Return
F11::
Msgbox About to send clickset 2
Click 754, 239, D
Sleep, 100
Click 754, 239, U
Sleep, 100
Click 756, 236, D
Sleep, 100
Click 756, 236, U
Sleep, 100
Click 331, 237, D
Sleep, 100
Click 331, 237, U
Sleep, 100
Return |
_________________ Paul O |
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Mon Mar 01, 2010 4:53 am Post subject: |
|
|
You could put those coordinates in a variable
with a delimiter and the use a Parsing Loop. _________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| 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
|