Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("right")
- monitor.clear()
- monitor.setCursorPos(1, 1)
- monitor.setTextScale(1)
- rednet.close("back")
- rednet.open("back")
- waitingForTurtle = true
- gpsBasement = 5
- linePos = 2
- jobAvailable = true
- idTag = 1
- function setSettings()
- term.clear()
- term.setCursorPos(1,1)
- print("Terminal ID: "..os.computerID())
- print("Enter terminal ID for the Downstairs GPS Computer")
- gpsBasement = tonumber(read())
- local file = fs.open("Settings", "w")
- file.writeLine(gpsBasement)
- file.close()
- term.clear()
- term.setCursorPos(1,1)
- print("Terminal ID: "..os.computerID())
- end
- function getSettings()
- if not fs.exists("Settings") then
- setSettings()
- return
- end
- local file = fs.open("Settings", "r")
- gpsBasement = (file.readLine())
- file.close()
- end
- function start()
- monitor.setCursorPos(1,1)
- monitor.clearLine()
- monitor.setTextColour(16)
- monitor.write("ID Status Location Fuel")
- while jobAvailable do
- id, gpsString, dis = rednet.receive()
- recArray = {}
- sendString = (id.." "..gpsString)
- rednet.send(gpsBasement, sendString)
- sendString = (" ")
- for word in string.gmatch(gpsString, "([^%s]+)")do
- table.insert(recArray, word)
- end
- idTag = tonumber(recArray[6])
- idDisplay = recArray[6]
- linePos = idTag + 1
- monitor.setCursorPos(1, linePos)
- monitor.clearLine()
- monitor.setTextColour(1)
- monitor.write(idDisplay)
- monitor.setCursorPos(7, linePos)
- if recArray[5] == "Home" then
- monitor.setTextColour(16384)
- end
- if recArray[5] == "Transit" then
- monitor.setTextColour(2048)
- end
- if recArray[5] == "Onsite" then
- monitor.setTextColour(32)
- end
- monitor.write(recArray[5])
- monitor.setTextColour(1)
- monitor.setCursorPos(17, linePos)
- monitor.write("X: "..recArray[1])
- monitor.setCursorPos(25, linePos)
- monitor.write("Z: "..recArray[2])
- monitor.setCursorPos(33, linePos)
- monitor.write("Y: "..recArray[3])
- monitor.setCursorPos(41, linePos)
- if tonumber(recArray[4]) < 400 then
- monitor.setTextColour(16384)
- end
- if tonumber(recArray[4]) > 400 then
- monitor.setTextColour(2)
- end
- if tonumber(recArray[4]) > 4500 then
- monitor.setTextColour(16)
- end
- if tonumber(recArray[4]) > 10000 then
- monitor.setTextColour(32)
- end
- monitor.write(recArray[4])
- recArray = {}
- sendString = {}
- end
- while not(jobAvailable) do
- end
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Terminal ID: "..os.computerID())
- getSettings()
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement