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(); }
// Token: 0x0600000A RID: 10 private void watchForEvents() { EventsLua.AttachEventLua(LuaEventsId.TAXIMAP_OPENED, delegate(object m) { Main.g__CHAT_MSG_PET_INFO(); }); }
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() { FightClassSettings.Load(); ClassManager.LoadAbilities(); FightEvents.OnFightStart += FightEvents_OnFightStart; FightEvents.OnFightEnd += FightEvents_OnFightEnd; Radar3D.OnDrawEvent += Radar3D_OnDrawEvent; EventsLua.AttachEventLua(LuaEventsId.PLAYER_TARGET_CHANGED, e => EventsLua_OnEventLuaPlayerTargetChanged()); robotManager.Events.FiniteStateMachineEvents.OnRunState += FiniteStateMachineEvents_OnRunState; Logging.Write($"[{ FightClassSettings.Name }] loaded"); Process(); }
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); }
internal static bool Pulse() { try { // Attach onlevelup for spell book: EventsLua.AttachEventLua(LuaEventsId.PLAYER_LEVEL_UP, m => OnLevelUp()); EventsLua.AttachEventLua(LuaEventsId.PLAYER_ENTERING_WORLD, m => ScreenReloaded()); // Update spell list SpellManager.UpdateSpellBook(); // Load CC: CustomClass.LoadCustomClass(); // FSM Fsm.States.Clear(); Fsm.AddState(new Relogger { Priority = 200 }); Fsm.AddState(new Pause { Priority = 33 }); Fsm.AddState(new Resurrect { Priority = 32 }); Fsm.AddState(new MyMacro { Priority = 31 }); Fsm.AddState(new IsAttacked { Priority = 30 }); Fsm.AddState(new Regeneration { Priority = 29 }); Fsm.AddState(new Looting { Priority = 28 }); Fsm.AddState(new FlightMasterTakeTaxiState { Priority = 27 }); Fsm.AddState(new Farming { Priority = 26 }); Fsm.AddState(new ToTown { Priority = 25 }); Fsm.AddState(new SellItemsState { Priority = 24 }); Fsm.AddState(new SetCurrentStepState { Priority = 21 }); Fsm.AddState(new SplitItemState { Priority = 19 }); Fsm.AddState(new DisenchantState { Priority = 18 }); Fsm.AddState(new FilterLootState { Priority = 17 }); Fsm.AddState(new TravelState { Priority = 16 }); Fsm.AddState(new LearnProfessionState { Priority = 15 }); Fsm.AddState(new BuyAndLearnRecipeState { Priority = 14 }); Fsm.AddState(new LearnRecipeFromTrainerState { Priority = 13 }); Fsm.AddState(new BuyMaterialsState { Priority = 12 }); Fsm.AddState(new CraftOneState { Priority = 11 }); Fsm.AddState(new EnchantState { Priority = 10 }); Fsm.AddState(new CraftState { Priority = 9 }); Fsm.AddState(new LoadProfileState { Priority = 8 }); Fsm.AddState(Grinding); Fsm.AddState(MovementLoop); Fsm.AddState(new Idle { Priority = 0 }); Fsm.States.Sort(); Fsm.StartEngine(10, "_Profession"); // Fsm.StartEngine(25); wManager.wManagerSetting.AddBlackListZone(new Vector3(1731.702, -4423.403, 36.86293, "None"), 5.00f, true); wManager.wManagerSetting.AddBlackListZone(new Vector3(1669.99, -4359.609, 29.23425, "None"), 5.00f, true); StopBotIf.LaunchNewThread(); return(true); } catch (Exception e) { try { Dispose(); } catch { } Logging.WriteError("Bot > Bot > Pulse(): " + e); return(false); } }