martin0leung

branchmine

Jun 23rd, 2013
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. print("Welcome to BranchMine program!")
  2. print("place torches on slot 16")
  3. print("type how far you want to mine!")
  4.  
  5. local input = nil
  6. local start = 0
  7.  
  8. function clear()
  9.    term.clear()
  10.    term.setCoursorPos(1,1)
  11. end
  12.  
  13. while input == nil do
  14.    input = tonumber(read())
  15.    if input == 0 then
  16.       start = 1
  17.    else
  18.       start = input
  19.    end
  20.    if input == nil then
  21.       print("Try again!")
  22.    end
  23. end
  24.  
  25. local intorch = nil
  26. local stop = 0
  27.  
  28. while intorch == nil do
  29.    print("type how many blocks bwetwen each torch placed")
  30.    intorch = tonumber(read())
  31.    if intorch == 0 then
  32.       stop = 1
  33.    else
  34.       stop = intorch
  35.    end
  36.    if intorch == nil then
  37.       print("Try again!")
  38.    end
  39. end
  40.  
  41. while input > 0 do
  42.   shell.run("minefor",intorch)
  43.   turtle.select(16)
  44.   turtle.placeUp()
  45.   turtle.select(1)
  46.   input = input - 1
  47. end
Advertisement
Add Comment
Please, Sign In to add comment