DIES 0 Posted March 29, 2018 Share Posted March 29, 2018 I cannot find any info about how to use this thing. ------------ # lua lua> computer.getDeviceInfo() Lua interpreter only gives me some truncated complicated table. Quote Link to post Share on other sites
1 CptMercury 6 Posted March 29, 2018 Share Posted March 29, 2018 I think there might be a better solution, but this is what I came up with: local info = computer.getDeviceInfo() local cputier for k in pairs(info) do if info[k].class == "processor" then cputier = tonumber((info[k].product):match("%d")) end end Quote Link to post Share on other sites
0 DIES 0 Posted March 30, 2018 Author Share Posted March 30, 2018 CptMercury, Thx, I already found a solution for anything but only tier. Didn't bother though, as it included in "product". for k, v in pairs(dev_info) do if v.class == "processor" then _ProcessorName = --[[v.vendor.." "..]]v.product if v.clock == nil or v.clock == "" then else v.clock = v.clock:match"[^+]*" _ProcessorClock = v.clock.."Hz" end end end Actually yours "tonumber((info[k].product):match("%d"))" can be useful too. Quote Link to post Share on other sites
I cannot find any info about how to use this thing.
------------
Lua interpreter only gives me some truncated complicated table.
Link to post
Share on other sites