| View previous topic :: View next topic |
| Author |
Message |
Justin Guest
|
Posted: Tue Jul 01, 2008 11:50 pm Post subject: Macro |
|
|
Hello everyone,
I'm a novice with AutoHotkey and I have a goal that I'd like to achieve, please help!
What I need is my mouse4 (XButton1) while held down to send a stream of 0's...I've got this, it's quite simple. What I can't get done is I want that stream to change to 9's while the F key is held down.
So what I'd like is:
Mouse4=0000000...Push and hold F while holding mouse4=9999999...
and finally if I release F it would revert to 0's
I'm using this to get the 0's right now:
XButton1::
Loop
if GetKeyState("XButton1", "P")
Send 0
return
[Title edited. Please write descriptive titles for your topics. ~jaco0646] |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1249 Location: USA
|
Posted: Wed Jul 02, 2008 12:07 am Post subject: |
|
|
| Code: | XButton1::
Hotkey, f, On
Loop
if GetKeyState("XButton1", "P")
Send % GetKeyState("f","P") ? 9 : 0
else{
Hotkey, f, Off
break
}
return
f::return
|
_________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
Justin Guest
|
Posted: Wed Jul 02, 2008 12:11 am Post subject: |
|
|
| I love you. |
|
| Back to top |
|
 |
Justin Guest
|
Posted: Wed Jul 02, 2008 12:36 am Post subject: |
|
|
| How would I add a Sleep, 50 timer to that? |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Wed Jul 02, 2008 12:39 am Post subject: |
|
|
| Code: | XButton1::
Hotkey, f, On
Loop
{
if GetKeyState("XButton1", "P")
Send % GetKeyState("f","P") ? 9 : 0
else{
Hotkey, f, Off
break
}
sleep, 50
}
return
f::return |
|
|
| Back to top |
|
 |
Justin Guest
|
Posted: Wed Jul 02, 2008 12:41 am Post subject: |
|
|
| God damn you guys kick ass. |
|
| Back to top |
|
 |
Slanter
Joined: 28 May 2008 Posts: 397 Location: Minnesota, USA
|
Posted: Wed Jul 02, 2008 12:42 am Post subject: |
|
|
 |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1496
|
Posted: Wed Jul 02, 2008 1:29 am Post subject: |
|
|
| Code: | *XButton1::
If GetKeyState("XButton1", "P")
{
Hotkey, $*f, DoNothing, on
SetTimer, *XButton1, -50
Send % "{blind}" (GetKeyState("f", "P") ? 9 : 0)
}
else
Hotkey, $*f, DoNothing, off
DoNothing:
return | The short version... _________________ My Home Thread
More Common Answers: [1]. It's in the FAQ [2]. Ternary ( a ? b : c ) guide [3]. Post code inside [code][/code] tags ! |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Jul 02, 2008 8:27 am Post subject: |
|
|
Justin wrote:O...kay  | Quote: | | Please help me do this... | Nevertheless your subject line sucks  |
|
| Back to top |
|
 |
Justin Guest
|
Posted: Wed Jul 02, 2008 5:54 pm Post subject: |
|
|
| wow your cool...trolling around in forums making comments about other people's posts... |
|
| Back to top |
|
 |
|