 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
alienwear Guest
|
Posted: Sun Jul 06, 2008 9:28 pm Post subject: Script for CS:S |
|
|
| I want a script that when i push (and hold) "g" it will press 4 then hold MOUSE 1 until g is released at which point MOUSE 1 will also be released. I don't have a clue where to start and would like help! |
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 235 Location: Canada
|
Posted: Sun Jul 06, 2008 11:26 pm Post subject: |
|
|
something like this might work....
Loop,
GetKeyState, g, g
if g = D
{
Sleep, 1000
GetKeyState, g, g
if g = D
{
Send, 4
LButton = D
GetKeyState, g, g
if g = D
{
Continue
}
Else
Break,
}
} _________________ http://www.spider-games77.piczo.com
Join the Elite few...
  |
|
| Back to top |
|
 |
alienwear Guest
|
Posted: Mon Jul 07, 2008 10:00 am Post subject: |
|
|
| When I run the script it states that the continue must be enclosed by a loop. Could you help? |
|
| Back to top |
|
 |
engunneer
Joined: 30 Aug 2005 Posts: 6772 Location: Pacific Northwest, US
|
Posted: Mon Jul 07, 2008 9:45 pm Post subject: |
|
|
| Code: |
Loop,
{
GetKeyState, g, g
if g = D
{
Sleep, 1000
GetKeyState, g, g
if g = D
{
Send, 4
LButton = D
GetKeyState, g, g
if g = D
{
Continue
}
Else
Break,
}
}
}
|
I cannot support this code, just fixing syntax. _________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM |
|
| Back to top |
|
 |
300W
Joined: 12 Jan 2008 Posts: 24
|
Posted: Tue Jul 08, 2008 2:11 am Post subject: |
|
|
I'm just writing this from the top of my head, cba to check the manual atm...
| Code: |
g::
Send, 4
Click, d
Keywait, g
Click, u
Return
|
You will prolly like my version more than the other loop/sleep based one... |
|
| Back to top |
|
 |
alienwear Guest
|
Posted: Wed Jul 09, 2008 8:55 am Post subject: |
|
|
| Thanks everyone - both scripts work really well. |
|
| 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
|