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 socket = GERTi.openSocket(0.1, false, 1) -- This tells it to open a connection to the GERTi computer with an address of 0.1, not to use an event singal on incoming messages, and to use connection ID 1
- --local holding = redstone.getBundledInput(sides.back, colors.green)
- local TankInfo = tank.getFluidInTank(sides.up) --useded to get amount in tank
- local Safe = 256000
- -- if TankInfo[1]["amount"] < Safe then
- --if event.pull(holding) == 0 then
- --end
- while true do
- TankInfo = tank.getFluidInTank(sides.up)
- if TankInfo[1]["amount"] < Safe then
- socket:write("SewageRequest") -- Sends a message to the other end of the socket (Computer 0.1) the data "Requesting Train"
- 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
- --redstone.setBundledOutput(sides.back, colors.blue, 0)
- --redstone.setBundledOutput(sides.back, colors.purple, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement