Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --constants
- input = "west"
- output = "east"
- pi = util.open("front")
- po = util.open("back")
- count = 0
- --Main
- while not rs.getInput("top") do
- sleep(0.1)
- if pi.testBundledInput(input,colors.gray) then
- --when clock
- print("clock")
- if not rs.getInput("right") then
- count = util.decode(pi.testBundledInput(input,colors.white),pi.testBundledInput(input,colors.orange),pi.testBundledInput(input,colors.magenta),pi.testBundledInput(input,colors.lightBlue))
- else
- if pi.testBundledInput(input,colors.pink) then
- count = (count + 1) % 16
- end
- end
- print(tostring(count))
- print(util.encodecol(count))
- end
- if not pi.testBundledInput(input,colors.lime) then
- count = 0
- end
- if not pi.testBundledInput(input,colors.yellow) then
- count = 15
- end
- po.setBundledOutput(output,util.encode(count))
- end
- po.setBundledOutput(output,0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement