Advertisement
Le_JuiceBOX

[App] mineCalc.lua

Mar 29th, 2024 (edited)
726
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. -- hGmpXW4T
  2. local Terminal = require("/terminal").new()
  3. function Main()
  4.     Terminal:reset()
  5.     print("Calculate the amount of blocks this turtle can mine using mine.lua")
  6.     print()
  7.     local w = Terminal:promptNum("Enter the width:")
  8.     Terminal:reset()
  9.     print("Calculate the amount of blocks this turtle can mine using mine.lua")
  10.     print()
  11.     local h = Terminal:promptNum("Enter the height:")
  12.     Terminal:reset()
  13.     local layer = w*h
  14.     local fLevel = turtle.getFuelLevel()
  15.     local fLimit = turtle.getFuelLimit()
  16.     local limitDepth = math.floor((fLimit/layer))
  17.     local maxDepth = math.floor((fLevel/layer))
  18.     print("Results ~")
  19.     print()
  20.     print("Width: "..w)
  21.     print("Height: "..h)
  22.     print()
  23.     print("Current Fuel......."..fLevel)
  24.     print("Max depth.........."..maxDepth.." ("..math.floor(maxDepth/16).." chunks)")
  25.     print("Max depth on tank.."..limitDepth.." ("..math.floor(limitDepth/16).." chunks)")
  26.     print()
  27.     Terminal:pressAnyKeyToContinue()
  28. end
  29.  
  30. Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement