Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local count
- local m = peripheral.wrap("top")
- function mon(count)
- m.clear()
- m.setCursorPos(2,2)
- m.write("UU Count: ")
- m.write(count)
- end
- if fs.exists("count") == true then
- local a = fs.open("count", "r")
- count = a.readLine()
- a.close()
- mon(count)
- else
- count = 1
- end
- while true do
- if redstone.getInput("bottom") == true then
- count = count + 1
- local b = fs.open("count", "w")
- b.write(count)
- b.close()
- mon(count)
- if count % 64 == 0 then
- redstone.setOutput("right", true)
- sleep(1)
- rs.setOutput("right", false)
- end
- end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment