Facebook
From Emerald Hog, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 227
  1. local x = 3
  2. local y = 1
  3. local z = 4
  4. local fuel = 0
  5. local Verbrauch = 0
  6.  
  7. -- function FuelCount()
  8.         -- if (Verbrauch > turtle.getFuelLevel()) then
  9.                 -- write(tostring(Verbrauch))
  10.                 -- write(" > ")
  11.                 -- term.write(tostring(turtle.getFuelLevel()))
  12.         -- end
  13. -- end
  14.  
  15. function VerbrauchErmitteln()
  16.         Verbrauch = 14.8571 * radius * radius - 10.0571 * radius + 12.2
  17. end
  18.  
  19. function fforward()
  20.         while (turtle.forward() == false) do
  21.                 fdig()
  22.                 sleep(0.4)
  23.         end
  24.         fuel = fuel + 1
  25. end
  26.  
  27. function fdigUp()
  28.         while(turtle.detectUp()) do
  29.         turtle.digUp()
  30.         sleep(0.4)
  31.         end
  32. end
  33.  
  34. function fdig()
  35.         while(turtle.detect()) do
  36.                 turtle.dig()
  37.                 sleep(0.4)
  38.         end
  39. end
  40.  
  41. function Reihe()
  42.         turtle.turnRight()
  43.         fdig()
  44.         fdigUp()
  45.         turtle.up()
  46.         fdig()
  47.         turtle.turnLeft()
  48.         turtle.turnLeft()
  49.         fdig()
  50.         turtle.down()
  51.         fdig()
  52.         turtle.turnRight()
  53.         turtle.digDown()
  54.         turtle.down()
  55.         turtle.turnRight()
  56.         fdig()
  57.         turtle.turnLeft()
  58.         turtle.turnLeft()
  59.         fdig()
  60.         turtle.turnRight()
  61.         turtle.up()    
  62.         fuel = fuel + 4
  63. end
  64.  
  65. function Block()
  66.         fforward()
  67.         for i = 1, x - 1 do
  68.                 Reihe()
  69.                 fforward()
  70.         end
  71.         Reihe()
  72.         turtle.back()
  73.         turtle.turnRight()
  74.         turtle.forward()
  75.         fuel = fuel + 2
  76. end
  77.  
  78. print("Hallo Welt!")
  79. term.write("Radius? ")
  80. radius = tonumber(read())
  81. VerbrauchErmitteln()
  82. while (Verbrauch > turtle.getFuelLevel()) do
  83.         term.write("Radius? ")
  84.         radius = tonumber(read())
  85.         VerbrauchErmitteln()
  86. end
  87. Block()
  88. while z < radius do
  89.         x = 3 * y
  90.         Block()
  91.         Block()
  92.         y = y + 1
  93.         z = z + 3
  94. end
  95. write("Verbrauchte Energie: ")
  96. write(tostring(fuel))