!752 static S mp = "Music Player"; static double interval = 1; p { S lastFile = null; int count = 0; while licensed { pcall { if (matchStart("no", send(mp, "are you playing")) && matchStart("no", send(mp, "are you paused"))) ++count; if (count >= 2) { count = 0; S file = send(mp, "get file"); if (eq(file, lastFile)) { //print("Playing again."); send(mp, "play again"); } /*else print(format("Files differ: * vs *", file, lastFile));*/ lastFile = file; } } sleepSeconds(interval); } }