SHARE
TWEET

test

a guest Jun 15th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local DIR = "back"
  2. local ELEVATOR = "top"
  3.  
  4. function BOT(x)
  5.   if x == true then
  6.     rs.setBundledOutput(DIR,colors.combine(rs.getBundledOutput(DIR),colors.white))
  7.   elseif x == false then
  8.     rs.setBundledOutput(DIR,colors.subtract(rs.getBundledOutput(DIR),colors.white))
  9.   end
  10. end
  11.  
  12. function TOP(x)
  13.   if x == true then
  14.     rs.setBundledOutput(DIR,colors.combine(rs.getBundledOutput(DIR),colors.orange))
  15.   elseif x == false then
  16.     rs.setBundledOutput(DIR,colors.subtract(rs.getBundledOutput(DIR),colors.orange))
  17.   end
  18. end
  19.  
  20. function EL(x)
  21.   if x == true then
  22.     rs.setAnalogOutput(ELEVATOR,15)
  23.   elseif x == false then
  24.     rs.setAnalogOutput(ELEVATOR,0)
  25.   end
  26. end
  27.  
  28. EL(false)
  29. BOT(false)
  30. TOP(true)
  31.  
  32. OldEv=false
  33.  
  34. while true do
  35.  
  36.   os.pullEvent("redstone")
  37.    
  38.   if (rs.testBundledInput(DIR,colors.purple) == true) and (OldEv == false) then
  39.     print("MONTE")
  40.     TOP(true)
  41.     BOT(true)
  42.     sleep(2)
  43.     EL(true)
  44.     sleep(6)
  45.     TOP(false)
  46.     sleep(2)
  47.     OldEv = not OldEv
  48.   elseif (rs.testBundledInput(DIR,colors.purple)==true) and (OldEv == true) then
  49.     print("DESCEND")
  50.     TOP(true)
  51.     BOT(true)
  52.     sleep(2)
  53.     EL(false)
  54.     sleep(6)
  55.     BOT(false)
  56.     sleep(2)
  57.     OldEv = not OldEv
  58.   end
  59. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top