2021-01-08 16:42:38 +00:00
|
|
|
local computer = require("computer")
|
2021-01-07 23:32:44 +00:00
|
|
|
local component = require("component")
|
|
|
|
local event = require("event")
|
|
|
|
local t = component.tunnel
|
2021-01-08 14:59:19 +00:00
|
|
|
|
|
|
|
local instr = "help - вывести все команды\nexit - выйти"
|
|
|
|
local f = io.open("help.txt", "r")
|
|
|
|
local help = f:read("*all")
|
|
|
|
f:close()
|
|
|
|
|
|
|
|
print(instr)
|
|
|
|
|
2021-01-07 23:32:44 +00:00
|
|
|
while true do
|
|
|
|
io.write("msg: ")
|
|
|
|
_, message = pcall(io.read)
|
2021-01-08 15:05:18 +00:00
|
|
|
t.send(message)
|
2021-01-07 23:32:44 +00:00
|
|
|
if message == "exit" then
|
|
|
|
break
|
2021-01-08 14:59:19 +00:00
|
|
|
elseif message == "help" then
|
|
|
|
print(help)
|
2021-01-08 16:42:38 +00:00
|
|
|
elseif message == "update" then
|
|
|
|
computer.shutdown(true)
|
2021-01-07 23:32:44 +00:00
|
|
|
end
|
2021-01-08 15:13:08 +00:00
|
|
|
os.sleep(1)
|
2021-01-07 23:32:44 +00:00
|
|
|
end
|