Advertisement
Guest User

setDir

a guest
Nov 28th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. local args = ...
  2. if args==nil then
  3.   args = ""
  4. end
  5.  
  6. if not type(args)=="string" then
  7.   term.setTextColor(colors.red)
  8.   print("The selected path must be a single string")
  9.   term.setTextColor(colors.white)
  10.   return
  11. end
  12.  
  13. if not fs.exists(args) then
  14.   term.setTextColor(colors.red)
  15.   print("The selected path doesn't exist")
  16.   term.setTextColor(colors.white)
  17.   return
  18. end
  19.  
  20. shell.setDir(args)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement