Can someone convert a gpc script to ahk

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Jackoff
Posts: 3
Joined: 17 Nov 2020, 06:15

Can someone convert a gpc script to ahk

17 Nov 2020, 06:39

Code: Select all

int loop = FALSE;

main {
    if (event_press(9))
        loop = !loop;
    if (loop)
    	set_val(LMB, 100);
    if (loop && !combo_running(ComboLoop))
        combo_run(ComboLoop);
}

combo ComboLoop {
	set_val(LMB, 100);
	wait(100);
	set_val(RMB, 100);
    wait(50);
    set_val(RMB, 0);
    wait(1450);
    set_val(RMB, 0);
    set_val(LMB, 0);
}
[Mod edit: Link replaced by txt file content.]

I don't understand how to convert it this was a .gpc file i put it into .txt please help its very small shouldn't take long
User avatar
boiler
Posts: 17043
Joined: 21 Dec 2014, 02:44

Re: Can someone convert a gpc script to ahk

17 Nov 2020, 08:19

I'm really confident, but it seems like this would operate the same based on my quick look at GPC. I'm not sure if I interpreted everything correctly. Is it correct that event_press(9) means to move the right controller stick in the x direction (either + or -)?

Code: Select all

loopFlag := False
SetTimer, CheckRX, 50
loop
{
	if loopFlag
	{
		Click left down
		Sleep, 100
		Click right down
		Sleep, 50
		Click right up
		Sleep, 1450
		Click right up
		Click left up
	}
}
return

CheckRX:
	RX := GetKeyState("JoyU") ; right stick
	if (Rx < 40 || Rx > 60) ; moved in +X or -X direction
	{
		loop ; wait until stick returns to neutral position
		{
			RX := GetKeyState("JoyU")
			Sleep, 20
		} until (RX > 40 && RX < 60)
		loopFlag := !loopFlag
		Click left down
	}
return
Jackoff
Posts: 3
Joined: 17 Nov 2020, 06:15

Re: Can someone convert a gpc script to ahk

17 Nov 2020, 08:54

@boiler no the nine to activate it i will post with original script text as i edited the first 1...
the PS4_LEFT would be to activate it i guess as in Left on the DPAD. I just want this converted into PC format instead of PS4 and if that makes sense.

Code: Select all

int loop = FALSE;

main {
    if (event_press(PS4_LEFT))
        loop = !loop;
    if (loop)
    	set_val(PS4_L2, 100);
    if (loop && !combo_running(ComboLoop))
        combo_run(ComboLoop);
}

combo ComboLoop {
	set_val(PS4_L2, 100);
	wait(100);
	set_val(PS4_R2, 100);
    wait(50);
    set_val(PS4_R2, 0);
    wait(1450);
    set_val(PS4_R2, 0);
    set_val(PS4_L2, 0);
}
User avatar
boiler
Posts: 17043
Joined: 21 Dec 2014, 02:44

Re: Can someone convert a gpc script to ahk

17 Nov 2020, 09:32

Oh, then I made a bad assumption that LMB and RMB meant left and right mouse button. Sorry about that. And I think that unfortunately means that native AHK isn’t going to help because it can’t set values for controller buttons. If set_val(PS4_L2, 100) means that you want the AHK script to simulate pressing a button on the controller, it can’t do that. Maybe someone has an AHK library for doing so, but I’m not aware of it.
Jackoff
Posts: 3
Joined: 17 Nov 2020, 06:15

Re: Can someone convert a gpc script to ahk

17 Nov 2020, 22:20

@boiler okay thanks for letting me know

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 387 guests