Advertisement
artengineer08

smelter

Jan 25th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. function refillFuel()
  2.     t.select(1)
  3.     t.goto(1,0,0,3)
  4.     t.r(1)
  5.     t.goto(1,1,4,2)
  6.     --picking up any excess charcoal
  7.     for i=1,8 do
  8.         t.suck("down")
  9.     end
  10.     t.d(2)
  11.     t.w(1)
  12.     --now above charcoal chest
  13.      
  14.     for i=0,15 do
  15.         cSlot,cCount=t.findItem("charcoal")
  16.         if cSlot then
  17.             if cCount<64 then
  18.                 t.goto(1,1,3,0)
  19.                 t.suck("down")
  20.             end
  21.         else
  22.             t.goto(1,1,3,0)
  23.             t.suck("down")
  24.         end
  25.        t.goto(1,1,i,1)
  26.        t.drop("front","charcoal")
  27.     end
  28.     t.goto(1,1,3,0)
  29.     t.suck("down")
  30.     shell.run("refuel all")
  31.     t.goto(1,1,4,2)
  32.     t.dropAll("down","charcoal")
  33.     t.goto(1,1,0,1)
  34.     t.f(1)
  35.     t.goto(0,0,0,0)
  36. end --end of function refillFuel
  37.  
  38. function insertSmeltingItems()
  39.     t.select(1)
  40.     t.goto(1,0,0,3)
  41.     t.r(1)
  42.     t.goto(1,1,1,2)
  43.     --picking up all items to be smelted
  44.     for i=1,16 do
  45.         t.suck("down")
  46.     end
  47.      
  48.     for i=0,15 do
  49.         t.goto(0,2,i,2)
  50.         for j=1,16 do
  51.             t.select(j)
  52.             turtle.dropDown()
  53.         end
  54.         t.select(1)
  55.     end
  56.     t.goto(0,2,1,3)
  57.     t.w(1)
  58.     t.f(1)
  59.     for j=1,16 do
  60.         t.select(j)
  61.         turtle.dropDown()
  62.     end
  63.     t.select(1)
  64.     t.goto(1,1,0,1)
  65.     t.f(1)
  66.     t.goto(0,0,0,2)
  67. end --end of function insertSmeltingItems
  68.  
  69. function waitForFurnaces(dura)
  70.     if dura<2 then dura=2 end
  71.     print("waiting for Furnaces:    ")
  72.     for p=dura,1,-1 do
  73.         term.setCursorPos(23,1)
  74.         if p<10 then term.write("  ") end
  75.         if p<100 then term.write(" ") end
  76.         print(p)
  77.         sleep(1)
  78.     end
  79.     term.setCursorPos(1,1)
  80.     term.write("                          ")
  81. end
  82.  
  83. function collectSmeltedItems()
  84.     for k=1,16 do
  85.         t.suck("up")
  86.         if k<16 then t.w(1) end
  87.     end
  88.     t.goto(0,0,2,3)
  89.     for j=1,16 do
  90.         t.select(j)
  91.         turtle.drop()
  92.     end
  93.     t.select(1)
  94.     t.goto(0,0,0,0)
  95. end
  96.  
  97. insertSmeltingItems()
  98. read()
  99. waitForFurnaces(12) --310
  100. collectSmeltedItems()
  101. refillFuel()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement