Combine two scripts into one Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Nantu
Posts: 22
Joined: 30 Jun 2017, 11:15

Combine two scripts into one

03 Jul 2017, 12:01

these ar the two scripts i want to combine:

Code: Select all

#MaxThreadsPerHotkey 2
a::  ; a
if KeepWinZRunning ;
{
    KeepWinZRunning := false  ;
    return  ;
}
; Otherwise:
KeepWinZRunning := true
Loop
{
send {g down}
sleep 50
send {g up}




    if not KeepWinZRunning  ;
        break  ;
}
KeepWinZRunning := false  ;

return
AND :

Code: Select all

$p::
 {
   toggle:=!toggle
   if (toggle)
    {
	  sendinput, {3 down}
    }
   else
    {
	  sendinput, {3 up}
    }
 }
return
Such that when i keep "p" pressed it executes the 2nd script and on realease it executes the first script.
Can it be done ?
btw im playing Gigantic
User avatar
YoucefHam
Posts: 372
Joined: 24 Aug 2015, 12:56
Location: Algeria
Contact:

Re: Combine two scripts into one  Topic is solved

06 Jul 2017, 20:12

Code: Select all

#MaxThreadsPerHotkey 2

$p::
toggle:=!toggle
if (toggle)
	sendinput, {3 down}
else
	sendinput, {3 up}

KeyWait, P, U      ;Stop Here until P is Up

if KeepWinZRunning
{
    KeepWinZRunning := false
    return
}
KeepWinZRunning := true
Loop
{
	send {g down}
	sleep 50
	send {g up}
	if !KeepWinZRunning
		break
}
KeepWinZRunning := false
return
:wave: There is always more than one way to solve a problem. ;)
Nantu
Posts: 22
Joined: 30 Jun 2017, 11:15

Re: Combine two scripts into one

09 Jul 2017, 00:29

thank you friend

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: mikeyww and 72 guests