Script to switch Channel OFF with IO-Warrior

For the first Playlist with 2 Players…this script will switch off the channel, on which the player stops in ASSIST Mode…in AUTO Mode, nothing will be switched off.

[sup]procedure OnPlayerStop(PlaylistIndex: integer; PlayerIndex: integer; Duration: TTimeValue);
var
i : integer;
begin
if (PlaylistIndex= 0) and (PlayerIndex= 1) and (CurrentPlaybackControl.GetAutomation = false) then begin
IOWarriorRemote(0).SetPort(5, true);
for i := 1 to 5000 do;
Sleep(500);
IOWarriorRemote(0).SetPort(5, false);
end;
if (PlaylistIndex= 0) and (PlayerIndex= 0) and (CurrentPlaybackControl.GetAutomation = false) then begin
IOWarriorRemote(0).SetPort(4, true);
for i := 1 to 5000 do;
Sleep(500);
IOWarriorRemote(0).SetPort(4, false);
end;

end;

begin
end.[/sup]