LuaScripts/linkedSend.lua

22 lines
443 B
Lua
Raw Normal View History

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)
if message == "exit" then
break
2021-01-08 14:59:19 +00:00
elseif message == "help" then
print(help)
2021-01-07 23:32:44 +00:00
end
t.send(message)
end