Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- KSubNet control program --
- -- VARS --
- -- FUNCTIONS --
- function displayColors()
- if colors.test(redstone.getBundledInput("back"), colors.red) then
- setDestination("east")
- elseif colors.test(redstone.getBundledInput("back"), colors.blue) then
- setDestination("west")
- elseif colors.test(redstone.getBundledInput("back"), colors.yellow) then
- setDestination("south")
- elseif colors.test(redstone.getBundledInput("back"), colors.green) then
- setDestination("north")
- end
- end
- function setDestination(dest)
- print(dest)
- if dest == "east" then
- rs.setBundledOutput("bottom",colors.combine(colors.green,colors.orange))
- sleep(1)
- rs.setBundledOutput("bottom",colors.green)
- elseif dest == "south" then
- rs.setBundledOutput("bottom",colors.combine(colors.red,colors.orange))
- sleep(1)
- rs.setBundledOutput("bottom",colors.red)
- elseif dest == "north" then
- rs.setBundledOutput("bottom",colors.combine(colors.blue,colors.orange))
- sleep(1)
- rs.setBundledOutput("bottom",colors.blue)
- else
- rs.setBundledOutput("bottom",colors.orange)
- sleep(1)
- rs.setBundledOutput("bottom",0)
- end
- end
- -- MAIN --
- monitor = peripheral.wrap("top")
- monitor.setTextScale(0.5)
- term.redirect(monitor)
- term.clear()
- term.setCursorPos(1,1)
- while true do
- local event = os.pullEvent("redstone")
- displayColors()
- end
- term.restore()
- -- END -
Advertisement
Add Comment
Please, Sign In to add comment