lucas_csantos

GoHome

Nov 25th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. if fs.exists("HomeFile") then
  2.  
  3. local file = io.open("HomeFile","r")
  4. line = file:read()
  5. file:close()
  6. local home = {}
  7. local index = 0
  8.  
  9. for word in string.gmatch(line,"%p*%d+") do
  10. home[index] = word
  11. index = index + 1
  12. end
  13.  
  14. local hx = tonumber(home[0])
  15. local hy = tonumber(home[1])
  16. local hz = tonumber(home[2])
  17.  
  18. --Go home turtle, you're drunk
  19. shell.run("goto",hx,hy,hz)
  20.  
  21. else
  22. print("No home located, use defineHome")
  23. end
Advertisement
Add Comment
Please, Sign In to add comment