Advertisement
JaMaNi133

AccDuper

Aug 21st, 2024 (edited)
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.18 KB | None | 0 0
  1. ZCount = "front"
  2. XCount = "right"
  3. ZDupe = "left"
  4. XDupe = "back"
  5. networkSide = "bottom"
  6.  
  7. function accel(nX,nZ)
  8.     redstone.setAnalogOutput(XCount,13)
  9.     redstone.setAnalogOutput(ZCount,13)
  10.     sleep(0.8)
  11.     running = true
  12.     while running do
  13.         running = false
  14.         if nX >= 10 then
  15.             redstone.setOutput(XDupe,true)
  16.             sleep(0.05)
  17.             redstone.setOutput(XDupe,false)
  18.             sleep(0.1)
  19.             nX = nX-10
  20.             running = true
  21.         else
  22.             sleep(0.15)
  23.         end
  24.         if nZ >= 10 then
  25.             redstone.setOutput(ZDupe,true)
  26.             sleep(0.05)
  27.             redstone.setOutput(ZDupe,false)
  28.             sleep(0.1)
  29.             nZ = nZ-10
  30.             running = true
  31.         else
  32.             sleep(0.15)
  33.         end
  34.     end
  35.     redstone.setAnalogOutput(XCount,nX+3)
  36.     redstone.setAnalogOutput(ZCount,nZ+3)
  37.     sleep(0.8)
  38.     redstone.setOutput(XDupe,true)
  39.     sleep(0.05)
  40.     redstone.setOutput(XDupe,false)
  41.     sleep(0.1)
  42.     redstone.setOutput(ZDupe,true)
  43.     sleep(0.05)
  44.     redstone.setOutput(ZDupe,false)
  45.     sleep(5)
  46.     rednet.broadcast({command="accelerator.done"})
  47. end
  48.  
  49. rednet.open(networkSide)
  50. while rednet.isOpen() do
  51.     id,msg = rednet.receive()
  52.     if msg.command == "accelerator.accel" then
  53.         accel(msg.countX,msg.countZ)
  54.     end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement