Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bExit = false;
- fs.makeDir(".taskprograms")
- local files = fs.list(".taskprograms")
- function isTasked(programname)
- return fs.exists(".taskprograms/" ..programname)
- end
- local run = function()
- shell.run("clear") --Just trying to be lazy and expose you to viruses :)
- print(os.version())
- for i = 1,#files do
- shell.run(".taskprograms/" ..files[i])
- end
- print("Background Programs: ")
- for i = 1,#files do
- write(files[i].. ", ")
- end
- local tCommandHistory = {}
- while not bExit do
- write( shell.dir() .. "> " )
- local sLine = read( nil, tCommandHistory )
- table.insert( tCommandHistory, sLine )
- local tWords = {}
- for match in string.gmatch(sLine, "[^ \t]+") do
- table.insert( tWords, match )
- end
- local sCommand = tWords[1]
- if sCommand then
- if sCommand == "/mult" then
- if tWords[2] then
- if fs.exists(".taskprograms/" ..tWords[2]) then
- print("Already added!")
- else
- if fs.exists(tWords[2]) then
- fs.copy(tWords[2], ".taskprograms/" ..tWords[2])
- print("Added!")
- shell.run(tWords[2])
- else
- print("No such program (" ..tWords[2].. ")")
- end
- end
- else
- print("Usage: /mult <file name>")
- end
- else
- shell.run( sCommand, unpack( tWords, 2 ) )
- end
- end
- end
- end
- run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement