| View previous topic :: View next topic |
| Author |
Message |
zenuke
Joined: 23 Jan 2007 Posts: 11
|
Posted: Sat May 17, 2008 6:13 pm Post subject: Script Help (should be simple) |
|
|
I have this script.
~Right::Send {F6 down}{F6 up}{NumpadEnter down}{NumpadEnter up}
Which I am using in a game to do some stuff with one button. It seems really slow to do what it should and sometimes doesn't work at all.
I don't write a lot script to I suspect its something very simple.
The script should be when I press the right arrow down It seens to simulate hitting F6 and then KP_Enter.
What did I do wrong? |
|
| Back to top |
|
 |
System Monitor
Joined: 09 Mar 2007 Posts: 392 Location: Unknown
|
Posted: Sat May 17, 2008 6:24 pm Post subject: |
|
|
Does this work?
| Code: | SetBatchLines,-1
~Right::Sendinput, {F6 down}{F6 up}{NumpadEnter down}{NumpadEnter up} |
_________________
 |
|
| Back to top |
|
 |
zenuke
Joined: 23 Jan 2007 Posts: 11
|
Posted: Sat May 17, 2008 6:26 pm Post subject: |
|
|
do you thing it matters what way I do the up/down?? or is that even nessesary?
can you explain the batchlines for my future knowledge |
|
| Back to top |
|
 |
System Monitor
Joined: 09 Mar 2007 Posts: 392 Location: Unknown
|
Posted: Sat May 17, 2008 6:27 pm Post subject: |
|
|
| zenuke wrote: | do you thing it matters what way I do the up/down?? or is that even nessesary?
can you explain the batchlines for my future knowledge |
I don't understand what you are trying to say . . . sorry. _________________
 |
|
| Back to top |
|
 |
zenuke
Joined: 23 Jan 2007 Posts: 11
|
Posted: Sat May 17, 2008 6:32 pm Post subject: |
|
|
| what you posted doesn't work at all. |
|
| Back to top |
|
 |
zenuke
Joined: 23 Jan 2007 Posts: 11
|
Posted: Sat May 17, 2008 6:38 pm Post subject: |
|
|
playing around here, it just seem to not work quickly sometimes.
Sometimes it only does one of the actions and other times will do the whole routine.
Seems if I pressing any other key or using a mouse button, there is a great chance of it not working. |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1100
|
Posted: Sat May 17, 2008 9:11 pm Post subject: |
|
|
| Code: | SetKeyDelay, 50, 50, play
$~*Right::SendPlay, {blind}{F6}{NumpadEnter} |
see if that does anything. _________________ My Home Thread
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 20, 2008 12:25 am Post subject: |
|
|
| this didnt do anything either. press right causes nothing to happen. |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1100
|
Posted: Tue May 20, 2008 12:30 am Post subject: |
|
|
Then probably another program is registering the right arrow key as a hotkey using a keyboard hook.
You can try to usurp that hook by running the script after the game loads. _________________ My Home Thread
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 20, 2008 12:41 am Post subject: |
|
|
tried that also, my other script has no issue, I am posting in so you have a reference. I also checked the game config file and the right arrow is not bound at all and does nothing in the game.
~MButton up:: ;use MButton "up" so it doesn't get triggered when you hold ctrl
Goto, Crouch
Crouch:
; Changed: Trigger was changed to "~MButton" as ~ allows normal operation of key.
If (a_tickCount-lasttime < 400) ;Check when we released ctrl the last time if < 400ms initiate Crouch
{
Loop
{
Send, {MButton down} ; Initiate 'Crouch'
If IsKeyPressed("MButton") ; Check if 'MButton' pressed. If pressed & released, Break loop.
Send, {MButton up} ; Release 'Crouch'
Break
}
}
lasttime:=a_tickCount
Return
IsKeyPressed(v_KeyName)
; Returns 1 if %v_KeyName% is currently being pressed, otherwise 0
{
GetKeyState, state, %v_KeyName%, P
If state = D ; The key has been pressed
{
Return 1
}
Return 0
}
This one does a hold middle button down when I double click it. |
|
| Back to top |
|
 |
Fry
Joined: 01 Nov 2007 Posts: 603
|
Posted: Tue May 20, 2008 12:47 am Post subject: |
|
|
Make sure to Num Lock OFF
| Code: | SetBatchLines,-1
SendMode,Input
~Right::Sendinput, {F6}{NumpadEnter} |
_________________ check out my site
www.eliteknifesquad.com |
|
| Back to top |
|
 |
|