LuaScripts/linkedSend.lua
2021-01-08 18:13:08 +03:00

22 lines
457 B
Lua

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