SHARE
TWEET

mine.lua

a guest Aug 24th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. io.write("Masukan Panjang ruangan (bagian depan turtle) : ")
  2. local panjang = read()
  3. io.write("Lebar ruangan ke kiri / kanan : ")
  4. local arah = read()
  5. local left = false
  6. if arah == "kiri" then
  7.     left = true
  8. else
  9.     arah = "kanan"
  10. end
  11. io.write("Masukan Lebar ruangan (arah "..arah..") : ")
  12. local lebar = read()
  13. io.write("Tinggi ruangan ke atas / bawah : ")
  14. local arah = read()
  15. local up = false
  16. if arah == "atas" then
  17.     up = true
  18. else
  19.     arah = "bawah"
  20. end
  21. print("Masukan Tinggi ruangan (arah "..arah..") : ")
  22. local tinggi = read()
  23.  
  24. local volume = panjang*lebar*tinggi
  25. local counter = 1
  26. for i=1, tinggi do
  27.     if i>1 then
  28.         if up == true then
  29.             turtle.digUp()
  30.             while turtle.up() == false do
  31.                 turtle.attack()
  32.                 turtle.attackUp()
  33.                 turtle.attackDown()
  34.                 turtle.suck()
  35.             end
  36.             turtle.up()
  37.             turtle.turnLeft()
  38.             turtle.turnLeft()
  39.         else
  40.             turtle.digDown()
  41.             while turtle.down() == false do
  42.                 turtle.attack()
  43.                 turtle.attackUp()
  44.                 turtle.attackDown()
  45.                 turtle.suck()
  46.             end
  47.             turtle.down()
  48.             turtle.turnLeft()
  49.             turtle.turnLeft()
  50.         end
  51.         counter = counter+1
  52.     end
  53.     for j=1, lebar do
  54.         if j>1 then
  55.             if left == true then
  56.                 turtle.turnLeft()
  57.                 turtle.dig()
  58.                 while turtle.forward() == false do
  59.                     turtle.attack()
  60.                     turtle.attackUp()
  61.                     turtle.attackDown()
  62.                     turtle.suck()
  63.                 end
  64.                 turtle.forward()
  65.                 turtle.turnLeft()
  66.                 left = false
  67.             else
  68.                 turtle.turnRight()
  69.                 turtle.dig()
  70.                 while turtle.forward() == false do
  71.                     turtle.attack()
  72.                     turtle.attackUp()
  73.                     turtle.attackDown()
  74.                     turtle.suck()
  75.                 end
  76.                 turtle.forward()
  77.                 turtle.turnRight()
  78.                 left=true
  79.             end
  80.             counter = counter+1
  81.         end
  82.         for k=1,panjang-1 do
  83.             term.clear()
  84.             term.setCursorPos(1,1)
  85.             local progress = counter/volume * 100
  86.             print("Volume Ruangan : "..volume)
  87.             print("Progress : "..progress.."%")
  88.             print("Fuel : "..turtle.getFuelLevel())
  89.             counter = counter +1
  90.             turtle.dig()
  91.             turtle.suck()
  92.             while turtle.forward() == false do
  93.                 turtle.attack()
  94.                 turtle.attackUp()
  95.                 turtle.attackDown()
  96.                 turtle.suck()
  97.             end
  98.             turtle.forward()      
  99.         end
  100.     end
  101. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top