Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = { ... }
- local isLiftDown=colors.red
- local frameUp=colors.black
- local frameDown=colors.red
- local controlLift = function(liftDirection, rate, height)
- for i=1,height do
- redstone.setBundledOutput("top", liftDirection)
- sleep(0.100)
- redstone.setBundledOutput("top", 0)
- sleep(rate-0.100)
- end
- end
- local liftUp = function()
- if redstone.testBundledInput("top", isLiftDown) then
- controlLift(frameUp, 0.800, 32)
- end
- end
- local liftDown = function()
- if redstone.testBundledInput("top", isLiftDown) ~= true then
- controlLift(frameDown, 0.800, 32)
- end
- end
- local checkArguments = function()
- local action = args[1]
- if action == "up" then
- print("Going Up...")
- liftUp()
- elseif action == "down" then
- print("Going Down...")
- liftDown()
- else
- print("lift [up/down]")
- end
- end
- -- check arguments
- if #args > 0 then
- checkArguments()
- else
- print("liftcontrol [up/down]")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement