Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = { ... }
- term.clear()
- term.setCursorPos(1,1)
- back = 0
- left = 0
- right = 0
- front = 0
- top = 0
- bottom = 0
- backc = 0
- leftc = 0
- rightc = 0
- frontc = 0
- topc = 0
- botc = 0
- last = ""
- locked = 0
- free = 0
- colseq = {colors.white, colors.orange, colors.magenta, colors.lightBlue, colors.yellow, colors.lime, colors.pink, colors.gray, colors.lightGray, colors.cyan, colors.purple, colors.blue, colors.brown, colors.green, colors.red}
- if(tArgs[1] == "update")then
- shell.run("rm", "PB")
- shell.run("pastebin", "get", "AFiiZJ5B", "PB")
- print "Update successfull!"
- error()
- end
- function addPoint(color)
- if(color == "red")then
- if(frontc < 15)then
- frontc = frontc + 1
- front = 0
- for addp = 1, frontc do
- front = front + colseq[addp]
- end
- end
- redstone.setBundledOutput("front", front)
- elseif(color == "blue")then
- if(backc < 15)then
- backc = backc + 1
- back = 0
- for addp = 1, backc do
- back = back + colseq[addp]
- end
- end
- redstone.setBundledOutput("back", back)
- elseif(color == "green")then
- if(rightc < 15)then
- rightc = rightc + 1
- right = 0
- for addp = 1, rightc do
- right = right + colseq[addp]
- end
- end
- redstone.setBundledOutput("right", right)
- elseif(color == "yellow")then
- if(leftc < 15)then
- leftc = leftc + 1
- left = 0
- for addp = 1, leftc do
- left = left + colseq[addp]
- end
- end
- redstone.setBundledOutput("left", left)
- elseif(color == "purple")then
- if(bottomc < 15)then
- bottomc = bottomc + 1
- bottom = 0
- for addp = 1, bottomc do
- bottom = bottom + colseq[addp]
- end
- end
- redstone.setBundledOutput("bottom", bottom)
- elseif(color == "orange")then
- if(topc < 15)then
- topc = topc + 1
- top = 0
- for addp = 1, topc do
- top = top + colseq[addp]
- end
- end
- redstone.setBundledOutput("top", top)
- end
- end
- while true do
- free = 0
- if(locked == 0)then
- os.pullEvent("redstone")
- end
- fronts = redstone.testBundledInput("front", colors.black)
- backs = redstone.testBundledInput("back", colors.black)
- lefts = redstone.testBundledInput("left", colors.black)
- rights = redstone.testBundledInput("right", colors.black)
- tops = redstone.testBundledInput("top", colors.black)
- bottoms = redstone.testBundledInput("bottom", colors.black)
- if(locked == 0 or last == "red")then
- if(fronts)then
- if(last == "red")then
- addPoint("red")
- end
- locked = 1
- last = "red"
- else
- locked = 0
- last = ""
- end
- end
- if(locked == 0 or last == "blue")then
- if(backs)then
- if(last == "blue")then
- addPoint("blue")
- end
- locked = 1
- last = "blue"
- else
- locked = 0
- last = ""
- end
- end
- if(locked == 0 or last == "green")then
- if(rights)then
- if(last == "green")then
- addPoint("green")
- end
- locked = 1
- last = "green"
- else
- locked = 0
- last = ""
- end
- end
- if(locked == 0 or last == "yellow")then
- if(lefts)then
- if(last == "yellow")then
- addPoint("yellow")
- end
- locked = 1
- last = "yellow"
- else
- locked = 0
- last = ""
- end
- end
- if(locked == 0 or last == "purple")then
- if(bottoms)then
- if(last == "purple")then
- addPoint("purple")
- end
- locked = 1
- last = "purple"
- else
- locked = 0
- last = ""
- end
- end
- if(locked == 0 or last == "orange")then
- if(tops)then
- if(last == "orange")then
- addPoint("orange")
- end
- locked = 1
- last = "orange"
- else
- locked = 0
- last = ""
- end
- end
- if(not tops and not bottoms and not lefts and not rights and not fronts and not backs)then
- locked = 0
- last = ""
- end
- print (last)
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement