Ending a Script and showing GUI from previous script

Ask gaming related questions (AHK v1.1 and older)
jkpwk213
Posts: 7
Joined: 23 Jan 2022, 02:17

Ending a Script and showing GUI from previous script

Post by jkpwk213 » 23 Jan 2022, 15:26

Hi All,

Another newb question as I'm learning this syntax. I am looking to have some GUI that I can use to toggle on and off a separate script I want to run (a basic following script in a game).

When they hotkey the following to end, I want it to show/un-hide the GUI from the previous script (which is still running in the background) so they can potentially toggle it back on or move to another tab with other options.

I'm not entirely sure how to have a completely different script go find that hidden GUI and open it back up/show it?

GUI CODE:

Code: Select all

Gui, 1:Add, Tab2,, Welcome|Follow|Poet Shortcuts  ; Tab2 vs. Tab requires [v1.0.47.05+].
Gui, 1:Add, Picture,w80 h80, %my_picturefile%
Gui, 1:Add, Text,, Welcome to the App.
Gui, 1:Tab, 2
Gui, 1:Add, Button, w200 h50 gTest1 , Run Test1.Movement.AHK Script
Gui, 1:Tab, 3
Gui, 1:Add, Edit, vMyEdit r5  ; r5 means 5 rows tall.
Gui, 1:Tab  ; i.e. subsequently-added controls will not belong to the tab control.
Gui, 1:Add, Button, default xm, OK  ; xm puts it at the bottom left corner.
Gui, 1:Show
return


Test1:
Run Movement.ahk
Gui, 1:Hide
Return

ButtonOK:
GuiClose:
GuiEscape:
Gui, 1:Submit  ; Save each control's contents to its associated variable.
MsgBox You entered:`n%MyCheckbox%`n%MyRadio%`n%MyEdit%
ExitApp

FOLLOW SCRIPT

Code: Select all

SetTitleMatchMode, 2
WinGet, Hwnd_List, List, ahk_exe NOTEPAD.exe
Loop, Parse, % "" ;Test
	Hotkey, $%A_LoopField%, $Up
$Up::
$Left::
$Down::
$Right::
Key := "{" SubStr(A_ThisHotkey, 2) "}"
Loop, %Hwnd_List%
	ControlSend,, %Key%,% "ahk_id " Hwnd_List%A_Index%
return
^[::ExitApp 
Gui, 1:Show

User avatar
mikeyww
Posts: 26595
Joined: 09 Sep 2014, 18:38

Re: Ending a Script and showing GUI from previous script

Post by mikeyww » 23 Jan 2022, 19:38

You can combine the scripts into one. That will ease the process quite a bit!

Post Reply

Return to “Gaming Help (v1)”