daily pastebin goal
41%
SHARE
TWEET

startup.lua

a guest Jan 29th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local input = "left"
  2. local output = "right"
  3. local control = "back"
  4. local slpDur = 3
  5.  
  6. while true do
  7.     term.clear()
  8.     term.setCursorPos(1,1)
  9.     if rs.getInput(control) then
  10.         print("working")
  11.         if turtle.getItemCount() < 1 then
  12.             turtle.suckUp(1)
  13.         end
  14.         turtle.place()
  15.         local success, data = turtle.inspect()
  16.         print(data.name)
  17.         if data.name == nil then
  18.             turtle.place()
  19.         elseif data.name == "minecraft:stone" then
  20.         --nothing
  21.         else
  22.             turtle.dig()
  23.             for i = 1, 16 do
  24.                 turtle.select(i)
  25.                 turtle.dropUp()
  26.             end
  27.             turtle.select(1)
  28.         end
  29.         sleep(slpDur)
  30.     else
  31.         print("turtle is in off state")
  32.         sleep(slpDur)
  33.     end
  34.    
  35. end
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top