Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --go_home nCp8t5Q1 1478290485
- local args = {...}
- function die_usage()
- print("---------------------------------------")
- print("bin/go_home [height] [, name]")
- print("")
- print("Send the turtle to its home spot (set")
- print("with bin/set_home). ")
- print("")
- print("height - Y coord to fly to first.")
- print(" Defaults to 100.")
- print("name - which home to go to. Defaults")
- print(" to 'home'.")
- print("---------------------------------------")
- end
- if args[1] == "-h" then die_usage() return end
- if not turtle then error("This is not a turtle!") end
- if not os.loadAPI("lib/move") then return end
- local height = args[1] or 100
- local name = args[2] or 'home'
- if move.has_home(name) then
- move.go_home(height, name)
- else
- error("You don't have a home named "..name..". Set one using bin/set_home.")
- return
- end
- -- vim: syntax=lua ts=2 sw=2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement