Searching the right keys

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Gandalf_yayo
Posts: 9
Joined: 19 May 2018, 20:41

Searching the right keys

19 May 2018, 20:48

I want to turn on my autohotkey on 3 and 4, and deactivate them on different keys (1,2,4,5,f,tab,Xbutton1)


Current script:



LButton::
lbutton_count++
If (lbutton_count = 1)
{
Send {4}
Sleep, 690
Send {LButton}
}
If (lbutton_count = 2)
{
Send {3}
Sleep, 690
Send {LButton}
}
If (lbutton_count = 2)
{
lbutton_count := 0
}
return

PgDn::Suspend
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Searching the right keys

20 May 2018, 04:30

Hallo,
add:

Code: Select all

1::Suspend, On
2::Suspend, On
3::Suspend, Off
4::Suspend, Toggle
5::Suspend, On
f::Suspend, On
Tab::Suspend, On
Xbutton1::Suspend, On
Gandalf_yayo
Posts: 9
Joined: 19 May 2018, 20:41

Re: Searching the right keys

20 May 2018, 05:57

Rohwedder wrote:Hallo,
add:

Code: Select all

1::Suspend, On
2::Suspend, On
3::Suspend, Off
4::Suspend, Toggle
5::Suspend, On
f::Suspend, On
Tab::Suspend, On
Xbutton1::Suspend, On

Added this, doesn't work as i wanted it. It stops the current script, switching from 3 to 4 and backwards.

3 and 4 arn't working with the script, i cannot use weapon slot 3 or 4 with the script i'm trying to use with it, 1,2,5,f,tab,xbutton1 is working to ignore the script with adding this code ^
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: Searching the right keys

20 May 2018, 06:52

Elaborate, because what you described mismatches provided code. To me it seems like XButton1 is changing modes of something.
Use

Code: Select all

[/c] forum tag to share your code.
Click on [b]✔[/b] ([b][i]Accept this answer[/i][/b]) on top-right part of the post if it has answered your question / solved your problem.
Rohwedder
Posts: 7625
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Searching the right keys

20 May 2018, 08:34

Hallo,
My problem is, I do not know what you want.
Try with hotkey prefixes "~" and/or "$".
Tilde: ~ prefix when the hotkey fires, its key's native function will not be blocked
Dollar: $ prefix is necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself.
E.g.:

Code: Select all

~1::Suspend, On
~2::Suspend, On
~$3::Suspend, Off
~$4::Suspend, Toggle
~5::Suspend, On
~f::Suspend, On
~Tab::Suspend, On
~Xbutton1::Suspend, On
Gandalf_yayo
Posts: 9
Joined: 19 May 2018, 20:41

Re: Searching the right keys

20 May 2018, 13:05

Rohwedder wrote:Hallo,
My problem is, I do not know what you want.
Try with hotkey prefixes "~" and/or "$".
Tilde: ~ prefix when the hotkey fires, its key's native function will not be blocked
Dollar: $ prefix is necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself.
E.g.:

Code: Select all

~1::Suspend, On
~2::Suspend, On
~$3::Suspend, Off
~$4::Suspend, Toggle
~5::Suspend, On
~f::Suspend, On
~Tab::Suspend, On
~Xbutton1::Suspend, On

This is working almost perfectly, i was searching for this! except one problem occurs, when switching to weapon slot 3/4 it will switch from 3 to 4 or vice versa before it (shoots) fully works, in other words; when switched on 3 or 4, it will switch first before taking a shot.

I came to realise this is the cause of my own script, yours has been very helpfull and i will implent it in my new one, many thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750, septrinus and 250 guests