dr-scripts icon indicating copy to clipboard operation
dr-scripts copied to clipboard

Script and example profile settings to run yaml autostarts.

Open robbintt opened this issue 3 years ago • 8 comments

Add a script to autostart scripts according to a YAML configuration.

When added to dependency autostart, this script creates an alternative path for autostart scripts to be configurable as code, per character, in profiles/my.yaml.

FUTURE: integrate this more tightly into dependency.

robbintt avatar Jun 27 '21 21:06 robbintt

The idea of migrating autostarts into yamls, and away from the db is probably in general a good idea, however I'm not sure this PR is ready for merging:

  • The new autostart script still needs to be added to an autostart (dependency's autostart or it will fail because it makes use of dr-scripts calls) but isn't managed in any way with this PR.
  • It doesn't support global vs character autostarts which is a loss of functionality comparatively
  • Further complicates the already confusing autostart situation for people ( https://xkcd.com/927 )

vtcifer avatar Jun 28 '21 00:06 vtcifer

I use a separate script that autostarts all the stuff I want and is called by the global autostart after dependency starts. The script also keeps the stuff running if it exits for some reason.

Example: start_script('jail-buddy') if not Script.running?('jail-buddy')

Dartellum avatar Jun 28 '21 01:06 Dartellum

My two cents -

I would love to have a more configurable autostart mechanism - that can handle dependencies or readiness checks (some scripts don't run well until other things are up and ready), Dart's optional restarting if things drop for some reason, etc.

I think I would happily give up "do this for all my characters" in order to get it, since it's easy to copy paste a block of text into a YAML.

wstampley avatar Jun 28 '21 03:06 wstampley

I agree with what everyone has said above.

I also like the idea behind this pull request -- moving the autostart config to yaml. We field questions pretty often from people having issues with their autostarts, and it doesn't help that Lich has it's own "autostart" function and our fork has a different mechanism that's also called "autostart" (e.g. ;autostart vs. ;e autostart)

Since dependency is already doing the effort to run autostarts configured in the database, and it loads up the yamls, I think we could add the hook to dependency's SetupFiles.run_queue method. By that time the core scripts should be loaded and the yaml's will be loaded. That avoids people needing to add anything to their ;e autostart -- just add things to your yaml and they'll run. Another advantage is that the yaml could support arguments being passed to scripts ;)

KatoakDR avatar Jun 28 '21 03:06 KatoakDR

I'm worried about merging this in, only to have yet another way to do it in the future. I'm inclined to wait on this PR until it integrates with dependency. Thoughts?

rpherbig avatar Jul 05 '21 01:07 rpherbig

Just reiterating my thoughts, but I agree with your worries. IMO if we're going to introduce a new way of doing autostarts, which people already get confused by, it should replace the old way fully, before it gets merged.

vtcifer avatar Jul 06 '21 20:07 vtcifer

Yes to manage autostarts via yaml instead of ;e autostart :100:. Agree on killing off the old one though as part of this.

rcuhljr avatar Jul 07 '21 03:07 rcuhljr

Hi @robbintt Do you plan to come back to this? Or shall we close it off? Thanks!

MahtraDR avatar Feb 13 '22 20:02 MahtraDR

@robbintt @MahtraDR

Bump

Kiriawen avatar Jan 16 '23 03:01 Kiriawen

Closing this one out as abandoned.

MahtraDR avatar Feb 23 '23 11:02 MahtraDR