Advertisement
tmtowtdi

bin/go_box

Oct 26th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.93 KB | None | 0 0
  1. --go_box HaNYCNZM 1478290485
  2.  
  3. --[[
  4.   Returns to one spot above your
  5.   selected box and dumps inventory into
  6.   the box.
  7.     > bin/go_box
  8.     > bin/go_box 100
  9. --]]
  10.  
  11. local args   = {...}
  12. function die_usage()
  13.   print("---------------------------------------")
  14.   print("bin/go_box [height] [, name]")
  15.   print("")
  16.   print("Send the turtle to one block above a")
  17.   print("named box (set with bin/find_box).")
  18.   print("")
  19.   print("height - how high to fly up first.")
  20.   print("  Defaults to 100.")
  21.   print("name - which box to go to.  Defaults")
  22.   print("  to 'box'.")
  23.   print("---------------------------------------")
  24. end
  25. if args[1] == "-h" then die_usage() return end
  26.  
  27. if not turtle then error("This is not a turtle!") end
  28. if not os.loadAPI("lib/move") then return end
  29.  
  30. local highest = args[1] or 100
  31. local name    = args[2] or 'box'
  32. move.return_to_box(highest, name)
  33. move.dump_inv("dn")
  34.  
  35.  -- vim: syntax=lua ts=2 sw=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement