Advertisement
Guest User

batch

a guest
Oct 21st, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.36 KB | None | 0 0
  1. local file = ...
  2. if not file or not fs.exists(file) then
  3.   print("Usage: "..shell.getRunningProgram().." <path>")
  4.   return
  5. end
  6. local handle = fs.open(file, "r")
  7. local commands = {}
  8. local line = handle.readLine()
  9. while line do
  10.   commands[#commands + 1] = line
  11.   line = handle.readLine()
  12. end
  13. handle.close()
  14. for _,cmd in pairs(commands) do
  15.   shell.run(cmd)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement