Sorry for heaping play-related issues...I think it's my last whistle

If you /play to a target and the target isn't available (e.g. a RAW 404:"cannot sent to channel" or 401:"no such nick" is received):
- all play requests for the target are stopped (on that cid)
- "on playend" triggers for each $play(target,N) once for <target> (on that cid).

Now if you /play to a target and disconnect/get disconnected:
- all play requests with targets on that cid are stopped
- but no "on playend" triggers for each $play(N) for each <target> found in the play queue of that cid.

I think the on playent event should always apply if an item was "accepted" (added to the $play() queue) and then stopped/interrupted (not by "/play stop" but because $pnick is not available (any more)).
(Yes, it can be scripted with a loop and /signal... but that's also true for the given RAW example cases.)


Edit: I just realized that the current behaviour is not like depicted. Its target-based, not item-based (only one "on playend", per unavailable target).
Also note that if you have multiple items queued for some target and this target becomes unavailable and a playend triggers as described, $play(target,0) is not 0 but [queued -1], even if all items have been cancelled and no further event will trigger.

Albeit I would prefer to have one "on playend" per item for all cases of a premature stop of /plays, it would imply a change to parts of the current behavior (instead of an addition to it) - and could break some existing scripts.
I therefore think an "on playend" per target for disconnects would both comply with- and complement the given RAW-cases. Although that's not what I actually had in mind... smile

Sorry for all the confusion.

Last edited by Horstl; 25/07/09 03:42 AM.