Advertisement
rhn

Thermalily

rhn
Mar 24th, 2020
440
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.60 KB | None | 0 0
  1. --X X X F X
  2. --F X L X X
  3. --X L T L X
  4. --X X L X F
  5. --X F X X X
  6.  
  7. -- F= Thermalily flower, T= Turtle, L= Pit for Lava, X= Any fireproof material
  8.  
  9. print("Thermalily x4 feeder: https://pastebin.com/kiND0X1S")
  10.  
  11.  
  12. tanklist={"Above", "Below"}
  13. if (fs.exists("choices") == false) then --Check if this is first time run, no saved choices on file
  14. while true do --Asks for type of crops
  15.         print("Where is the lava tank located?")
  16.         for i=1, #tanklist do
  17.             print(i..". "..tanklist [i])
  18.         end
  19.         local answer = read()
  20.         if tonumber(answer)==nill then
  21.             print("-Wrong answer, input not a number-")
  22.         else
  23.             local answerv = tonumber(string.format("%." .. 0 .. "f", answer))
  24.             if (0 < answerv and answerv <= #tanklist ) then
  25.                 pick=answerv
  26.                 --print("Tank location chosen: ", tanklist [answerv])
  27.                 break
  28.             else
  29.                 print("-Wrong answer, input does not match range of choices-")
  30.             end
  31.         end
  32. end
  33.  
  34. --Write choices to file
  35. local file = fs.open("choices","w")
  36. file.writeLine("pick="..tostring(pick))
  37. file.close()
  38.  
  39. end
  40.  
  41. os.loadAPI("choices") -- Reads choices from file
  42. local pick= choices.pick
  43.  
  44. print("Starting in 6 minutes")
  45. sleep(90*4)
  46. while true do
  47.     if redstone.getInput("top")==false then
  48.     if pick==1 then
  49.         turtle.placeUp()
  50.     elseif pick==2 then
  51.         turtle.placeDown()
  52.     end
  53.     sleep(0.5)
  54.     data = turtle.getItemDetail(1)
  55.     if string.find(data.name,"minecraft:lava_bucket") then
  56.         turtle.place()
  57.         turtle.turnLeft()
  58.     end
  59.     sleep(80)
  60.     end
  61.     sleep(10)
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement