Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function requestCoordinates()
- print("Enter coords:")
- io.write("X: ")
- local x = read()
- io.write("Z: ")
- local z = read()
- x = tostring(tonumber( (tonumber(x)-7)/16 ))
- z = tostring(tonumber( (tonumber(z)-7)/16 ))
- print(x, z)
- local file = fs.open("coordinates.txt", "w")
- file.writeLine(x)
- file.writeLine(z)
- file.close()
- print("Coords saved!")
- end
- if not fs.exists("coordinates.txt") then
- requestCoordinates()
- end
- local startup = fs.open("startup.lua", "w")
- startup.write([[
- local file = fs.open("coordinates.txt", "r")
- local x = tostring( tonumber(file.readLine()) * os.day() )
- local z = tostring( tonumber(file.readLine()) * os.day() )
- file.close()
- rednet.open("top")
- while true do
- local message = z.." "..x
- rednet.broadcast(message, "108")
- sleep(1)
- end
- ]])
- startup.close()
- sleep(5)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement