Advertisement
ByteZz

Byte Industries SimpleAttack v2.0

Nov 30th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. function clearScreen() -- Clears the screen
  2.         term.clear()
  3.         term.setCursorPos(1,1)
  4. end
  5.  
  6. function attack()
  7.         while true do
  8.         turtle.attack()
  9.     end
  10. end
  11.  
  12. function attackChest()
  13.     while true do
  14.         theTimer = os.startTimer(5)
  15.                 while true do
  16.                     event,timerID = os.pullEvent("timer")
  17.                         if timerID == theTimer then
  18.                             turtle.turnRight()
  19.                             turtle.drop()
  20.                             turtle.turnLeft()
  21.                     break
  22.                 end
  23.             end
  24.     end
  25. end
  26.  
  27.  
  28.        
  29.  
  30.  
  31. function start()
  32.         clearScreen()
  33.         print("Byte Industries SimpleAttack v2.0")
  34.         local pullEvent = os.pullEvent
  35.         os.pullEvent = os.pullEventRaw
  36. end
  37.  
  38. start()
  39. while true do
  40.     parallel.waitForAny(attack, attackChest)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement