Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- CoordMode ToolTip Client
- #SingleInstance Force
- ; === SETUP ===
- clientTitle := "PROGRAM NAME" ; The title of your client.
- chatboxX := 22
- chatboxY := 700
- chatboxWidth := 370
- chatboxHeight := 125
- bgTransparent := "false" ; true if you wish the gui background to be transparent, false if not.
- ; === Don't touch any of this ===
- Gui, Margin, 0, 0
- Gui, Color, 0xCBBA95
- Gui, Add, Text, x20 y10 w350 vrowTimer hwndrowTimer, % "Time running: " runTime()
- Gui, Add, Text, x20 y25 w350 vrow1 hwndrow1
- Gui, Add, Text, x20 y40 w350 vrow2 hwndrow2
- Gui, Add, Text, x20 y55 w350 vrow3 hwndrow3
- Gui, Add, Text, x20 y70 w350 vrow4 hwndrow4
- Gui, Add, Text, x20 y85 w350 vrow5 hwndrow5
- Gui, Add, Text, x20 y100 w350 vrow6 hwndrow6
- ;Gui, Add, Text, x252 y20 w230 vrow5 hwndrow5
- ;Gui, Add, Text, x252 y35 w230 vrow6 hwndrow6
- ;Gui, Add, Text, x252 y50 w230 vrow7 hwndrow7
- ;Gui, Add, Text, x252 y65 w230 vrow8 hwndrow8
- ;Gui, Add, Text, x252 y80 w230 vrow9 hwndrow9
- WinSet, Transparent, 255
- if (bgTransparent = "true") {
- Gui, +E0x20 +toolWindow -caption -dpiScale +lastFound +alwaysOnTop hwndhChild
- WinSet, TransColor, 0xCBBA95
- } else{
- Gui, +toolWindow -caption -dpiScale +lastFound +alwaysOnTop hwndhChild
- hParent := WinExist(clientTitle)
- DllCall("SetParent", Ptr, hChild, Ptr, hParent)
- }
- Gui, Show, x%chatboxX% y%chatboxY% w%chatboxWidth% h%chatboxHeight% NA
- SetTimer, guiUpdate, 75
- ; === Here you can put whatever you want in each row of the gui. ===
- ; === Text, variables, expressions, whatever! ===
- guiUpdate:
- if WinActive(clientTitle)
- Gui, Show, x%chatboxX% y%chatboxY% w%chatboxWidth% h%chatboxHeight% NA
- ;WinActivate %clientTitle%
- GuiControl,, rowTimer, % "Time running: " runTime() ; This is an example of an expression working
- GuiControl,, row1, ; (although don't change it - it's the timer!)
- GuiControl,, row2, Status: %currentTask% ; Pretty self explanatory.
- GuiControl,, row3,
- GuiControl,, row4, PlaceHolder: ;%variablename%
- GuiControl,, row5,
- GuiControl,, row6, PlaceHolder2: ;%variablename% ; Don't forget the % when using variables.
- GuiControl,, row7,
- GuiControl,, row8,
- GuiControl,, row9,
- Return
- ; === FUNCTIONS ===
- runTime() {
- Global
- if !CounterBefore
- CounterBefore := A_TickCount
- Return toHHMMSS((A_TickCount - CounterBefore) / 1000)
- }
- toHHMMSS(sec) {
- oldFormat := A_FormatFloat
- SetFormat, Float, 02.0
- hrs := sec // 3600 / 1
- min := Mod(sec // 60, 60) / 1
- sec := Mod(sec, 60) / 1
- SetFormat, Float, % oldFormat
- ;These return statements change how the time is formatted in the return statement.
- Return (hrs ? hrs "h " : "") (min ? min "m " : "") sec "s"
- }
- F12::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment