Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Acquire the redstone component
- local component = require("component")
- local redstone = component.redstone
- local tank = component.transposer
- -- Acquire helper libraries
- local sides = require("sides")
- local colors = require("colors")
- local os = require("os")
- local term = require("term")
- local event = require("event")
- -- Acquire the GERTi library and open a connection to the base computer
- local GERTi = require("GERTiClient")
- local serialize = require("serialization")
- local socket = GERTi.openSocket(0.4, true, 2) -- Used connectionID 2 instead of 1
- local TankInfo = tank.getFluidInTank(sides.up) --useded to get amount in tank
- local Safe = 256000
- local order = 256000
- local fluid = sewage
- while true do
- TankInfo = tank.getFluidInTank(sides.up)
- if TankInfo[1]["amount"] < Safe then
- table = {["amount"] = order, ["type"] = fluid}
- socket:write(serialize.serialize(table))
- print(TankInfo[1]["amount"],"Sewage Low")
- print("message sent train requested")
- os.sleep(60)
- term.setCursor(1,1)
- term.clearLine()
- term.clear()
- else
- print(TankInfo[1]["amount"],"Sewage Level Safe")
- os.sleep(5)
- term.setCursor(1,1)
- term.clearLine()
- term.clear()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement