-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
33 lines (31 loc) · 780 Bytes
/
init.lua
File metadata and controls
33 lines (31 loc) · 780 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
package.path = package.path .. ";Telecom/?;Telecom/?.lua"
---@type fun(msg: string)
STD_OUT = print
---@type fun(msg: string)
STD_ERR = function(data)
if os and term and fs then
local col = term.getTextColor()
term.setTextColor(colors.red)
print(data)
term.setTextColor(col)
local f = fs.open("error.txt", "w")
if not f then return end
-- f.write(data) uer
-- f.close()
else
print(data)
end
end
---@type fun(msg: string)
STD_WARN = function(data)
if os and term and fs then
local col = term.getTextColor()
term.setTextColor(colors.yellow)
print(data)
term.setTextColor(col)
else
print(data)
end
end
---@type fun(msg: string)
STD_EVENT = print