iMontouch

controller

Sep 23rd, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. -- AM2 Chunk Eater Controller
  2. -- Save as 'startup' file.
  3. local f = 0
  4. local l = 0
  5. local r = 0
  6. local b = 0
  7. local default = 0
  8. local backvar = 0
  9. local wait = 2
  10.  
  11. function front()
  12.  while(f<30) do
  13.   redstone.setOutput("back", true)
  14.   sleep(1)
  15.   redstone.setOutput("back", false)
  16.   f = f +1
  17.   sleep(wait)
  18.  end
  19.  f = 0
  20. end
  21.  
  22. function left()
  23.  while(l<4) do
  24.   redstone.setOutput("left", true)
  25.   sleep(1)
  26.   redstone.setOutput("left", false)
  27.   l = l +1
  28.   sleep(wait)
  29.  end
  30.  l = 0
  31. end
  32.  
  33. function right()
  34.  while(r<2) do
  35.   redstone.setOutput("right", true)
  36.   sleep(1)
  37.   redstone.setOutput("right", false)
  38.   r = r +1
  39.   sleep(wait)
  40.  end
  41.  r = 0
  42. end
  43.  
  44. function back()
  45.  while(b<2) do
  46.   redstone.setOutput("front", true)
  47.   sleep(1)
  48.   redstone.setOutput("front", false)
  49.   b = b +1
  50.   sleep(wait)
  51.  end
  52.  b = 0
  53. end
  54.  
  55. while(true) do
  56.  while(default<10) do
  57.   -- move 20 forward
  58.   front()
  59.   -- move 3 back
  60.   back()
  61.   -- move 3 left
  62.   left()
  63.   -- move 20 forward
  64.   front()
  65.   default = default + 1
  66.  end
  67.  default = 0
  68.  
  69.  while(backvar<4) do
  70.   back()
  71.   right()
  72.   backvar = backvar + 1
  73.  end
  74.  backvar = 0
  75.  
  76. end
Advertisement
Add Comment
Please, Sign In to add comment