Updating Variables With Control Things Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
That Kid
Posts: 10
Joined: 15 Nov 2021, 17:40

Updating Variables With Control Things

Post by That Kid » 05 Jan 2022, 15:54

Code: Select all

`::
if toggle := !toggle
{
	SetTimer, Loop1, 12
        goto timey

}
else
	SetTimer, Loop1, Off
        Gui, timer:Destroy
        Gui, Destroy
return

Loop1:
Gui,Color,Red,000000
Gui, -Caption 
TempVar := A_ScreenHeight +100
Gui,Show, h%TempVar% w%A_ScreenWidth%
sleep 1
Gui,Color,White,000000
sleep 1
Gui,Color,Orange,000000
sleep 1
Gui,Color,White,000000
sleep 1
Gui,Color,Yellow,000000
sleep 1
Gui,Color,White,000000
sleep 1
Gui,Color,Green,000000
sleep 1
Gui,Color,White,000000
sleep 1
Gui,Color,Blue,000000
sleep 1
Gui,Color,White,000000
sleep 1
Gui,Color,Purple,000000
sleep 1
Gui,Color,White,000000
return

timey:
TextColor = FF0000
Gui, timer:new
Gui, timer:Color, EEAA99
Gui, timer:Font, S72, Arial Black
Gui, timer:Add, Text, BackgroundTrans vT1, 00:00:00
Gui, timer:Add, Text, xp-3 yp-3 c%TextColor% BackgroundTrans vT2, 00:00:00
Gui timer:+LastFound +AlwaysOnTop +ToolWindow
WinSet, TransColor, EEAA99
Gui, timer:-Border -Caption +AlwaysOnTop
Gui, timer:Show
        SetTimer, TextStrobe, 3
	SetTimer, Update, 1000
return

TextStrobe:
TextColor = FF0000
sleep 1
TextColor = 0000FF
sleep 1
TextColor = 00FF00
sleep 1
return

Update:
 GuiControl, timer:, T1, % A_Hour ":" A_Min ":" A_Sec
 GuiControl, timer:, T2, % A_Hour ":" A_Min ":" A_Sec
Return


h::
Exitapp
so in this code i wanted to make a strobing background, and that works, im just wondering how to update the line that changes the color of the text :D (line 49, but that adds a new one, im looking to have it update the color of the existing GUI)
User avatar
TLM
Posts: 1608
Joined: 01 Oct 2013, 07:52
Contact:

Re: Updating Variables With Control Things  Topic is solved

Post by TLM » 05 Jan 2022, 16:33

Jeeez this script needs a seizure warning :crazy: :wtf: :lol:
Try this:

Code: Select all

TextColorArr 	:= [ "FF0000", "0000FF", "00FF00" ]
GuiColorArr 	:= [ "Orange", "Yellow", "Green", "Blue", "Purple" ]
GuiColorCnt 	:= TextColorCnt := 0

`::
if toggle := !toggle
{
	SetTimer, Loop1, 12
        goto timey

}
else
	SetTimer, Loop1, Off
        Gui, timer:Destroy
        Gui, Destroy
return

Loop1:
Gui,Color,Red,000000
Gui, -Caption 
TempVar := A_ScreenHeight +100
Gui,Show, h%TempVar% w%A_ScreenWidth%

sleep 1
Gui,Color, % (i:=!i) ? "White" : GuiColorArr[ Mod( GuiColorCnt++, GuiColorArr.Length() )+1 ], 000000
return

timey:
TextColor = FF0000
Gui, timer:new
Gui, timer:Color, EEAA99
Gui, timer:Font, S72, Arial Black
Gui, timer:Add, Text, BackgroundTrans vT1, 00:00:00
Gui, timer:Add, Text, xp-3 yp-3 c%TextColor% BackgroundTrans vT2, 00:00:00
Gui timer:+LastFound +AlwaysOnTop +ToolWindow
WinSet, TransColor, EEAA99
Gui, timer:-Border -Caption +AlwaysOnTop
Gui, timer:Show
        SetTimer, TextStrobe, 3
	SetTimer, Update, 1000
return

TextStrobe:

Gui, timer:Font, % "c" TextColorArr[ Mod( TextColorCnt++, TextColorArr.Length() )+1 ]
GuiControl, timer:Font, T2
sleep 1

return

Update:
 GuiControl, timer:, T1, % A_Hour ":" A_Min ":" A_Sec
 GuiControl, timer:, T2, % A_Hour ":" A_Min ":" A_Sec
Return


h::
Exitapp
hth & thanks for the brain hemorrhage loll
That Kid
Posts: 10
Joined: 15 Nov 2021, 17:40

Re: Updating Variables With Control Things

Post by That Kid » 05 Jan 2022, 19:52

works perfectly, i never knew you could have essentially multiple "options" on a Variable, thank you! :)
Post Reply

Return to “Ask for Help (v1)”