Advertisement
legoldy

goldens initial turtle program

Feb 28th, 2014
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. function pastebin_get( name, code )
  2. local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode(code))
  3. if response then
  4.    local file = fs.open(name,"w")
  5.    local sCode = response.readAll()
  6.    response.close()
  7.    file.write(sCode)
  8.    file.close()
  9. else
  10.    error("Error getting the file " .. name, 0)
  11. end
  12. end
  13.  
  14. print ("please dont forget to label this bot. its defualt name will be BBB =BASA Builder Bot=")
  15.  
  16. sleep(4.0)
  17. term.clear()
  18.  
  19. for slot = 1,16 do
  20.   turtle.select(slot)
  21.   turtle.refuel(1)
  22.   turtle.drop(1)
  23.   if slot == 8 then
  24.     print("50% complete")
  25.   end
  26. end
  27. turtle.select(1)
  28. print("refuel done")
  29.  
  30. sleep(3.0)
  31. term.clear()
  32.  
  33. print ("predicted fuel, 16000")
  34.  
  35. sleep(2.0)
  36.  
  37. print ("current fuel level",turtle.getFuelLevel())
  38.  
  39. sleep(2.0)
  40. term.clear()
  41. print ("getting BASA Builder Bot programs ... please hold.")
  42.  
  43. sleep(3.0)
  44. term.clear()
  45.  
  46. pastebin_get( "startup", "wiC47VDr" )
  47.  textutils.slowPrint (" standard startup downloaded...")
  48. sleep(1)
  49. pastebin_get( "Shape_Builder", "gtdt3t0i" )
  50.  textutils.slowPrint ("Shape_Builder downloaded...")
  51. sleep(1)
  52. pastebin_get( "adv_mine", "9WuGM99n" )
  53.  textutils.slowPrint ("advanced mine downloaded...")
  54.  
  55. sleep(3.0)
  56. term.clear()
  57.  
  58. turtle.turnRight()
  59. turtle.turnRight()
  60.  
  61. turtle.forward()
  62.  
  63. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement