Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bExit = false
- print( os.version() )
- 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
- shell.run( sCommand, unpack( tWords, 2 ) )
- if fs.exists( sCommand ) or fs.exists( "rom/programs/ ..sCommand ) then
- term.redirect(peripheral.wrap("right"))
- shell.run( sCommand, unpack( tWords, 2) )
- term.restore()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment