Refined LUA script to control playback and volume