I have a script where I want to change a variable using gui, then use that variable as a hotkey that will run the bottom segment of code. But when I change the variable and press gui submit the hotkey doesn't change.
(The variable is Hotkey)
Gui, +resize Gui, Add, Checkbox, vThrowpot, Throwpot Gui, add, edit, vPotdelay, Delay (MS) Gui, Add, Edit, vHotkey, Hotkey Gui, add, dropdownlist, vSlotone, 1st Hotkey|1|2|3|4|5|6|7|8|9 Gui, add, dropdownlist, vSlottwo, 2nd Hotkey|1|2|3|4|5|6|7|8|9 Gui, add, dropdownlist, vSlotthree, 3rd Hotkey|1|2|3|4|5|6|7|8|9 Gui, add, dropdownlist, vSlotfour, 4th Hotkey|1|2|3|4|5|6|7|8|9 Gui, add, dropdownlist, vSlotfive, 5th Hotkey|1|2|3|4|5|6|7|8|9 Gui, add, dropdownlist, vSlotsix, 6th Hotkey|1|2|3|4|5|6|7|8|9 Gui, add, button, default, submit Gui, Show Buttonsubmit: gui, submit, nohide GuiClose(GuiHwnd) { ExitApp } *e:: send e Tc = 6 return Hotkey,%Hotkey%,Button Return Button: Tc++ If (Tc = 7) Tc := 1 If (Tc = 1) { send %Slotone% sleep %Potdelay% If (%Throwpot% = yes){ click right } } Else If (Tc = 2) { send %Slottwo% sleep %Potdelay% If (%Throwpot% = yes){ click right } } Else If (Tc = 3) { send %Slotthree% sleep %Potdelay% If (%Throwpot% = yes){ click right } } Else If (Tc = 4) { send %Slotfour% sleep %Potdelay% If (%Throwpot% = yes){ click right } } Else If (Tc = 5) { send %Slotfive% sleep %Potdelay% If (%Throwpot% = yes){ click right } } Else If (Tc = 6) { send %Slotsix% sleep %Potdelay% If (%Throwpot% = yes){ click right } } Return