Timer Gui

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TheSuperGiant
Posts: 2
Joined: 02 Aug 2022, 04:00

Timer Gui

Post by TheSuperGiant » 08 Aug 2022, 13:34

This is the code what i have until now the gui code have i found on internet tried the change it to what i want but i cant get it what i want.

1. I want to know how to get the gui on min right screen. I have searched online but i cant find it how to do it.
2. I want to try 3 gui's what i like it most the version of the gui that i have now and 1 with full screen and 1 with in the right corner.
3. I want even that i can toggle it i doesn't know what part of the code must i toggle so i can switch off the timer and switch on again.
the color and the text color is fine for me.


Code: Select all

F6::
    toggle_Timer := !toggle_Timer
    if(toggle_Timer) ;if true
        SetTimer, Clock, 1000 ;48m - GTA Day Timer
    else
        SetTimer, Clock, Off
Return

SysGet, Mon2, Monitor, 2
width := 280, time := 20000101004800 ;48m - GTA Day Timer
Gui -Caption
Gui, Font, s32 c008000
Gui, Add, Text, w%width% vtext
Gui, Show, w%width%, Timer
Gui, Color, 000000
SetTimer, Clock, 1000
Clock:
FormatTime, clock, %time%, HH:mm:ss
time += -1, Seconds
GuiControl,, text, %clock%
If (clock = "00:00:00"){
	SetTimer, Clock, Off
}
If (clock = "00:00:06"){
	SetTimer, DbD1, 6000
}

DbD1(){
	SoundPlay, %A_WinDir%\Media\Alarm01.wav
}

thanks in advance

[Mod edit: Moved topic from 'Scripts and Functions'.]

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

Re: Timer Gui

Post by mikeyww » 08 Aug 2022, 16:44

Welcome to this AutoHotkey forum!

1. Move hotkeys to the bottom. https://www.autohotkey.com/docs/Scripts.htm#auto

2. Positioning of GUI: https://www.autohotkey.com/docs/commands/Gui.htm#Show

3. Creating a new GUI: https://www.autohotkey.com/docs/commands/Gui.htm#New

If you run Window Spy, you can see coordinates displayed there. GUI will use absolute or screen coordinates.

TheSuperGiant
Posts: 2
Joined: 02 Aug 2022, 04:00

Re: Timer Gui

Post by TheSuperGiant » 13 Aug 2022, 10:56

thanks for your replay i will look in it.

Post Reply

Return to “Ask for Help (v1)”