GetSample(string)
Description
Section titled âDescriptionâThe GetSample Lua function returns a number representing a percentage usage based on a string input.
Arguments
Section titled âArgumentsâ-
String:
Only a specific list of strings can be input:- MEMORY
- CPU
- CPUTEMP
- GPUTEMP
- SYSTEMP
- FANRPM
- Number:
A number (float) is returned.
Example
Section titled âExampleâThis example stores the different samples in a table and then prints the content of the table:
| Copy CodeLua |
| ``` |
| return function() |
-- Gather the sample information in a tablelocal sample = {}sample["MEMORY"] = GetSample("MEMORY")sample["CPU"] = GetSample("CPU")sample["CPUTEMP"] = GetSample("CPUTEMP")sample["GPUTEMP"] = GetSample("GPUTEMP")sample["SYSTEMP"] = GetSample("SYSTEMP")sample["FANRPM"] = GetSample("FANRPM")-- Print the collected dataPrintf("Memory ; ".. sample["MEMORY"])Printf("CPU ; ".. sample["CPU"])Printf("CPU temperature ; ".. sample["CPUTEMP"])Printf("GPU temperature ; ".. sample["GPUTEMP"])Printf("System temperature ; ".. sample["SYSTEMP"])Printf("Fan RPM ; ".. sample["FANRPM"])end