Jump to content

fake load assembly


Weer36

Recommended Posts

Hi everyone!

I'm trying to change product inside plugin with running quester profile or just inside quester profile with following code:

new Thread(() => {
                wManager.Plugin.PluginsManager.DisposeAllPlugins();
                robotManager.Products.Products.DisposeProduct();
                robotManager.Products.Products.LoadProducts("Gatherer");
                robotManager.Helpful.Gatherer.Bot.GathererSetting.CurrentSetting.ProfileName = "123.xml";
                robotManager.Products.Products.ProductStart();
}).Start();

But robotManager.Helpful.Gatherer is not accessible, cuz Gatherer never started before and assembly not loaded yet.

Adding smth like Products.LoadProductsWithoutInit() won't help. Is exist any solution instead of making fake profile with Gatherer preload?

Link to comment
Share on other sites

Hello, It is

            new Thread(() => {
                wManager.Plugin.PluginsManager.DisposeAllPlugins();
                robotManager.Products.Products.DisposeProduct();
                robotManager.Products.Products.LoadProducts("Gatherer");
                Gatherer.Bot.GathererSetting.CurrentSetting.ProfileName = "123.xml";
                robotManager.Products.Products.ProductStart();
            }).Start();

(your line 5 is bad)

Link to comment
Share on other sites

Doesn't matter its mistake in post.

For clarity: when I run fake profile like:

<QuestsSorted Action="RunCode" NameClass="robotManager.Products.Products.LoadProductsWithoutInit(&quot;Gatherer&quot;);" />
<QuestsSorted Action="LoadProfile" NameClass="my_profile_with_thread_of_product_change.xml" />

then assembly Gatherer.dll have time to load.

Same successful result, if I manually select Gatherer product in UI, then select back Quester "my_profile_with_thread_of_product_change.xml"

Link to comment
Share on other sites

I'm not sure to understand all.

But my previous code should work, even if the product settings interface is not up to date (one time, if you have loaded several time gatherer dll you will get error).

Why you need to do that ? Why not use relogger application or Schedule product ?

Link to comment
Share on other sites

new Thread(() => {
    robotManager.Helpful.ArgsParser.GetArgs.Profile = "123.xml";
    robotManager.Helpful.ArgsParser.GetArgs.Product = "Gatherer";
    wManager.Plugin.PluginsManager.DisposeAllPlugins();
    robotManager.Products.Products.DisposeProduct();
    robotManager.Products.Products.LoadProducts("Gatherer");
    robotManager.Products.Products.ProductStart();
}).Start();

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...