Update linkedSend.lua

This commit is contained in:
erius0 2021-01-08 17:59:19 +03:00 committed by GitHub
parent 97a5d306cf
commit b4df3e4eac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,21 @@
local component = require("component") local component = require("component")
local event = require("event") local event = require("event")
local t = component.tunnel local t = component.tunnel
print("exit - выйти")
local instr = "help - вывести все команды\nexit - выйти"
local f = io.open("help.txt", "r")
local help = f:read("*all")
f:close()
print(instr)
while true do while true do
io.write("msg: ") io.write("msg: ")
_, message = pcall(io.read) _, message = pcall(io.read)
if message == "exit" then if message == "exit" then
break break
elseif message == "help" then
print(help)
end end
t.send(message) t.send(message)
end end