 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
sijek
Joined: 09 Jan 2010 Posts: 11
|
Posted: Sat Jan 09, 2010 10:44 am Post subject: script for a game |
|
|
hey!
i wanna make an ahk script for a game..
the script will be activated if scroll lock is down.
and Lbutton is autofire and antirecoil. Right mouse is shoot and Crouching.
i made it so, but don't know the next step:
| Code: | gActivateScript = 0
~ScrollLock::
KeyWait, ScrollLock
GetKeyState, ScrollLockState, ScrollLock, T
If ScrollLockState = D
{
gActivateScript = 1
}
else
{
gActivateScript = 0
}
return
~LButton::
if gActivateScript = 1
{
Loop {
MouseClick, left,,, 1, D
Sleep, 5
MouseClick, left,,, 1, U
DllCall("mouse_event", uint, 1, int, -1, int, 1, uint, 0, int, 0)
GetKeyState, LButtonState, LButton, P
If LButtonState = U
break
Sleep, 5
}
}
return
~RButton::
if gActivateScript = 1
{
Loop {
MouseClick, Right,,, 2, D
Sleep, 4
MouseClick, Right,,, 0, U
GetKeyState, RButtonState, RButton, P
If RButtonState = U
break
Sleep, 4
}
}
return |
pls help me.
Thanx. |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
Posted: Sat Jan 09, 2010 6:07 pm Post subject: |
|
|
Hello Sijek, it appears you copy 'n pasted this. no?
To make the script work, press scrolllock, it should be autofire and antirecoil. If not, try my code and do the same.
| Code: | #Persistent
gActivateScript = 0
return
~ScrollLock::
KeyWait, ScrollLock
GetKeyState, ScrollLockState, ScrollLock, T
If ScrollLockState = D
{
gActivateScript = 1
}
else
{
gActivateScript = 0
}
return
~LButton::
if gActivateScript = 1
{
Loop {
MouseClick, left,,, 1, D
Sleep, 5
MouseClick, left,,, 1, U
DllCall("mouse_event", uint, 1, int, -1, int, 1, uint, 0, int, 0)
GetKeyState, LButtonState, LButton, P
If LButtonState = U
break
Sleep, 5
}
}
return
~RButton::
if gActivateScript = 1
{
Loop {
MouseClick, Right,,, 2, D
Sleep, 4
MouseClick, Right,,, 0, U
GetKeyState, RButtonState, RButton, P
If RButtonState = U
break
Sleep, 4
}
}
return |
|
|
| Back to top |
|
 |
sijek
Joined: 09 Jan 2010 Posts: 11
|
Posted: Sat Jan 09, 2010 7:21 pm Post subject: right mouse |
|
|
hey Fry!
my autofire and antirecoil script worked well.
i just wanna make it so the right mouse is shoot and crouching without clicking.
ty Fry! |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 885
|
Posted: Sun Jan 10, 2010 11:14 pm Post subject: |
|
|
If your crouch button is control, add a sleep 4 and sendinput {lcontrol}.
| Code: |
sleep4
sendinput {lcontrol}
|
|
|
| Back to top |
|
 |
Slavka850 Guest
|
Posted: Tue May 17, 2011 11:48 am Post subject: key remapping |
|
|
how can i realise this idea:
| Code: | If ScrollLockState = D
{
Numpad0::RControl
}
else
{
RControl::RControl
} |
?
and one more question:
this script needed in
| Code: | ~ScrollLock::
KeyWait, ScrollLock
GetKeyState, ScrollLockState, ScrollLock, T |
construction?
thx. |
|
| 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
|