Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local DIR = "back"
- local ELEVATOR = "top"
- function BOT(x)
- if x == true then
- rs.setBundledOutput(DIR,colors.combine(rs.getBundledOutput(DIR),colors.white))
- elseif x == false then
- rs.setBundledOutput(DIR,colors.subtract(rs.getBundledOutput(DIR),colors.white))
- end
- end
- function TOP(x)
- if x == true then
- rs.setBundledOutput(DIR,colors.combine(rs.getBundledOutput(DIR),colors.orange))
- elseif x == false then
- rs.setBundledOutput(DIR,colors.subtract(rs.getBundledOutput(DIR),colors.orange))
- end
- end
- function EL(x)
- if x == true then
- rs.setAnalogOutput(ELEVATOR,15)
- elseif x == false then
- rs.setAnalogOutput(ELEVATOR,0)
- end
- end
- EL(false)
- BOT(false)
- TOP(true)
- OldEv=false
- while true do
- os.pullEvent("redstone")
- if (rs.testBundledInput(DIR,colors.purple) == true) and (OldEv == false) then
- print("MONTE")
- TOP(true)
- BOT(true)
- sleep(2)
- EL(true)
- sleep(6)
- TOP(false)
- sleep(2)
- OldEv = not OldEv
- elseif (rs.testBundledInput(DIR,colors.purple)==true) and (OldEv == true) then
- print("DESCEND")
- TOP(true)
- BOT(true)
- sleep(2)
- EL(false)
- sleep(6)
- BOT(false)
- sleep(2)
- OldEv = not OldEv
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement