thatparadox

Endergenic Generator - Redstone Operated

Oct 10th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. --requires 5 endergenic generators (optimal)
  2.  
  3. RSOutput = "right"     --next computer side
  4. RSInput ="left"        --previous computer side
  5. starter = false        --set one computer to true
  6. starterInput = "front" --ignore unless starter. Side for RS input to start generator
  7.  
  8. while true do
  9.   if starter then
  10.     while rs.getInput(starterInput) == false do
  11.       sleep(0.05)
  12.       firstLoop = true
  13.     end
  14.   end
  15.   if firstLoop then
  16.       rs.setOutput(RSOutput, true)
  17.       sleep(.1)
  18.       rs.setOutput(RSOutput, false) --Notification to next computer sent
  19.       sleep(.05)
  20.       rs.setOutput("top", true)
  21.       sleep(.05)
  22.       rs.setOutput("top",false)  --set to receive
  23.       sleep(.25) --.25 will arrive at 2nd gen at 10 ticks
  24.       rs.setOutput("left",true)
  25.       sleep(0.05)
  26.       rs.setOutput("left", false)
  27.       firstLoop = false
  28.   end
  29.   if rs.getInput(RSInput) then
  30.       rs.setOutput("top", true)
  31.       rs.setOutput(RSOutput, true)
  32.       sleep(.05)
  33.       rs.setOutput("top",false) --pearl fired
  34.       sleep(.05)
  35.       rs.setOutput(RSOutput, false) --Notification to next computer sent
  36.       sleep(.05)
  37.       rs.setOutput("top", true)
  38.       sleep(.05)
  39.       rs.setOutput("top",false)  --set to receive    
  40.   end
  41.   sleep(.05)
  42. end
Add Comment
Please, Sign In to add comment