Guest User

Untitled

a guest
May 14th, 2013
471
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.32 KB | None | 0 0
  1.  
  2. shell.run('clear')
  3. logoSplash1 = [===[
  4.  _____                      _  
  5. /  ___|                    | |  
  6. \ `--. _ __ ___   __ _ _ __| |_
  7.  `--. \ '_ ` _ \ / _` | '__| __|
  8. /\__/ / | | | | | (_| | |  | |_
  9. \____/|_| |_| |_|\__,_|_|   \__|
  10.                                
  11. ]===]
  12. logoSplash2 = [===[
  13.  _____          _   _      
  14. |_   _|        | | | |    
  15.   | |_   _ _ __| |_| | ___
  16.   | | | | | '__| __| |/ _ \
  17.  | | |_| | |  | |_| |  __/
  18.  \_/\__,_|_|   \__|_|\___|
  19.  
  20. ]===]
  21. logoSplash3 = [===[
  22. _____ _____
  23. |  _  /  ___|
  24. | | | \ `--.
  25. | | | |`--. \
  26. \ \_/ /\__/ /
  27. \___/\____/
  28.            
  29. ]===]
  30. print (logoSplash1)
  31. os.sleep(1)
  32. shell.run('clear')
  33. print (logoSplash2)
  34. os.sleep(1)
  35. shell.run('clear')
  36. print (logoSplash3)
  37. os.sleep(1)
  38. shell.run('clear')
  39. print("SmartTurtleOS 1.0")
  40. --[[ SMART VARIABLES ]]--
  41. height = 0
  42. --[[ END OF SMART VARIABLES ]]--
  43.  
  44.  
  45. --[[ SMART FUNCTIONS ]]--
  46.  
  47. --[[smart refuel]]--
  48. function smartRefuel()
  49.     if turtle.getFuelLevel() < 1 then
  50.         turtle.select(1)
  51.         turtle.refuel(1)
  52.     end
  53. end
  54.  
  55. --[[smart dig]]--
  56. function smartDig()
  57.     turtle.attack()
  58.     while turtle.detect() == true do
  59.         turtle.dig()
  60.     end
  61. end
  62.  
  63. --[[smart digUp]]--
  64. function smartDigUp()
  65.     turtle.attackUp()
  66.     while turtle.detectUp() == true do
  67.         turtle.digUp()
  68.     end
  69. end
  70.  
  71. --[[smart digDown]]--
  72. function smartDigDown()
  73.     turtle.attack()
  74.     while turtle.detectDown() == true do
  75.         turtle.digDown()
  76.     end
  77. end
  78.  
  79. --[[smart moveForward]]--
  80. function smartMoveForward(distance)
  81. local distance = distance or 1
  82.     for i=1,distance do
  83.     smartRefuel()
  84.         while turtle.forward() == false do
  85.             if turtle.detect() == true then
  86.                 turtle.dig()
  87.                 else
  88.                 turtle.attack()
  89.             end
  90.         end
  91.     end
  92. end
  93.  
  94. --[[smart moveUp]]--
  95. function smartMoveUp(distance)
  96. local distance = distance or 1
  97.     for i=1,distance do
  98.     smartRefuel()
  99.         while turtle.up() == false do
  100.             if turtle.detectUp() == true then
  101.                 turtle.digUp()
  102.                 else
  103.                 turtle.attackUp()
  104.             end
  105.         height = height + 1
  106.         end
  107.     end
  108. end
  109.  
  110. --[[smart moveDown]]--
  111. function smartMoveDown(distance)
  112. local distance = distance or 1
  113.     for i=1,distance do
  114.     smartRefuel()
  115.         while turtle.down() == false do
  116.             if turtle.detectDown() == true then
  117.                 turtle.digDown()
  118.                 else
  119.                 turtle.attackDown()
  120.             end
  121.         height = height - 1
  122.         end
  123.     end
  124. end
  125.  
  126. --[[ END OF SMART FUNCTIONS ]]--
Advertisement
Add Comment
Please, Sign In to add comment