.
This commit is contained in:
parent
133ff288b7
commit
482bd12e53
34
src/brulijam/gps-door.lua
Normal file
34
src/brulijam/gps-door.lua
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
local basic = require("lib.basic")
|
||||||
|
local netw = require("lib.basic")
|
||||||
|
|
||||||
|
|
||||||
|
local function saveConfig()
|
||||||
|
basic.writeToFile("brulijam/config/gps-door.config", textutils.serialize(gpsDoorConfig))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function getConfig()
|
||||||
|
if not fs.exists "brulijam/config/gps-door.config" then
|
||||||
|
gpsDoorConfig = {}
|
||||||
|
gpsDoorConfig["script"] = "brulijam/gps-door.config"
|
||||||
|
gpsDoorConfig["posX"] = 0
|
||||||
|
gpsDoorConfig["posY"] = 0
|
||||||
|
gpsDoorConfig["posZ"] = 0
|
||||||
|
|
||||||
|
basic.writeToFile("brulijam/config/gps-door.config", textutils.serialize(gpsDoorConfig))
|
||||||
|
else
|
||||||
|
gpsDoorConfig = basic.readFileAll("brulijam/config/gps-door.config")
|
||||||
|
gpsDoorConfig = textutils.unserialize(gpsDoorConfig)
|
||||||
|
end
|
||||||
|
return gpsDoorConfig
|
||||||
|
end
|
||||||
|
|
||||||
|
local function listenForRequests()
|
||||||
|
gpsConfig = getConfig()
|
||||||
|
while true do
|
||||||
|
local payload = netw.receiveMessage()
|
||||||
|
|
||||||
|
if payload["type"] == "gps-door" then
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -95,8 +95,8 @@ function receiveMessage()
|
|||||||
elseif what == "execute_script" then
|
elseif what == "execute_script" then
|
||||||
shell.run(payload)
|
shell.run(payload)
|
||||||
return
|
return
|
||||||
elseif what == "script_command" then
|
elseif what == "payload" then
|
||||||
return recTable[3]
|
return payload
|
||||||
end
|
end
|
||||||
|
|
||||||
return recTable
|
return recTable
|
||||||
|
@ -20,6 +20,7 @@ local copyList = {
|
|||||||
|
|
||||||
[13] = "/brulijam/gps-tower.lua",
|
[13] = "/brulijam/gps-tower.lua",
|
||||||
[14] = "/brulijam/log-receiver.lua",
|
[14] = "/brulijam/log-receiver.lua",
|
||||||
|
[15] = "/startup.lua",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user