--[[ $VER: MPlayerAdder 1.0 (27.01.2014) jPV/RNO Add files to (running) MPlayer - use with Ambient for example Installation: 1) Copy MPlayerAdder.lua to SYS:S/ 2) Configure mplayer_exe path below Usage: LuaX MPlayerAdder.lua PLAY Tips with Ambient mimetypes: - Example command: (AmigaDOS) MOSSYS:C/LuaX S:MPlayerAdder.lua PLAY %sp If you have problems using the script, please check if you have old version of Lua installed in SYS: Use MOSSYS:C/LuaX for the correct version. ]] require 'base' require 'string' require 'ipc' -- CONFIG local mplayer_exe = 'Utils:Media/MPlayer/MPlayer' local mplayer_options = '-gui 1' -- END OF CONFIG local mplayer_port = 'MPLAYER.1' local cmd=string.upper(arg[1]) if not (cmd == 'PLAY') then error('Unknown CMD argument! RTFM',0) end if not ipc.checkport(mplayer_port) then address('COMMAND') rx('run >nil: "'..mplayer_exe..'" '..mplayer_options..' "'..arg[2]..'"') return end address(mplayer_port) rx('RAW gui_play') rx('LOADFILE '..arg[2])