Update linkedGet.lua
This commit is contained in:
parent
d1119176dd
commit
df1e8dde13
1 changed files with 5 additions and 4 deletions
|
@ -4,8 +4,8 @@ local component = require("component")
|
||||||
local fs = require("filesystem")
|
local fs = require("filesystem")
|
||||||
local tunnel = component.tunnel
|
local tunnel = component.tunnel
|
||||||
|
|
||||||
local success = "команда выполнена успешно"
|
local success = "console: команда выполнена успешно"
|
||||||
local fail = "неизвестная команда - пиши help"
|
local fail = "console: неизвестная команда - пиши help"
|
||||||
|
|
||||||
function os.dateRL(format)
|
function os.dateRL(format)
|
||||||
if not fs.get("/").isReadOnly() then
|
if not fs.get("/").isReadOnly() then
|
||||||
|
@ -41,10 +41,11 @@ end
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
local _, _, from, _, _, message = event.pull("modem_message")
|
local _, _, from, _, _, message = event.pull("modem_message")
|
||||||
local log = "["..os.dateRL("%x %X").."]".." "..getUser(tostring(from))..": "..message.."\n"..handleMessage(tostring(message))
|
local answer = handleMessage(tostring(message)
|
||||||
|
local log = "["..os.dateRL("%x %X").."] "..getUser(tostring(from))..": "..message.."\n".."["..os.dateRL("%x %X").."] "..answer)
|
||||||
print(log)
|
print(log)
|
||||||
local f = io.open("logs.txt", "a")
|
local f = io.open("logs.txt", "a")
|
||||||
f:write(log.."\n")
|
f:write(log.."\n")
|
||||||
f:close()
|
f:close()
|
||||||
tunnel.send("succes!")
|
tunnel.send(answer)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue