Page 1 of 1

Searching the right keys

Posted: 19 May 2018, 20:48
by Gandalf_yayo
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

Re: Searching the right keys

Posted: 20 May 2018, 04:30
by Rohwedder
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

Re: Searching the right keys

Posted: 20 May 2018, 05:57
by Gandalf_yayo
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 ^

Re: Searching the right keys

Posted: 20 May 2018, 06:52
by SirRFI
Elaborate, because what you described mismatches provided code. To me it seems like XButton1 is changing modes of something.

Re: Searching the right keys

Posted: 20 May 2018, 08:34
by Rohwedder
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

Re: Searching the right keys

Posted: 20 May 2018, 13:05
by Gandalf_yayo
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!