Advertisement
Guest User

mobFarm.lua

a guest
Mar 13th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. local robot = require("robot")
  2. local computer = require("computer")
  3. local variables = require("variables")
  4.  
  5. function clean()
  6.   for i = 1, 16 do
  7.     robot.count(16)
  8.     robot.select(i)
  9.     if robot.count(16) > 0 then
  10.       os.sleep(1)
  11.       robot.drop(i, 64)
  12.     end
  13.   end
  14.   robot.select(1)
  15. end
  16.  
  17. while true do
  18.   if robot.detect() then
  19.      robot.swing()
  20.   else
  21.     -- print("Nothing Detected")
  22.     os.sleep(20)
  23.     if count >= 6 then
  24.       clean()
  25.     else --do nothing
  26.     end
  27.   end
  28.   count = count+1
  29.     if count > 6 then
  30.         count = 0
  31.     end
  32.    -- print(count)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement