public static string version = "2.0.18"; // Must match version in Version.txt public void Initialize() { isLaunched = true; AutoEquipSettings.Load(); if (AutoUpdater.CheckUpdate(version)) { Logger.Log("New version downloaded, restarting, please wait"); ToolBox.Restart(); return; } Logger.Log($"Launching version {version} on client {WoWVersion}"); AutoDetectMyClassSpec(); LoadWantedItemTypesList(); WAECharacterSheet.RecordKnownSkills(); detectionPulse.DoWork += BackGroundPulse; detectionPulse.RunWorkerAsync(); EventsLua.AttachEventLua("CHARACTER_POINTS_CHANGED", e => AutoDetectMyClassSpec()); EventsLua.AttachEventLua("SKILL_LINES_CHANGED", e => WAECharacterSheet.RecordKnownSkills()); EventsLua.AttachEventLua("QUEST_COMPLETE", e => WAEQuest.QuestRewardGossipOpen = true); EventsLuaWithArgs.OnEventsLuaStringWithArgs += OnLuaEventsWithArgs; wManager.Events.OthersEvents.OnSelectQuestRewardItem += WAEQuest.SelectReward; LUASetup(); }
protected override async void OnStartup(StartupEventArgs e) { IsDebug = e.Args.Contains("debug"); IsConsole = e.Args.Contains("console"); NoUpdate = e.Args.Contains("noupdate"); if (IsConsole && !ConsoleManager.HasConsole) { ConsoleManager.Show(); } if (!NoUpdate) { var autoUpdater = new AutoUpdater("BoltunovOleg", "ChatRoulette", Assembly.GetExecutingAssembly()); var t = await autoUpdater.CheckUpdate(); if (t) { var release = await autoUpdater.GetLatestRelease(); autoUpdater.ShowReleaseInfo(release); App.Current.Shutdown(0); } } base.OnStartup(e); }
public void Initialize() { ZETBCFCSettings.Load(); AutoUpdater.CheckUpdate(version); Log($"FC version {version}. Discovering class and finding rotation..."); var type = Type.GetType(wowClass); wowVersion = Lua.LuaDoString <string>("v, b, d, t = GetBuildInfo(); return v"); Log($"Wow version : {wowVersion}"); if (type != null) { _isLaunched = true; // Fight end FightEvents.OnFightEnd += (ulong guid) => { wManager.wManagerSetting.CurrentSetting.CalcuCombatRange = _saveCalcuCombatRangeSetting; HMPrunningAway = false; }; // Fight start FightEvents.OnFightStart += (WoWUnit unit, CancelEventArgs cancelable) => { wManager.wManagerSetting.CurrentSetting.CalcuCombatRange = false; HMPrunningAway = false; }; // HMP run away handler robotManager.Events.LoggingEvents.OnAddLog += (Logging.Log log) => { if (log.Text == "[HumanMasterPlugin] Starting to run away") { Log("HMP's running away feature detected. Disabling FightClass"); HMPrunningAway = true; } else if (log.Text == "[HumanMasterPlugin] Stop fleeing, allow attacks again") { Log("Reenabling FightClass"); HMPrunningAway = false; } }; if (!Talents._isRunning) { _talentThread.DoWork += Talents.DoTalentPulse; _talentThread.RunWorkerAsync(); } type.GetMethod("Initialize").Invoke(null, null); } else { LogError("Class not supported."); Products.ProductStop(); } }
public void Initialize() { AIOTBCSettings.Load(); AutoUpdater.CheckUpdate(version); Logger.Log($"Launching version {version} on client {Lua.LuaDoString<string>("v, b, d, t = GetBuildInfo(); return v")}"); selectedRotation = ChooseRotation(); if (selectedRotation != null) { isLaunched = true; FightEvents.OnFightLoop += FightLoopHandler; FightEvents.OnFightStart += FightStartHandler; FightEvents.OnFightEnd += FightEndHandler; LoggingEvents.OnAddLog += AddLogHandler; EventsLua.AttachEventLua("RESURRECT_REQUEST", e => ResurrectionEventHandler(e)); EventsLua.AttachEventLua("PLAYER_DEAD", e => PlayerDeadHandler(e)); EventsLua.AttachEventLua("READY_CHECK", e => ReadyCheckHandler(e)); EventsLua.AttachEventLua("INSPECT_TALENT_READY", e => AIOParty.InspectTalentReadyHandler()); EventsLua.AttachEventLua("PARTY_MEMBERS_CHANGED", e => AIOParty.GroupRosterChangedHandler()); EventsLua.AttachEventLua("PARTY_MEMBER_DISABLE", e => AIOParty.GroupRosterChangedHandler()); EventsLua.AttachEventLua("PARTY_MEMBER_ENABLE", e => AIOParty.GroupRosterChangedHandler()); EventsLuaWithArgs.OnEventsLuaStringWithArgs += EventsWithArgsHandler; AIOParty.UpdateParty(); if (!TalentsManager._isRunning) { _talentThread.DoWork += TalentsManager.DoTalentPulse; _talentThread.RunWorkerAsync(); } if (!_racials._isRunning && CombatSettings.UseRacialSkills) { _racialsThread.DoWork += _racials.DoRacialsPulse; _racialsThread.RunWorkerAsync(); } if (!AIORadar._isRunning) { _partyThread.DoWork += AIORadar.Pulse; _partyThread.RunWorkerAsync(); } selectedRotation.Initialize(selectedRotation); } else { Logger.LogError("Class not supported."); } }
public void Initialize() { if (!Products.ProductName.Equals("Quester") && !Products.ProductName.Equals("Grinder") && !Products.ProductName.Equals("Wholesome Professions WotLK")) { return; } isLaunched = true; isHorde = ToolBox.GetIsHorde(); WFMSettings.Load(); WFMDeepSettings.Load(); if (AutoUpdater.CheckUpdate(version)) { Logger.LogWarning("New version downloaded, restarting plugin, please wait"); ToolBox.Restart(); return; } Logger.Log($"Launching version {version} on client {ToolBox.GetWoWVersion()}"); MovementManager.StopMoveNewThread(); MovementManager.StopMoveToNewThread(); FlightMasterDB.Initialize(); WFMSetup.SetBlacklistedZonesAndOffMeshConnections(); WFMSetup.DiscoverDefaultNodes(); detectionPulse.DoWork += BackGroundPulse; detectionPulse.RunWorkerAsync(); FiniteStateMachineEvents.OnRunState += StateEventHandler; MovementEvents.OnMovementPulse += MovementEventsOnMovementPulse; MovementEvents.OnSeemStuck += SeemStuckHandler; EventsLuaWithArgs.OnEventsLuaStringWithArgs += ToolBox.MessageHandler; EventsLua.AttachEventLua("TAXIMAP_OPENED", (e) => isFMMapOpen = true); EventsLua.AttachEventLua("TAXIMAP_CLOSED", (e) => isFMMapOpen = false); EventsLua.AttachEventLua("GOSSIP_SHOW", (e) => isGossipOpen = true); EventsLua.AttachEventLua("GOSSIP_CLOSED", (e) => isGossipOpen = false); }
public void Initialize() { ZETBCFCSettings.Load(); AutoUpdater.CheckUpdate(version); Log($"FC version {version}. Discovering class and finding rotation..."); var type = Type.GetType(wowClass); if (type != null) { _isLaunched = true; // Fight end FightEvents.OnFightEnd += (ulong guid) => { wManager.wManagerSetting.CurrentSetting.CalcuCombatRange = _saveCalcuCombatRangeSetting; }; // Fight start FightEvents.OnFightStart += (WoWUnit unit, CancelEventArgs cancelable) => { wManager.wManagerSetting.CurrentSetting.CalcuCombatRange = false; }; if (!Talents._isRunning) { _talentThread.DoWork += Talents.DoTalentPulse; _talentThread.RunWorkerAsync(); } type.GetMethod("Initialize").Invoke(null, null); } else { LogError("Class not supported."); Products.ProductStop(); } }
public void Start() { try { AutoUpdater.CheckUpdate(version); IsStarted = true; FrameHelper.CreateDebugFrame(); FrameHelper.CreateBroadcastFrame(); WRobotSettings.SetRecommendedWRobotSettings(); _pulseThread.DoWork += BroadcasterPulse; _pulseThread.RunWorkerAsync(); Broadcaster.InitializeTimer(); if (Bot.Pulse()) { PluginsManager.LoadAllPlugins(); SetProfessions(); Logging.Status = "Start Product Complete"; Logging.Write("Start Product Complete"); } else { IsStarted = false; Logging.Status = "Start Product failed"; Logging.Write("Start Product failed"); } } catch (Exception e) { IsStarted = false; Logging.WriteError("Main > Start(): " + e); } }