Advertisement
denvys5

Reinforced Stone Generator

Feb 26th, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. local scaffoldn = 1
  2. local sprayn = 2
  3. local stonen = 3
  4. local t = turtle
  5.  
  6. function scaffold()
  7.  t.select(scaffoldn)
  8.  t.place()
  9. end
  10.  
  11. function spray()
  12.  t.select(sprayn)
  13.  t.place()
  14. end
  15.  
  16. function sand()
  17.  redstone.setOutput("right", true)
  18.  sleep(0.5)
  19.  redstone.setOutput("right", false)
  20.  t.select(stonen)
  21.  if t.compare() == 0 then
  22.   redstone.setOutput("right", true)
  23.   sleep(0.5)
  24.   redstone.setOutput("right", false)
  25.  end
  26.  t.select(sprayn)
  27. end
  28.  
  29. function stone()
  30.  t.select(stonen)
  31.  if t.compare() == 1 then
  32.   t.dig()
  33.  else
  34.   sleep(0.5)
  35.   if t.compare() == 1 then
  36.    t.dig()
  37.   else
  38.    sleep(0.5)
  39.    t.dig()
  40.   end
  41.  end
  42. end
  43.  
  44. function pullstone()
  45.  t.select(stonen)
  46.  t.dropUp(1)
  47. end
  48.  
  49. function main()
  50.  scaffold()
  51.  sleep(0.5)
  52.  spray()
  53.  sleep(0.5)
  54.  sand()
  55.  sleep(1)
  56.  stone()
  57.  pullstone()
  58.  sleep(0.5)
  59. end
  60.  
  61. function count()
  62.  if t.getItemCount(scaffoldn)>t.getItemCount(stonen) then
  63.   main()
  64.  end
  65. end
  66.  
  67. while true do
  68.   local event = os.pullEvent("redstone")
  69.   main()
  70.   count()
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement