Author Topic: Trigger a command after a plugin has loaded  (Read 1776 times)

Malic

  • Full Member
  • ***
  • Posts: 102
Trigger a command after a plugin has loaded
« on: October 06, 2018, 11:18:50 AM »
I am writing a command that uses EDDI variables for Elite: Dangerous to make sure that the user has logged in.

If the user has not, {TXT:Name} is Not Set

For functionality of my profile, it needs to make sure that the user has logged in ,but it takes about 7 seconds from turning VA on to it giving the notification that the plugin has loaded.

raydleemsc

  • Guest
Re: Trigger a command after a plugin has loaded
« Reply #1 on: October 06, 2018, 11:25:51 AM »

raydleemsc

  • Guest
Re: Trigger a command after a plugin has loaded
« Reply #2 on: October 06, 2018, 11:31:50 AM »
Not a generic solution, so can VA confirm when all plugins have loaded?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Trigger a command after a plugin has loaded
« Reply #3 on: October 06, 2018, 11:56:23 AM »
All plugins that are set to load are loaded and initialized before profiles are loaded when VA is launched.  That way, all available plugins are accessible by any profile that is loaded.

Hope that helps!

Malic

  • Full Member
  • ***
  • Posts: 102
Re: Trigger a command after a plugin has loaded
« Reply #4 on: October 13, 2018, 12:16:17 AM »
raydleemsc's link got me the answer.

The EDDI plugin tends to load a few seconds after the profile is loaded.

I was trying to have it pull a variable that is Not Set until the plugin is live, and only when the user is logged into EDDI for it to pull data from the Elite: Dangerous player journal.

The profile was loading prior to the plugin loading and would throw out a warning, but EDDI has a trigger when it loads, and I created a new command that used to to check if the user is logged in.


Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Trigger a command after a plugin has loaded
« Reply #5 on: October 13, 2018, 08:01:41 AM »
VA calls the plugin's initialization function and it's anybody's guess what the plugin could be doing after control returns, so, VA assumes the plugin is loaded.  Maybe the EDDI folks could just set a variable on init that indicates that it's loading and then clear that variable when it's finished initializing.  Just a thought.