Advertisement
Guest User

GUIT

a guest
Jun 23rd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. function clear()
  2.   term.clear()
  3.   term.setCursorPos(1,1)
  4. end
  5.  
  6. function menu()
  7.   clear()
  8.   print("Welcome to Super's Easy To Use GUI")
  9.   print("Just Specify The Following Options and")
  10.   print("We will begin")
  11.   print()
  12.   write("How Far To Mine: ")
  13.   dist = tonumber(read())
  14.   write("Torches? (y/n): ")
  15.   tor = string.lower(read())
  16.   write("Return? (y/n): ")
  17.   ret = string.lower(read())
  18.   print()
  19.   write("Change these settings? (y/n): ")
  20.   CH = string.lower(read())
  21.  
  22.   if tor == "y" then
  23.     tor = true
  24.   else
  25.     tor = false
  26.   end
  27.  
  28.   if ret == "y" then
  29.     ret = true
  30.   else
  31.     ret = false
  32.   end
  33.  
  34.   if CH == "y" then
  35.     menu()
  36.   else
  37.     prep()
  38.   end
  39.  
  40. end
  41.  
  42. function prep()
  43.   torAm = math.floor(tonumber(dist) / 8)
  44.   turtle.select(16)
  45.   while true do
  46.     clear()
  47.     Torc = true
  48.     Che = true
  49.     curTor = turtle.getItemCount(16)
  50.     nedTor = torAm - curTor
  51.     print("Dig a tunnel "..dist.. " deep")
  52.     if tor and curTor < torAm then
  53.       Torc = false
  54.       print("Please Insert "..nedTor.." more toches")
  55.       print("In Slot 16")
  56.     end
  57.     --turtle.select(15)
  58.    
  59.     if ret and  turtle.getItemCount(15) == 0 then
  60.       print("Please Insert 1 Chest In Slot 15")  
  61.      
  62.       Che = false
  63.     end
  64.    
  65.     sleep(0.05)
  66.    
  67.     if Che and Torc then
  68.       break
  69.     end
  70.    
  71.   end
  72. end
  73.  
  74.  
  75. menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement