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 

Macro

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





PostPosted: Tue Jul 01, 2008 11:50 pm    Post subject: Macro Reply with quote

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

PostPosted: Wed Jul 02, 2008 12:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Justin
Guest





PostPosted: Wed Jul 02, 2008 12:11 am    Post subject: Reply with quote

I love you.
Back to top
Justin
Guest





PostPosted: Wed Jul 02, 2008 12:36 am    Post subject: Reply with quote

How would I add a Sleep, 50 timer to that?
Back to top
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Wed Jul 02, 2008 12:39 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Justin
Guest





PostPosted: Wed Jul 02, 2008 12:41 am    Post subject: Reply with quote

God damn you guys kick ass.
Back to top
Slanter



Joined: 28 May 2008
Posts: 397
Location: Minnesota, USA

PostPosted: Wed Jul 02, 2008 12:42 am    Post subject: Reply with quote

Very Happy
Back to top
View user's profile Send private message Visit poster's website
[VxE]



Joined: 07 Oct 2006
Posts: 1496

PostPosted: Wed Jul 02, 2008 1:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Guest






PostPosted: Wed Jul 02, 2008 8:27 am    Post subject: Reply with quote

Justin wrote:
Quote:
I love you.
O...kay Shocked
Quote:
Please help me do this...
Nevertheless your subject line sucks Mad
Back to top
Justin
Guest





PostPosted: Wed Jul 02, 2008 5:54 pm    Post subject: Reply with quote

wow your cool...trolling around in forums making comments about other people's posts...
Back to top
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