This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local term = require("term") | |
local gpu = term.gpu() | |
local seri = require("serialization") | |
local p_set = "^set%s+(-?%d+)%s+(-?%d+)%s+(%d+)$" | |
local p_setStr = "^set%s+(-?%d+)%s+(-?%d+)%s+([%a%s]+)$" | |
local p_get = "^get%s+(-?%d+)%s+(-?%d+)$" | |
local p_quit = "^quit$" | |
local p_save = "^save$" | |
local p_load = "^load$" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local m=component.proxy(component.list("modem")()) | |
m.open(2412) | |
local function respond(...) | |
local args=table.pack(...) | |
pcall(function() m.broadcast(2412, table.unpack(args)) end) | |
end | |
local function receive() | |
while true do | |
local evt,_,_,_,_,cmd=computer.pullSignal() | |
if evt=="modem_message" then return load(cmd) end |