Help with my gui

Get help with using AutoHotkey and its commands and hotkeys
CorruptingNostalgia
Posts: 10
Joined: 17 Apr 2020, 08:44

Help with my gui

08 Sep 2020, 03:19

Code: Select all

#Persistent
Gui, Add, Text, ,F1 to Pause/Unpause and F3 to Exit this script. Made by Me
Gui, Add, Button, gA1, Ok
Gui, Show, Center, Instructions
Return
A1:
Gui, Destroy
;Return
Gui, Show , w200 h100, Hold To Click Application
gui, add, text, section, Start/Pause Hotkey:
Gui, Add, Hotkey, vChosenHotkey
gui, add, text, section, Intervals:
Gui, Add, Edit, VInterval vMyEdit w100 number, Milliseconds
return


F1::
Toggle:=!Toggle
Hotkey, LButton, LBDown, % Toggle ? "On":"Off"
ToolTip, % Toggle ? "AutoClick: ON" : "AutoClick: OFF"
SetTimer, ToolTipOff, -1000
Return

ToolTipOff:
ToolTip
Return

LBDown:
while (GetKeyState("Lbutton", "P"))
{
	Send {Click}
	Sleep, 1000
}

Return

[u]F3::
Gui, Add, Text, ,Are you sure you want to exit this application?
Gui, Add, Button, g1, Continue
Gui, Show, Center, Msgbox
Return

1:
button := A_ThisLabel
if (button := Continue)
Gui, Destroy
TrayTip , Title, Text, 10
ExitApp
return[/u]
I Have several questions.

1) Is there a way to shorten the highlighted scripted
2) Why is my third gui not showing up (the one where i press F3 to exit
3) How do you set the hotkey and sleep as a variable so that whenever i change the Millisecond edit gui it applies the changes instantly to the variable and whenever i change the hot key on the gui it automatically changes.

thanks in advance
Last edited by BoBo on 08 Sep 2020, 03:26, edited 1 time in total.
Reason: Added [code][/code]-tags.
RubbeH
Posts: 44
Joined: 13 Jul 2020, 08:40

Re: Help with my gui

08 Sep 2020, 04:29

Code: Select all

F3::
Gui, Destroy
Gui, Add, Text, ,Are you sure you want to exit this application?
Gui, Add, Button, g1, Continue
Gui, Show,
Return
I'm not really knowledgeable in ahk gui handling but I'd guess you need to destroy the gui before buliding a new one.
User avatar
Yakshongas
Posts: 591
Joined: 21 Jan 2020, 08:41
Facebook: Yakshongas

Re: Help with my gui

08 Sep 2020, 07:54

First I'll recommend that you name your gui's, also the problem can be solved just adding Gui, New.

Code: Select all

#Persistent
Gui, Add, Text, ,F1 to Pause/Unpause and F3 to Exit this script. Made by Me
Gui, Add, Button, gA1, Ok
Gui, Show, Center, Instructions
Return
A1:
Gui, Destroy
Gui, Show , w200 h100, Hold To Click Application
gui, add, text, section, Start/Pause Hotkey:
Gui, Add, Hotkey, vChosenHotkey
gui, add, text, section, Intervals:
Gui, Add, Edit, VInterval vMyEdit w100 number, Milliseconds
return


F1::
Toggle:=!Toggle
Hotkey, LButton, LBDown, % Toggle ? "On":"Off"
ToolTip, % Toggle ? "AutoClick: ON" : "AutoClick: OFF"
SetTimer, ToolTipOff, -1000
Return

ToolTipOff:
ToolTip
Return

LBDown:
while (GetKeyState("Lbutton", "P"))
{
	Send {Click}
	Sleep, 1000
}
Return

F3::
Gui, New
Gui, Add, Text,,Are you sure you want to exit this application?
Gui, Add, Button, g1, Continue
Gui, Show, Center, Msgbox
Return

1:
button := A_ThisLabel
if (button := Continue)
Gui, Destroy
TrayTip , Title, Text, 10
ExitApp
return
Please mark your topics as solved if you don't need any further help. ✅

Need a little more help? Discord : Yakshongas#9893 🕹
CorruptingNostalgia
Posts: 10
Joined: 17 Apr 2020, 08:44

Re: Help with my gui

08 Sep 2020, 09:33

Thanks for solving that one. But can someone please solve the other questions?

Return to “Ask For Help”

Who is online

Users browsing this forum: 0xDEADC0DE, audante, Chunjee, freakkk, mikeyww, reklamescobar, TAC109 and 51 guests