So I'm really amateur when it comes to programming but I've been tweaking a dock script to add in some functionality. I have made it so that when I mouse over a game in the dock it switches my Wallpaper Engine wallpaper to one specific to that game. It does this by using Wallpaper Engines command line controls and running commands with the RunCommand plugin to switch Wallpaper.
It works fine for switching it over but the problem comes when I move my mouse too quickly over too many icons and it causes Wallpaper Engine to crash because it is trying to switch to too many things too fast. I'm just wondering if there is any way to optimize this script so that it only switches after a rest period. I've tried using !Delay to try to give it some time but I still get crashes with a 1 second delay. I'm sorry if I'm asking too much here and feel free to tell me to take it up with Wallpaper Engine to try to fix this. Thank you!
Ponyboy wrote: ↑August 5th, 2020, 4:00 pm
So I'm really amateur when it comes to programming but I've been tweaking a dock script to add in some functionality. I have made it so that when I mouse over a game in the dock it switches my Wallpaper Engine wallpaper to one specific to that game. It does this by using Wallpaper Engines command line controls and running commands with the RunCommand plugin to switch Wallpaper.
It works fine for switching it over but the problem comes when I move my mouse too quickly over too many icons and it causes Wallpaper Engine to crash because it is trying to switch to too many things too fast. I'm just wondering if there is any way to optimize this script so that it only switches after a rest period. I've tried using !Delay to try to give it some time but I still get crashes with a 1 second delay. I'm sorry if I'm asking too much here and feel free to tell me to take it up with Wallpaper Engine to try to fix this. Thank you!
What I would do is trigger the RunCommand execution through another "counter" measure (basically just a Calc measure) that would get disabled / enabled on mouse leave / over. The counter measure would start disabled and simply count the number of updates that passed since the measure has been enabled (i.e. since the mouse is over the meter), then in an IfCondition added to the counter measure I would check if the desired number of updates has passed (i.e. if the measure value is greater than the desired number) and only then command the RunCommand measure to run.