Advertisement
Guest User

Use

a guest
Apr 18th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. tool = 13
  2. itemtest = 14
  3. activator = 15
  4. wrench = 16
  5. if turtle.getItemCount(tool) == 0 then
  6.   noTool = true
  7. end
  8.  
  9. function organize()
  10.   for i = 1, 16 do
  11.     turtle.select(i)
  12.     s1=turtle.getItemDetail()
  13.     if s1 and s1.name == "ThermalExpansion:Device" then
  14.       turtle.transferTo(15)
  15.     end
  16.     if s1 and s1.name == "BuildCraft|Core:wrenchItem" then
  17.       turtle.transferTo(16)
  18.     end
  19.   end
  20. end
  21.  
  22. function Orient()    
  23.   turtle.back()
  24.   turtle.select(activator)
  25.   turtle.place()
  26.   turtle.select(itemtest)
  27.   while turtle.drop(1) == false do
  28.     turtle.select(wrench)
  29.     turtle.place()
  30.     turtle.select(itemtest)
  31.   end
  32.   turtle.select(tool)
  33.   turtle.drop()
  34.   turtle.select(itemtest)
  35.   while turtle.suck(1) == false do
  36.     turtle.select(wrench)
  37.     turtle.place()
  38.     turtle.select(itemtest)
  39.   end
  40. end
  41.  
  42. function use()
  43.   rs.setAnalogOutput("front",15)
  44.   sleep(1)
  45.   rs.setAnalogOutput("front",0)
  46. end
  47.  
  48. function restore()
  49.   if noTool == false then
  50.     while turtle.suck() == false do
  51.       turtle.select(wrench)
  52.       turtle.place()
  53.       turtle.select(tool)
  54.     end
  55.     turtle.dig()
  56.   else
  57.     turtle.dig()
  58.   end
  59. end
  60.  
  61. function execute()
  62.   Orient()
  63.   sleep(1)
  64.   use()
  65.   sleep(3)
  66.   restore()
  67.   turtle.forward()
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement