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 

Script Help (should be simple)

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



Joined: 23 Jan 2007
Posts: 11

PostPosted: Sat May 17, 2008 6:13 pm    Post subject: Script Help (should be simple) Reply with quote

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



Joined: 09 Mar 2007
Posts: 392
Location: Unknown

PostPosted: Sat May 17, 2008 6:24 pm    Post subject: Reply with quote

Does this work?
Code:
SetBatchLines,-1
~Right::Sendinput, {F6 down}{F6 up}{NumpadEnter down}{NumpadEnter up}

_________________
Back to top
View user's profile Send private message Visit poster's website
zenuke



Joined: 23 Jan 2007
Posts: 11

PostPosted: Sat May 17, 2008 6:26 pm    Post subject: Reply with quote

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



Joined: 09 Mar 2007
Posts: 392
Location: Unknown

PostPosted: Sat May 17, 2008 6:27 pm    Post subject: Reply with quote

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



Joined: 23 Jan 2007
Posts: 11

PostPosted: Sat May 17, 2008 6:32 pm    Post subject: Reply with quote

what you posted doesn't work at all.
Back to top
View user's profile Send private message
zenuke



Joined: 23 Jan 2007
Posts: 11

PostPosted: Sat May 17, 2008 6:38 pm    Post subject: Reply with quote

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



Joined: 07 Oct 2006
Posts: 1100

PostPosted: Sat May 17, 2008 9:11 pm    Post subject: Reply with quote

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






PostPosted: Tue May 20, 2008 12:25 am    Post subject: Reply with quote

this didnt do anything either. press right causes nothing to happen.
Back to top
[VxE]



Joined: 07 Oct 2006
Posts: 1100

PostPosted: Tue May 20, 2008 12:30 am    Post subject: Reply with quote

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






PostPosted: Tue May 20, 2008 12:41 am    Post subject: Reply with quote

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

PostPosted: Tue May 20, 2008 12:47 am    Post subject: Reply with quote

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