Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("monitor_0")
- local function WhatsOut()
- local waterbucket = turtle.getItemDetail(6)
- local lavabucket = turtle.getItemDetail(7)
- if lavabucket.name == "minecraft:lava_bucket" and waterbucket.name == "minecraft:water_bucket" then
- return "None"
- elseif lavabucket.name == "minecraft:lava_bucket" then
- return "Water"
- elseif waterbucket.name == "minecraft:water_bucket" then
- return "Lava"
- end
- return nil
- end
- local outnow = WhatsOut()
- local function printHEAT()
- monitor.setCursorPos(1,1)
- monitor.setTextColor(colors.red)
- monitor.write("[HEAT] ")
- end
- local function printWASH()
- monitor.setCursorPos(1,2)
- monitor.setTextColor(colors.lightBlue)
- monitor.write("[WASH] ")
- end
- local function Select(WaterOrLavaOrNone)
- print("select",WaterOrLavaOrNone)
- if WaterOrLavaOrNone == "None" then
- monitor.setBackgroundColor(colors.black)
- printHEAT()
- printWASH()
- elseif WaterOrLavaOrNone == "Lava" then
- monitor.setBackgroundColor(colors.lightGray)
- printHEAT()
- monitor.setBackgroundColor(colors.black)
- printWASH()
- elseif WaterOrLavaOrNone == "Water" then
- monitor.setBackgroundColor(colors.black)
- printHEAT()
- monitor.setBackgroundColor(colors.lightGray)
- printWASH()
- end
- end
- local function PutOrRemove(WaterOrLava)
- if WaterOrLava == "Lava" then
- if outnow == "Water" then
- turtle.select(6)
- turtle.place()
- end
- turtle.select(7)
- turtle.place()
- elseif WaterOrLava == "Water" then
- if outnow == "Lava" then
- turtle.select(7)
- turtle.place()
- end
- turtle.select(6)
- turtle.place()
- end
- end
- local function decipherPress(y)
- if y == 1 then
- return "Lava"
- elseif y == 2 then
- return "Water"
- end
- end
- while true do
- Select(outnow)
- sleep(0.3)
- local event, side, x, y = os.pullEvent("monitor_touch")
- local whatwaspressed = decipherPress(y)
- PutOrRemove(whatwaspressed)
- outnow = WhatsOut()
- print("its ",outnow," Out there")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement