Help ME AHK

Ask gaming related questions (AHK v1.1 and older)
sondos
Posts: 8
Joined: 26 Jan 2018, 11:10

Help ME AHK

14 Feb 2018, 23:58

hello guys
i want make when i press XButton2 automaticly shoot with LButton How!! i mean To Call LButton

Code: Select all

#NoEnv
SendMode Input

_auto := true

~LButton::autofire()
+LButton::_auto := ! _auto
F1::ExitApp

autofire()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("LButton", "P")
{
Sleep 350
mouseXY(0, 22)
Sleep 0
}
else
break
} ;; loop
} ;; if
} ;; autofire()

mouseXY(x,y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
} 
just all i need when i press XButton2 the script Starting shooting
[oh if i change LButton To XButton2 the Script will not shooting in game because the shooting in game used LButton only and i need to Xbutton2 to call LButton to shooting]

[moved to Gaming-section] BoBo
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Help ME AHK

15 Feb 2018, 01:15

Hi.
You're in wrong section. Main section "Ask for Help" is ok, but this section has a subdivision for Games. And your issue is 100% Gaming.

Now your issue: Remapping is what you need.
Remap LButton to X2Button is not a big thing. Look inside help-file for more information.

Code: Select all

XButton2::LButton
Put this piece of code in top section of your script. Above or underneath where you have declared your LButton.
Einfach nur ein toller Typ. :mrgreen:
sondos
Posts: 8
Joined: 26 Jan 2018, 11:10

Re: Help ME AHK

15 Feb 2018, 02:56

divanebaba wrote:Hi.
You're in wrong section. Main section "Ask for Help" is ok, but this section has a subdivision for Games. And your issue is 100% Gaming.

Now your issue: Remapping is what you need.
Remap LButton to X2Button is not a big thing. Look inside help-file for more information.

Code: Select all

XButton2::LButton
Put this piece of code in top section of your script. Above or underneath where you have declared your LButton.
i trying to put it in up script but not make any effect not working XButton2 WhY?

Code: Select all

XButton2::LButton
#NoEnv
SendMode Input

_auto := true


~LButton::autofire()
+LButton::_auto := ! _auto
F1::ExitApp

autofire()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("LButton", "P")
{
Sleep 350
mouseXY(0, 22)
Sleep 0
}
else
break
} ;; loop
} ;; if
} ;; autofire()

mouseXY(x,y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
} 
help please
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Help ME AHK

15 Feb 2018, 03:18

Hi.
Replace following:

Code: Select all

if GetKeyState("LButton", "P") ; <--- replace this line with line underneath
if GetKeyState("LButton", "P") || GetKeyState("XButton2", "P")
Einfach nur ein toller Typ. :mrgreen:
sondos
Posts: 8
Joined: 26 Jan 2018, 11:10

Re: Help ME AHK

15 Feb 2018, 06:16

divanebaba wrote:Hi.
Replace following:

Code: Select all

if GetKeyState("LButton", "P") ; <--- replace this line with line underneath
if GetKeyState("LButton", "P") || GetKeyState("XButton2", "P")
i make your step and only the LButton working [XButton2 not working]

Code: Select all

#NoEnv
SendMode Input

_auto := true


~LButton::autofire()
+LButton::_auto := ! _auto
XButton2::LButton
F1::ExitApp

autofire()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("LButton", "P")
if GetKeyState("LButton", "P") || GetKeyState("XButton2", "P")
{
Sleep 350
mouseXY(0, 22)
Sleep 0
}
else
break
} ;; loop
} ;; if
} ;; autofire()

mouseXY(x,y)
{
DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
} 
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Help ME AHK

15 Feb 2018, 07:03

My second suggestíon requires my first suggestion.
This means, put both suggestions inside. :D :D
Einfach nur ein toller Typ. :mrgreen:
sondos
Posts: 8
Joined: 26 Jan 2018, 11:10

Re: Help ME AHK

18 Feb 2018, 01:00

i wanna help not sugg :'(
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Help ME AHK

18 Feb 2018, 12:25

Here. Help instead of suggestion. :mrgreen: :mrgreen:

Code: Select all

#NoEnv
SendMode Input

_auto := true

~XButton2::autofire()
~LButton::autofire()
+LButton::_auto := ! _auto
F1::ExitApp

autofire()
{
	global _auto
	if _auto
	{
		Loop
		{
			if GetKeyState("LButton", "P") || GetKeyState("XButton2", "P")
			{
				Sleep 350
				mouseXY(0, 22)
				Sleep 0
			}
			else
			break
		} ;; loop
	} ;; if
} ;; autofire()

mouseXY(x,y)
{
	DllCall("mouse_event",uint,1,int,x,int,y,uint,0,int,0)
}
This should do the job. :D :D
Einfach nur ein toller Typ. :mrgreen:

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 36 guests