Addon that launches script on play and pause

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Addon that launches script on play and pause

Re: Addon that launches script on play and pause

by Eyal » Thu May 23, 2024 10:22 am

Hi Onweerwolf,

It's been a very long time... since I didn't made programmation.

I'm pretty sure it's possible do do it.
If I take snippets of my Silence between Songs script, you need to use something like this:

Code: Select all

' Register Play and Stop event:
Script.RegisterEvent SDB, "OnPlay", "PlayerOnPlay"
Script.RegisterEvent SDB, "OnTrackEnd", "PlayerTrackEnd"
And then make subroutines to call your external batch file:

Code: Select all

' This will be executed when track starts playing:
Sub PlayerOnPlay()
	your code here
End Sub

Code: Select all

' This will be executed when track stops playing:
Sub PlayerTrackEnd()
	your code here
End Sub
To disable everything:

Code: Select all

Script.UnregisterEvents SDB
I hope it helps.
Peace

Re: Addon that launches script on play and pause

by Onweerwolf » Thu Feb 22, 2024 4:49 pm

That doesn't seem to be what I am looking for. Do you mean that there is something in this script that i can use? Might be but I can't use that from only a mmip file.

Re: Addon that launches script on play and pause

by Erwin Hanzl » Wed Feb 21, 2024 9:13 am

Addon that launches script on play and pause

by Onweerwolf » Wed Feb 21, 2024 8:20 am

Hiya,

I am sure this is possible. I searched for something usable but could not find it.

I am looking for an addon (or two different ones) that does two things:

1. It checks if MM has stopped playing for x seconds or longer and if so executes an external batch file
2. When MM starts playing it executes an external batch file

Can anyone help me out?

Top