November 8, 20223 yr 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?
November 8, 20223 yr 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)
November 9, 20223 yr Author Doesn't matter its mistake in post. For clarity: when I run fake profile like: <QuestsSorted Action="RunCode" NameClass="robotManager.Products.Products.LoadProductsWithoutInit("Gatherer");" /> <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"
November 9, 20223 yr 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 ?
November 9, 20223 yr Author Nope, ur code isn't work, test it please as Quester profile. Shedule and relogger has no needed condition to switch profiles. Also relogger need to restart game.
November 13, 20223 yr Author error text is: Compilator Error : c:\Data\temp\2q51l50f.0.cs(107,23) : error CS0103: The name 'Gatherer' does not exist in the current context
November 14, 20223 yr 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();
Create an account or sign in to comment