Closed CrendKing closed 4 months ago
scripts-append
doesn't work at all at runtime, hence the load-script
command. You should observe speed
in your script instead of loading it and unloading it.
scripts-append
doesn't work at all at runtime
Oops. You are right. I have a script that observe scripts
changes at runtime and call load-script
. I forgot I had it.
Sorry about this.
For what it's worth you can now do input-commands=load-script foo.lua
, but it's still better to modify your script because that loads another instance of the script everytime the condition becomes true.
Expected behavior of the wanted feature
Suppose I have the auto prifle:
and Lua script
When the playback speed increases, the Lua script may turn on hwdec depending on some external factor (that's why the script is needed). However, when the speed drops back to 1, the script does not have a mechanism to know that it is removed by the auto profile. The script makes side effect but no easy way to clean it up.
Alternative behavior of the wanted feature
Currently the workaround I come up with is to observe the
scripts
property change, which is ugly:Imagine this could become as simple as
This is possible because even the script is removed from
scripts
, the script itself will keep running until the player terminates.Log File
No response
Sample Files
No response