Advertisement
Guest User

lsc

a guest
Oct 12th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. os.loadAPI('fs')
  2. local dev = false
  3. local tArgs = { ... } --args
  4. if #tArgs == 0 then --args
  5.   print('Usage: lsc <path>') --Print Usage
  6. else
  7.   local path = tArgs[1] --path
  8.   local x = fs.open(path,'r') --attempted fs access
  9.   local loop = true --loop
  10.   while loop do --loop begin
  11.     local commands = {} --empties commands
  12.     local line = x.readLine()
  13.     if line then --if the line has things
  14.       text = nil --nillifies text
  15.     for text in string.gmatch(line,"%w+") do
  16.     table.insert(commands,text)end
  17.     shell.run(string.format(line))    
  18.     else --else loop
  19.       loop = false --ends loop
  20.    end
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement