;--------------------------------------------------------------------------------------------------------------- ; CHANGELOG: ; ; Dec 16 2021: Initial release by Glisense ltd ; ; Current script is designed for use together with Keyboard Extension® (https://keyboardextension.com) ; ; For the latest version, description and licensing terms go to https://keyboardextension.com/plugins/cbc691e7 ; ;--------------------------------------------------------------------------------------------------------------- #NoEnv ; Avoid checking empty variables if they are environment variables #NoTrayIcon ; Hide tray icon #Persistent ; Keep the script permanently running until it gets terminated SetBatchLines, -1 global MemoryAvailPhys, MemoryTotalPhys, MemoryUsedPhys SetTimer, GetRamInfo, 1000 Return GetRamInfo() { VarSetCapacity(MEMORYSTATUSEX, 64, 0) NumPut(64, MEMORYSTATUSEX) DllCall("GlobalMemoryStatusEx", Ptr, &MEMORYSTATUSEX) MemoryUsedPhys := NumGet(&MEMORYSTATUSEX + 4, "UInt" ) . " %" MemoryTotalPhys := TransformValue( NumGet(&MEMORYSTATUSEX + 8, "UInt64") ) MemoryAvailPhys := TransformValue( NumGet(&MEMORYSTATUSEX + 16, "UInt64") ) /* ToolTip % "MemoryUsedPhys: " . MemoryUsedPhys . "`n" . "MemoryTotalPhys: " . MemoryTotalPhys . "`n" . "MemoryAvailPhys: " . MemoryAvailPhys */ } TransformValue(value) { value .= " B" for k, v in ["KB", "MB", "GB", "TB"] { if RegExReplace(value, "[^\d.]") >= 1024 value := Format("{:.2f} " . v, RegExReplace(value, "[^\d.]")/1024) } until value < 1024 Return value }