Advertisement
Treyzania

Jake's Wither Killer v1.0

Mar 25th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. --== CONFIG ==--
  2.  
  3. beginSlot = 1
  4. endSlot = 2
  5.  
  6. --== END OF CONFIG ==--
  7.  
  8. local waiting = true
  9.  
  10. function attackLoop()
  11.  
  12.   while true do
  13.  
  14.     turtle.attack()
  15.    
  16.   end
  17.  
  18. end
  19.  
  20. function sleeper()
  21.   sleep(25)
  22. end
  23.  
  24. turtle.select(beginSlot)
  25. while true do
  26.  
  27.   while waiting do
  28.  
  29.     event = os.pullEvent("redstone")
  30.    
  31.     if event == "redstone" then
  32.       waiting = false
  33.     else
  34.       print("Redstone signal not turned on!  Continuing to wait.")
  35.     end
  36.    
  37.   end
  38.  
  39.   parallel.waitForAny(attackLoop, sleeper)
  40.  
  41.   shell.run("go", "down", "4")
  42.   turtle.attack()
  43.   shell.run("go", "up", "4")
  44.  
  45.   for i = beginSlot, endSlot do
  46.     turtle.select(i)
  47.     turtle.dropUp()
  48.   end
  49.   turtle.select(beginSlot)
  50.  
  51.   waiting = true
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement