Advertisement
Guest User

startup

a guest
Mar 6th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1. function doIHasDirt()
  2.   local PlisBeDirt = turtle.getItemDetail(1)
  3.   if(PlisBeDirt) then
  4.     if (PlisBeDirt.name:match("dirt")) then
  5.       return true
  6.     end
  7.   end
  8.   return false
  9. end
  10.  
  11. function theGypsiesHaveCome()
  12.   local IDONTKNOWWHATTHISVARIABLEDOESBUTITNEEDSTOBEHEREFORSOMEREASON,PlisBeCursed = turtle.inspectUp()
  13.   if PlisBeCursed.name then
  14.     if PlisBeCursed.name:find("cursed") then
  15.       return true
  16.     end
  17.   end
  18.   return false
  19. end
  20.  
  21. function NOCURSENO()
  22.   turtle.select(16)
  23.   redstone.setOutput("front",true)
  24.   repeat
  25.     local IDONTKNOWWHATTHISVARIABLEDOESBUTITNEEDSTOBEHEREFORSOMEREASON,PlisDontBeCursed = turtle.inspectUp()
  26.   until not PlisDontBeCursed.name
  27.   redstone.setOutput("front",false)
  28.   turtle.suckUp()
  29.   turtle.dropDown()
  30. end
  31.  
  32. function placeDIRT()
  33.   turtle.select(1)
  34.   return turtle.placeUp()
  35. end
  36.  
  37. function talkToMeBaby()
  38.   return os.pullEvent("key")
  39. end
  40.  
  41. redstone.setOutput("front",false)
  42. term.clear()
  43. print("Fine, I guess I'll do your dirty work for you.")
  44. args={ ... }
  45.  
  46. function farmTheGypsies()
  47.   while(1) do
  48.     count=0
  49.     turtle.select(1)
  50.     while not doIHasDirt() do
  51.       --sleep(1)
  52.       turtle.suckDown(63)
  53.       count=count+1
  54.       if count==20 then
  55.         term.clear()
  56.         local w,h=term.getSize()
  57.         term.setCursorPos(w,1)
  58.         print("Waiting for dirt. Press any key to continue.")
  59.         talkToMeBaby()
  60.         count=0
  61.       end
  62.     end  
  63.     if theGypsiesHaveCome() then
  64.      
  65.     else
  66.       placeDIRT()
  67.     end
  68.   end
  69. end
  70.  
  71. farmTheGypsies()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement