Advertisement
JaMaNi133

DuperTop

Aug 19th, 2024 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.20 KB | None | 0 0
  1. tntPusher = "bottom"
  2. sidePusher = "right"
  3. weirdPusher = "left"
  4. timedPusher = "top"
  5. duper = "back"
  6. networkSide = "front"
  7.  
  8. rednet.open(networkSide)
  9. while rednet.isOpen() do
  10.     senderID,message,distance,protcol = rednet.receive()
  11.     if message.command == "payload.batch.dupe" then
  12.         if message.count >= 8 then
  13.             rednet.broadcast({command="payload.duper.setCount",count=8})
  14.             sleep(0.05)
  15.             while message.count >= 8 do
  16.                 message.count = message.count - 8
  17.                 redstone.setOutput(duper,true)
  18.                 sleep(0.05)
  19.                 redstone.setOutput(duper,false)
  20.                 sleep(0.35)
  21.             end
  22.         end
  23.         sleep(0.2)
  24.         if message.count >= 1 then
  25.             rednet.broadcast({command="payload.duper.setCount",count=1})
  26.             sleep(0.05)
  27.             while message.count >= 1 do
  28.                 message.count = message.count - 1
  29.                 redstone.setOutput(duper,true)
  30.                 sleep(0.05)
  31.                 redstone.setOutput(duper,false)
  32.                 sleep(0.35)
  33.             end
  34.         end
  35.         rednet.broadcast({command="payload.duper.setCount",count=0})
  36.  
  37.         --alignment
  38.         if message.align then
  39.             sleep(0.2)
  40.             redstone.setOutput(sidePusher,true)
  41.             sleep(0.30)
  42.             redstone.setOutput(sidePusher,false)
  43.  
  44.             sleep(0.2)
  45.             redstone.setOutput(sidePusher,true)
  46.             sleep(0.05)
  47.             redstone.setOutput(sidePusher,false)
  48.            
  49.             sleep(0.2)
  50.             redstone.setOutput(tntPusher,true)
  51.             sleep(0.05)
  52.             redstone.setOutput(tntPusher,false)
  53.             sleep(0.05)
  54.             redstone.setOutput(weirdPusher,true)
  55.             sleep(0.05)
  56.             redstone.setOutput(weirdPusher,false)
  57.            
  58.  
  59.             sleep(0.2)
  60.             redstone.setOutput(sidePusher,true)
  61.             sleep(0.05)
  62.             redstone.setOutput(sidePusher,false)
  63.         end
  64.         sleep(0.2)
  65.         redstone.setOutput(tntPusher,true)
  66.         sleep(0.20)
  67.         redstone.setOutput(tntPusher,false)
  68.  
  69.         sleep(0.25)
  70.         redstone.setOutput(tntPusher,true)
  71.         sleep(0.20)
  72.         redstone.setOutput(tntPusher,false)
  73.         sleep(4-(0.05*message.fuse))
  74.         redstone.setOutput(timedPusher,true)
  75.         sleep(0.05)
  76.         redstone.setOutput(timedPusher,false)
  77.         sleep(1)
  78.         rednet.broadcast({command="payload.batch.done"})
  79.     end
  80. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement