Jump to content


Photo

Possible to loop 2 keys?


  • Please log in to reply
5 replies to this topic

#1 Theon

Theon
  • Members
  • 18 posts

Posted 16 April 2012 - 12:54 AM

Hey.

Im playing Dota and I want to make a loop like this:

~*Rbutton::
loop
{
GetKeyState, rightbuttonState, Rbutton, P
GetKeyState, ShiftbuttonState, Shift, P

if (rightbuttonState = "U")
{
break
}
else
{
if (shiftbuttonState = "U")
{
send, {Rbutton down}
send, {Rbutton up}
sleep, 1
}
else
{
send, {shift down}
send, {Rbutton down}
send, {Rbutton up}
send, {shift up}
sleep, 1
sleep, 1
}
}
}

So, I want to make it "rapidfire" R-button when helt down, and Then if I press shift while holding R-button down it executes a "shift" command.

How can this be done?

thank you.

#2 Theon

Theon
  • Members
  • 18 posts

Posted 16 April 2012 - 10:12 AM

Anyone?

#3 CodeKiller

CodeKiller
  • Members
  • 2066 posts

Posted 16 April 2012 - 10:16 AM


$RButton::

While GetKeyState("RButton", "P")

{



}



#4 CodeKiller

CodeKiller
  • Members
  • 2066 posts

Posted 16 April 2012 - 10:18 AM

Shit... I can't edit my post at work, so my previous post :

$RButton::
While GetKeyState("RButton", "P")
{
    If GetKeyState("LShift", "P")
        Msgbox Here
    Else
        Msgbox There
}


#5 Theon

Theon
  • Members
  • 18 posts

Posted 16 April 2012 - 10:23 AM

Thanks, but this doesn't work.

When I hold down Rbutton, it continously makes the action. Good.

But while holding R button and then I press shift and hold, nothing happens.

#6 CodeKiller

CodeKiller
  • Members
  • 2066 posts

Posted 16 April 2012 - 12:54 PM

$RButton::
While GetKeyState("RButton", "P")
{
    If GetKeyState("LShift", "P")
        Tooltip It's Here
    Else
        Tooltip It's There
}
Return

This is workign fine.
Press RButton, then press Shift (while holding the RButton).