-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.lua
More file actions
63 lines (51 loc) · 1000 Bytes
/
common.lua
File metadata and controls
63 lines (51 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require("stream")
require("time")
require("strutil")
require("filesys")
require("process")
require("terminal")
require("sys")
require("net")
require("dataparser")
require("hash")
SHELL_OKAY=0
SHELL_CLOSED=1
SHELL_CLS=2
version="7.0"
settings={}
lookup_counter=0
lookup_values={}
display_values={}
lookup_modules={}
display_modules={}
display_translations=nil
poll_streams=stream.POLL_IO()
shell=nil
stdio=nil
datasock=nil
usage_color_map={
{value=0, color="~g"},
{value=25, color="~y"},
{value=75, color="~r"},
{value=90, color="~R"}
}
thermal_color_map={
{value=0, color="~c"},
{value=20, color="~g"},
{value=40, color="~y"},
{value=60, color="~r"},
{value=80, color="~R"}
}
function StringExtract(input, start, end_char)
local i, char
local output=""
i=start
while i < strutil.strlen(input)
do
char=string.sub(input, i, i)
if char == end_char then break end
output=output..char
i=i+1
end
return i, output
end