diff --git a/src/brulijam/gps-tower.lua b/src/brulijam/gps-tower.lua index 8b32b2d..1e102d8 100644 --- a/src/brulijam/gps-tower.lua +++ b/src/brulijam/gps-tower.lua @@ -1,8 +1,17 @@ -- https://tweaked.cc/guide/gps_setup.html -- Seems to not work with optifine -local x = 0 -local y = 0 -local z = 0 +basic = require("lib.basic") -shell.run("gps", "host", x, y, z) \ No newline at end of file +if fs.exists "/brulijam/config/gps.config" then + gpsConfig = basic.readFileAll("/brulijam/config/gps.config") + gpsConfig = textutils.unserialize(gpsConfig) +else + gpsConfig = {} + gpsConfig["posX"] = 0 + gpsConfig["posY"] = 0 + gpsConfig["posZ"] = 0 + basic.writeToFile("/brulijam/config/gps.config", textutils.serialize(gpsConfig)) +end + +shell.run("gps", "host", gpsConfig["posX"], gpsConfig["posY"], gpsConfig["posZ"]) \ No newline at end of file