Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local door = args[1]
- local fuel = args[2]
- local maxFuel = 20000
- local trips = math.floor(fuel / 8)
- local fuelPerc = fuel / maxFuel
- local f = fs.open("settings.txt", "r")
- f.readLine()
- f.readLine()
- f.readLine()
- local side = f.readLine()
- f.close()
- local mon = peripheral.wrap(side)
- local w,h = mon.getSize()
- local edge = 1
- local barWidth = w - 2*edge
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Silo Door is ".. door)
- mon.setCursorPos(1,3)
- mon.write("Turtle Fuel: ".. trips .." trips")
- mon.setCursorPos(edge+1, 5)
- if mon.isColor() then
- mon.setBackgroundColor(colors.red)
- else
- mon.setBackgroundColor(colors.gray)
- end
- mon.write((" "):rep(barWidth))
- mon.setCursorPos(edge+1, 5)
- if mon.isColor() then
- mon.setBackgroundColor(colors.blue)
- else
- mon.setBackgroundColor(colors.white)
- end
- mon.write((" "):rep(math.floor(fuelPerc * barWidth)))
- if trips < 10 then
- mon.setBackgroundColor(colors.white)
- if mon.isColor() then
- mon.setTextColor(colors.red)
- else
- mon.setTextColor(colors.black)
- end
- mon.setCursorPos(1, 7)
- mon.write((" "):rep(w))
- mon.setCursorPos(1, 7)
- mon.write("Warning: Refuel Immediately")
- mon.setTextColor(colors.white)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement