Not so Difficult Logic Question Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Not so Difficult Logic Question

19 Feb 2018, 18:19

Hi,
I´m having this problem with 2 or more hotkeys sharing the same hotkey type.
Write 2 at the first gui for the error:

Code: Select all

#SingleInstance, force
	GuiWidth:= 210
	GuiHeight:= 100
	Gui, Add, Text, x50 y33 w120 h26, Hotkeys
	Gui, Add, Edit, x10 y30 w30 h21 vHotkeyLimit, %HotkeyLimit%
	Gui, Add, Button, x10 y70 w90 h20 gHKeyEdit Default, Hotkeys
	Gui, Add, Button, x110 y70 w90 h20 gCancel, Reload
	Gui, Show, , Hotkey Count
Return
HkeyEdit:
	Gui, submit
	Gui, Destroy
	N:= 1
		Loop
			{
			Gui, Add, Checkbox, % " vHKey" N "Toggle Checked" HKey%N%Toggle
			Gui, Add, Radio, % " vHkey" N "Type1 Checked" HKey%N%Type1,1
			N+= 1
				If (A_Index = HotkeyLimit) {
					Gui, Add, Button,  W90 H20 gSetHKs Default, Set Up
					Gui, Add, Button,  w90 h20 gCancel, Reload
					Gui, Show, , Hotkey Type:
					Break
				}
		}
Return
SetHKs:
	Gui, submit
	Gui, Destroy
	N:=1
	T1N:=1
		Loop, %HotkeyLimit%
			{
				If (Hkey%N%Toggle =1)
					If (HKey%N%Type1 = 1)
						{
						T1N+= 1
						}
			HkeyNToggle:= % Hkey%N%Toggle
				If (HkeyNToggle = 1)
					{
					HkeyNType1:= % Hkey%N%Type1
						If (HkeyNType1 = 1) {
							TypeN:= N
							Gosub HotkeyType1
						}
					}
			N+= 1
			}
Return
HotkeyType1:
	Gui, Add, Edit, x10 y130 h21 w21 vXTriggeredCount, %XTriggeredCount%
	Gui, Add, Button, x10 y170 w90 h20 gTriggered Default, Define
	Gui, Add, Button, x110 y170 w90 h20 gCancel, Reload
	Gui, Show
Return
Triggered:
	Gui, Submit
	Gui, Destroy
	TrigN:= 1
		Loop, %XTriggeredCount%
			{
			TriggerToggleTrigN2:= % TriggerToggle%TrigN2%
			Gui, Add, Checkbox, vTriggerToggle%TrigN2% Checked%TriggerToggleTrigN2%
			Gui, Add, Edit, vHKey%TypeN%S%TrigN2%, % HKey%TypeN%S%TrigN2%
			TrigN+= 1
				If (A_Index = XTriggeredCount) {
					Gui, Add, Button, x70 y%ButtonHeight% W90 H20 gTriggeredWrite Default, Record
					Gui, Add, Button, x170 y%ButtonHeight% w90 h20 gCancel, Reload
					Gui, Show
					Break
				}
			}
Return
TriggeredWrite:
	Gui, Submit
	Gui, Destroy
Return
In my lowly knowledge I think it would need a function with %T1N% for a sub then calling the sub variables var%T1N%.
If someone is able to help me I´d appreciate a lot.
Thanks and Regards.
Last edited by Noo0B on 28 Mar 2018, 13:44, edited 1 time in total.
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Difficult Logic Question

21 Feb 2018, 05:29

I probably Surfed Through the solution somewhere without being able to understand and recognize it.
I also found this but couldn't get the file append to work:
https://autohotkey.com/board/topic/38482-dynamic-label/
I really don´t know much!
Thanks and regards!
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: Difficult Logic Question  Topic is solved

28 Mar 2018, 13:44

Needs a variable for each iteraction. % XTriggeredCount%Xcount%. then write in expression mode :)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: dipahk and 237 guests