Q009

ComputerCraft turtle program - mob grinder

Aug 11th, 2013
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.53 KB | None | 0 0
  1. local lastState = false
  2. local dropInterval = 0
  3.  
  4. while 1 do
  5.     if redstone.testBundledInput("top", 1) == true then
  6.         if lastState == false then
  7.             lastState = true
  8.         end
  9.         if dropInterval >= 1200 then
  10.             dropInterval = 0
  11.             for i = 1, 16, 1 do
  12.                 turtle.select(i)
  13.                 turtle.drop()
  14.             end
  15.         else
  16.             dropInterval = dropInterval + 1
  17.         end
  18.         turtle.attack()
  19.         sleep(0.1)
  20.     else
  21.         if lastState == true then
  22.             for i = 1, 16, 1 do
  23.                 turtle.select(i)
  24.                 turtle.drop()
  25.             end
  26.             lastState = false
  27.         end
  28.         sleep(10)
  29.     end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment