Laringe

Server AECCQuarry

Oct 9th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.00 KB | None | 0 0
  1. deltaX = 25 -- This variable determines how far you want it to go on the XCoord.
  2. deltaZ = 25 -- This variable determines how far you want it to go on the ZCoord.
  3. deltaY = 80 -- This variable determines how how up you want it to go before digging down.
  4.  
  5. function up()
  6.   rednet.send(223,1)
  7.   print(up)
  8.   sleep(2)
  9. end
  10. function down()
  11.   rednet.send(223,0)
  12.   print(down)
  13.   sleep(2)
  14. end
  15. function right()
  16.   rednet.send(223,2)
  17.   print(right)
  18.   sleep(2)
  19. end
  20. function left()
  21.   rednet.send(223,3)
  22.   print(left)
  23.   sleep(2)
  24. end
  25. function forward()
  26.   rednet.send(223,4)
  27.   print(forward)
  28.   sleep(2)
  29. end
  30. function backward()
  31.   rednet.send(223,5)
  32.   print(backward)
  33.   sleep(2)
  34. end
  35.  
  36.  
  37. function cycleUp()
  38.   while deltaY < 96 do
  39.     up()
  40.     deltaY = deltaY + 1
  41.   end
  42. end
  43. function cycleDown()
  44.   while deltaY > 0 do
  45.     down()
  46.     deltaY = deltaY - 1
  47.   end
  48. end
  49. function cycleRight()
  50. local z = 0
  51.   while z ~= 8 do
  52.     right()
  53.     y = z + 1
  54.   end
  55. end
  56. function cycleLeft()
  57. local z = 8
  58.   while z ~= 0 do
  59.     left()
  60.     y = z - 1
  61.   end
  62. end
  63. function cycleForward()
  64. local x = 0
  65.   while x ~= 4 do
  66.     forward()
  67.     x = x + 1
  68.   end
  69. end
  70. function cycleBackward()
  71. local x = 0
  72.   while x ~= -5 do
  73.     backward()
  74.     x = x - 1
  75.   end
  76. end
  77.  
  78.  
  79. function switchLaneEven()
  80.   cycleDown()
  81.   cycleUp()
  82.   cycleForward()
  83. end
  84. function switchLaneOdd()
  85.   cycleDown()
  86.   cycleUp()
  87.   cycleBackward()
  88. end
  89. function switchLaneRight()
  90.   cycleRight()
  91.   sleep(.5)
  92. end
  93. function switchLaneleft()
  94.   cycleleft()
  95.   sleep(.5)
  96. end
  97.  
  98.  
  99. function cycleFullLaneEven()
  100. local xEven = deltaX
  101.   while xEven > 0 do
  102.     switchLaneEven()
  103.     sleep(2)
  104.   end
  105. end
  106. function cycleFullLaneOdd()
  107. local xOdd = deltaZ
  108.   while xOdd > 0 do
  109.     switchLaneOdd()
  110.     sleep(2)
  111.   end
  112. end
  113.  
  114.  
  115. function run()
  116.   while deltaZ ~= 0 do
  117.     cycleFullLaneEven()
  118.     sleep(2)
  119.     switchLaneRight()
  120.     deltaZ = deltaZ - 1
  121.     sleep(2)
  122.     cycleFullLaneOdd()
  123.     sleep(2)
  124.     switchLaneRight()
  125.     deltaZ = deltaZ - 1
  126.   end
  127. end
  128. rednet.open("right")
  129. run()
  130. rednet.close("right")
Advertisement
Add Comment
Please, Sign In to add comment