GetSample(string)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » GetSample(string) Version 2.2

説明

GetSample 関数は、指定した文字列に基づく使用率を数値で返します。

引数

  • string:
    指定できる文字列は以下の通りです。
    • MEMORY
    • CPU
    • CPUTEMP
    • GPUTEMP
    • SYSTEMP
    • FANRPM

戻り値

  • Number:
    使用率を表す数値(float)を返します。

各使用率をテーブルに保存し、その内容を表示します。

Lua
return function()
    -- Gather the sample information in a table
    local 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 data
    Printf("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