/// <summary> /// Sets the characters target to the specified unit /// <para>SetTargetTo will only work if we arent moving (Backup, ForceBackup, FixFacing)</para> /// Only working once each Fight() pulse /// </summary> /// <param name="parUnit">The unit.</param> /// <param name="parStopCastingOnChange">(Optional) if true the current cast will be aborted on succcessful target change</param> /// <returns> /// Returns <c>true</c> if the target got changed successfully /// </returns> /// <seealso cref="CustomClass.Fight" /> public bool SetTargetTo(_Unit parUnit, bool parStopCastingOnChange = false) { try { if (parUnit.Ptr == null) { return(false); } if (!Grinder.Access.Info.Combat.IsMoving && CanChangeTarget && (CCManager._Target.IsNull || CCManager._Target.Guid != parUnit.Guid)) { ObjectManager.Player.SetTarget(parUnit.Ptr); ObjectManager.Player.Face(parUnit.Ptr); CCManager.UpdateTarget(parUnit.Ptr); CanChangeTarget = false; if (parStopCastingOnChange) { StopCasting(); } return(true); } } catch { } return(false); }
internal static bool Init() { bool ccLoaded = CCManager.ChooseCustomClassByWowClass(ObjectManager.playerClass); if (ccLoaded) { Calls.DoString("ConsoleExec('Autointeract 0')"); Calls.DoString("CameraZoomIn(50)"); engine = new Engine(); engine.States.Add(new stateAssistIdle()); engine.States.Add(new stateAssistWalk()); engine.States.Add(new stateAssistVendor()); engine.States.Add(new stateAssistNeedRest()); engine.States.Add(new stateAssistFight()); engine.States.Add(new stateAssistDeath()); engine.States.Add(new stateAssistDc()); engine.States.Add(new stateAssistBuff()); engine.States.Add(new stateAssistWait()); engine.States.Add(new stateTeleToMaster()); return(true); } else { MessageBox.Show("No CC found"); } return(false); }
public override void Run() { if (MasterContainer.engageGuid != ObjectManager.TargetObject.guid) { blacklistCount = 0; MasterContainer.engageGuid = ObjectManager.TargetObject.guid; BlacklistTimer.Reset(); } if (BlacklistTimer.IsReady()) { blacklistCount = blacklistCount + 1; if (blacklistCount == 1) { MasterContainer.IsStuck = true; } } if (blacklistCount >= 2) { MasterContainer.blacklistGuid.Add(ObjectManager.TargetObject.guid); blacklistCount = 0; BlacklistTimer.Reset(); Calls.SetTarget(0); } MasterFightMovement.Handle(); SpellManager.CheckSpells(); CCManager.FightPulse(); Ingame.CastFinal(); MasterContainer.AfterFight = true; }
internal override void Run() { ObjectManager.Player.CtmStopMovement(); ClearTarget(); CCManager.Rest(); Shared.ResetJumper(); }
private void reloadToolStripMenuItem_Click(object sender, EventArgs e) { SettingsManager.LoadSettings(); if (EngineManager.CurrentEngineType == Engines.Engines.None) { CCManager.LoadCCs(); } }
/// <summary> /// Reload all settings /// </summary> private void bReload_Click(object sender, EventArgs e) { OptionManager.LoadSettings(); if (EngineManager.CurrentEngineType == Engines.Engines.None) { CCManager.LoadCCs(); } }
public override void Run() { if (!Calls.MovementIsOnly((uint)Offsets.movementFlags.None)) { Calls.StopRunning(); } if (Data.needHealth) { IsWaitingForHealth = true; } if (Data.needMana) { IsWaitingForMana = true; } if (UseRestItemTimer.IsReady()) { if (IsWaitingForHealth == true) { if (ObjectManager.PlayerHealthPercent > 90) { IsWaitingForHealth = false; } else { if (Data.UseCcRest) { CCManager.RestHealth(IsWaitingForMana); } else { Ingame.UseFood(); } } } if (IsWaitingForMana == true) { if (ObjectManager.PlayerObject.manaPercent > 95) { IsWaitingForMana = false; } else { if (Data.UseCcRest) { CCManager.RestMana(IsWaitingForHealth); } else { Ingame.UseDrink(); } } } } }
internal void EndLaunchPrepare() { CCManager.LoadCCs(); Memory.Init(); OptionManager.LoadSettings(); Enums.DynamicFlags.AdjustToRealm(); MainForm.Enabled = true; ChatHook.OnNewChatMessage += updateChat; LoginBlock.Disable(); }
// Start is called before the first frame update void Awake() { if (s_Instance != null) { Destroy(this); return; } s_Instance = this; }
public MainForm() { InitializeComponent(); CCManager.Initialisate(); CCManager.GetCustomClasses(); var timer = new System.Windows.Forms.Timer(); timer.Tick += new EventHandler(timer_Tick); timer.Interval = 1000; timer.Start(); }
public override void Run() { if (curHealthPercent == (int)ObjectManager.TargetObject.healthPercent) { if (BlackListTimer.IsReady()) { BlackListCounter = BlackListCounter + 1; if (BlackListCounter == 2) { GrindbotContainer.blacklistGuid.Add(ObjectManager.TargetObject.guid); BlackListCounter = 0; BlackListTimer.Reset(); Calls.SetTarget(0); } else { GrindbotContainer.IsStuck = true; } } } else { curHealthPercent = (int)ObjectManager.TargetObject.healthPercent; BlackListTimer.Reset(); BlackListCounter = 0; } if (ObjectManager.TargetObject.healthPercent == 100) { int curHealth = (int)ObjectManager.TargetObject.healthPercent; } GrindbotFightMovement.Handle(); if (ObjectManager.IsTargetOnMe()) { SpellManager.CheckSpells(); CCManager.FightPulse(); Ingame.CastFinal(); GrindbotContainer.AfterFight = true; } else { UInt64 guid = 0x0; try { guid = ObjectManager.AggroMobs()[0]; } catch { } Calls.SetTarget(guid); } }
public override void Run() { { if (ObjectManager.IsUnitOnGroup(attTarget.targetGuid, attTarget.isTapped, attTarget.healthPercent)) { clientConnect.requestWait(); } FightMovement.Handle(); SpellManager.CheckSpells(); CCManager.FightPulse(); Ingame.CastFinal(); AssistContainer.AfterFight = true; } }
protected void btnOK_Click(object sender, EventArgs e) { if ((User)Session["User"] == null) { this.FreeTextBox1.Enabled = false; this.classid.Enabled = false; this.contenttitle.Enabled = false; this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('请登录后发帖!')</script>"); return; } if (contenttitle.Text.Trim().Length == 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('标题不能为空!')</script>"); return; } if (FreeTextBox1.Text.Trim().Length == 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('内容不能为空!')</script>"); return; } LBBS.Model.Content content = new LBBS.Model.Content(); User user = (User)Session["User"];//如何保存当前UID ContentClass contentclass = (ContentClass)CCManager.GetContentclassById(Convert.ToInt32(classid.SelectedValue)); content.Title = contenttitle.Text.Trim(); content.Contentclass = contentclass; content.Contentery = FreeTextBox1.Text; content.Createdon = Convert.ToDateTime(DateTime.Now.ToString("")); content.Repliedon = Convert.ToDateTime(DateTime.Now.ToString("")); content.Replycount = 0; content.Isclose = "已审核"; content.User = user;//关联表数据设定 if (ContentManager.addContent(content) > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('增加成功!');</script>"); return; } else { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('增加失败!');</script>"); return; } }
internal static bool Init() { bool ccLoaded = CCManager.ChooseCustomClassByWowClass(ObjectManager.playerClass); bool profileLoaded = Data.getProfile(); if (ccLoaded && profileLoaded) { string txt = "Port to first waypoint?"; DialogResult dialogResult = MessageBox.Show(txt, "Port", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { Ingame.Tele(Data.Profile[0], 60, false); } MasterContainer.Reset(); Calls.DoString("ConsoleExec('Autointeract 0')"); Calls.DoString("CameraZoomIn(50)"); Data.curWp = MasterFunctions.GetClosestWaypoint(0); engine = new Engine(); engine.States.Add(new stateMasterIdle()); engine.States.Add(new stateMasterWalk()); engine.States.Add(new stateMasterGetTarget()); engine.States.Add(new stateGrindEngage()); engine.States.Add(new stateMasterNeedRest()); engine.States.Add(new stateMasterLoot()); engine.States.Add(new stateMasterFight()); engine.States.Add(new stateMasterUnstuck()); engine.States.Add(new stateMasterDc()); engine.States.Add(new stateMasterBuff()); engine.States.Add(new stateMasterDeath()); engine.States.Add(new stateMasterVendor()); engine.States.Add(new stateMasterWaitForSlaves()); return(true); } else { MessageBox.Show("No CC found"); } return(false); }
internal void EndLaunchPrepare() { Memory.Init(); SettingsManager.LoadSettings(); CCManager.LoadCCs(); #region set wow & bot window location and size Helpers.WindowInteraction.SetWowWindow(); Helpers.WindowInteraction.SetBotWindow(); #endregion #region setup world render minimize if enabled in settings if (Settings.Settings.MinimizeWorldRender) { Hack renderWorld = HookWardenMemScan.GetHack("RenderWorlObjectsPatch"); //setup render world patch if unknown to us if (renderWorld == null) { var RenderWorldPatch = new Hack(ZzukBot.Constants.Offsets.Hacks.RenderDisable, new byte[] { 0x00 }, "RenderWorlObjectsPatch"); HookWardenMemScan.AddHack(RenderWorldPatch); renderWorld = HookWardenMemScan.GetHack("RenderWorlObjectsPatch"); } if (!renderWorld.IsActivated && Settings.Settings.MinimizeWorldRender) { renderWorld.Apply(); } } #endregion IrcMonitor.Instance.MessageReceived += ChannelMessageRecieved; GuiCore.SettingsForm.SetupIrc(); Enums.DynamicFlags.AdjustToRealm(); GuiCore.MainForm.Enabled = true; ChatHook.OnNewChatMessage += updateChat; LoginBlock.Disable(); }
internal void EndLaunchPrepare() { CCManager.LoadCCs(); Memory.Init(); OptionManager.LoadSettings(); try { using (var wc = new WebClient()) { MainForm.rtbNews.Text = wc.DownloadString("http://zzukbot.com/Hk3VEXpjfj8K/Important.txt"); } } catch { MainForm.rtbNews.Text = "Error while fetching news"; } IrcMonitor.Instance.MessageReceived += ChannelMessageRecieved; SetupIrc(); Enums.DynamicFlags.AdjustToRealm(); MainForm.Enabled = true; ChatHook.OnNewChatMessage += updateChat; LoginBlock.Disable(); }
internal bool Prepare(string parProfilePath, Action parCallback) { if (!ObjectManager.EnumObjects() || !API.BMain.IsInGame) { return(false); } if (!string.IsNullOrEmpty(parProfilePath)) { Profile = new GrindProfile(parProfilePath); } else { Profile = new GrindProfile(); } if (!CCManager.ChooseCustomClassByWowClass((byte)ObjectManager.Player.Class)) { Helpers.Logger.Append($"Couldnt find a usable Custom Class for the { ObjectManager.Player.Class } class! Aborting.."); return(false); } StuckHelper = new _StuckHelper(); Info = new SessionContainer(); if (Profile.ProfileValid) { Info.Waypoints.LoadFirstWaypointsAsync(parCallback); } var tmpStates = new List <State> { new StateFishing(700), new StateMountUp(699), new stateWaitForMembers(600), new StateFollowLeader(450), new StateIdle(int.MinValue), new StateWalkToGather(460), new StateFight(850), new StateRest(800), new StateBuff(750), new StateReleaseSpirit(950), new StateGhostWalk(900), new StateWalkBackToGrind(550), new StateAfterFightToPath(330), new StateWaitAfterFight(650), new StateDoRandomShit(190) }; if (Profile.Factions != null) { tmpStates.Add(new StateFindTarget(200)); tmpStates.Add(new StateApproachTarget(340)); } if (Profile.Hotspots != null) { tmpStates.Add(new StateLoadNextHotspot(150)); tmpStates.Add(new StateLoadNextWaypoint(140)); tmpStates.Add(new StateWalk(100)); } if (Settings.Settings.LootUnits) { tmpStates.Add(new StateLoot(500)); } if (Profile.RepairNPC != null) { tmpStates.Add(new StateWalkToRepair(410)); tmpStates.Add(new StateRepair(400)); } if (Settings.Settings.BreakFor != 0 && Settings.Settings.ForceBreakAfter != 0) { Info.BreakHelper.SetBreakAt(60000); tmpStates.Add(new StateStartBreak(1500)); } tmpStates.Sort(); Engine = new _Engine(tmpStates); return(true); }
internal bool Prepare(string parProfilePath, Action parCallback) { if (!ObjectManager.EnumObjects()) { return(false); } Profile = new GrindProfile(parProfilePath); if (!Profile.ProfileValid) { return(false); } if (!CCManager.ChooseCustomClassByWowClass((byte)ObjectManager.Player.Class)) { MessageBox.Show("Couldnt find a Custom Class we can use"); return(false); } StuckHelper = new _StuckHelper(); Info = new _Info(); Info.Waypoints.LoadFirstWaypointsAsync(parCallback); var tmpStates = new List <State> { new StateIdle(), new StateLoadNextHotspot(), new StateLoadNextWaypoint(), new StateWalk(), new StateFindTarget(), new StateApproachTarget(), new StateFight(), new StateRest(), new StateBuff() }; if (Options.LootUnits) { tmpStates.Add(new StateLoot()); } tmpStates.Add(new StateReleaseSpirit()); tmpStates.Add(new StateGhostWalk()); tmpStates.Add(new StateWalkToRepair()); tmpStates.Add(new StateWalkBackToGrind()); tmpStates.Add(new StateAfterFightToPath()); tmpStates.Add(new StateWaitAfterFight()); tmpStates.Add(new StateDoRandomShit()); if (Options.BreakFor != 0 && Options.ForceBreakAfter != 0) { Info.BreakHelper.SetBreakAt(60000); tmpStates.Add(new StateStartBreak()); } if (Profile.RepairNPC != null) { tmpStates.Add(new StateRepair()); } tmpStates.Sort(); Engine = new _Engine(tmpStates); return(true); }
void Start() { ccRef = gameObject.GetComponent <CCManager>(); }
internal override void Run() { API.Helper.MoveOutOfCampfire(); if (Grinder.Access.Info.Vendor.GoBackToGrindAfterVendor || Grinder.Access.Info.Vendor.TravelingToVendor) { Grinder.Access.Info.Vendor.RegenerateSubPath = true; } Grinder.Access.Info.PathAfterFightToWaypoint.SetAfterFightMovement(); Grinder.Access.Info.Combat.LastFightTick = Environment.TickCount + ran.Next(50, 100); Grinder.Access.Info.Loot.RemoveRespawnedMobsFromBlacklist(Grinder.Access.Info.Combat.Attackers); Grinder.Access.Info.Target.SearchDirect = true; if (Grinder.Access.Info.BreakHelper.NeedToBreak) { if (CanceledLogout) { Functions.DoString("CancelLogout()"); CanceledLogout = false; } } else { CanceledLogout = true; } target = ObjectManager.Target; if (target != null) { var player = ObjectManager.Player; //reset resources so they dont get blacklisted because of a fight player.DiscoveredResources = new Dictionary <WoWGameObject, TimeSpan>(); var IsCasting = !(player.Casting == 0 && player.Channeling == 0); var targetIsMoving = (target.MovementState & 0x1) == 0x1; var playerIsMoving = (player.MovementState & 0x1) == 0x1; var distanceToTarget = Calc.Distance3D(player.Position, target.Position); if (!Grinder.Access.Info.Combat.IsAttacker(target.Guid) && !API.BParty.IsInParty) { var tmp = Grinder.Access.Info.Combat.Attackers.OrderBy(i => i.Health).FirstOrDefault(); if (tmp == null) { return; } ObjectManager.Player.SetTarget(tmp); ObjectManager.Player.Spells.StopCasting(); return; } if (ObjectManager.Player.IsCtmIdle && (ObjectManager.Player.MovementState & (uint)Enums.MovementFlags.Back) != (uint)Enums.MovementFlags.Back && ObjectManager.Player.MovementState != 0) { ObjectManager.Player.StopMovement(Enums.ControlBits.All); ObjectManager.Player.CtmStopMovement(); } if (distanceToTarget >= Grinder.Access.Info.Target.CombatDistance && ((!IsCasting && !Grinder.Access.Info.Combat .IsMoving) || !Grinder.Access.Info.Target .InSightWithTarget)) { var tu = Grinder.Access.Info.PathToUnit.ToUnit(target); if (tu.Item1) { player.CtmTo(tu.Item2); } } else { if (!Grinder.Access.Info.Combat.IsMoving) { if (playerIsMoving) { if (!(Grinder.Access.Info.Target.CombatDistance < 4 && IsCasting && targetIsMoving)) { player.CtmStopMovement(); } } else { ObjectManager.Player.CtmSetToIdle(); player.Face(target); } Wait.Remove("FixFacingTimer"); } else { if (Grinder.Access.Info.Combat.IsMovingBack) { } else if (Grinder.Access.Info.Target.FixFacing) { FixFacing(); } } CCManager.FightPulse(ref target); } } else { var tmp = Grinder.Access.Info.Combat.Attackers.OrderBy(i => i.Health).FirstOrDefault(); if (tmp == null) { return; } ObjectManager.Player.SetTarget(tmp); } }
void OnDisable() { CCManager.RemoveSource(this); }
void OnEnable() { CCManager.RegisterSource(this); }
internal override void Run() { ObjectManager.Player.CtmStopMovement(); ClearTarget(); CCManager.Rest(); Shared.ResetJumper(); //don't just stand around like a bot.. At least sit down while resting! if (!ObjectManager.Player.IsInCombat) { // ObjectManager.Player.DoString("DoEmote('sit');"); } string FoodAuraString = "Food"; string DrinkAuraString = "Drink"; if (!ObjectManager.Player.GotAura(FoodAuraString) && !ObjectManager.Player.GotAura(DrinkAuraString)) { //lets check if we can find something to eat in the bags var tmpPlayer = ObjectManager.Player; #region health regen if (!tmpPlayer.GotAura(FoodAuraString) && Grinder.Access.Info.Rest.NeedToEat) { foreach (Objects.WoWItem tmpItem in ObjectManager.Items) { if (Game.Static.Consumeables.FoodsDictionary.ContainsKey(tmpItem.Id)) { int tmpFoodLevel; Game.Static.Consumeables.FoodsDictionary.TryGetValue(tmpItem.Id, out tmpFoodLevel); if (tmpPlayer.Level >= tmpFoodLevel) { tmpPlayer.Inventory.UseItemByObject(tmpItem); // Helpers.Logger.Append("Eating " + tmpItem.Name); break; } } } } #endregion #region mana regen if (!tmpPlayer.GotAura(DrinkAuraString) && Grinder.Access.Info.Rest.NeedToDrink) { foreach (Objects.WoWItem tmpItem in ObjectManager.Items) { if (Game.Static.Consumeables.DrinksDictionary.ContainsKey(tmpItem.Id)) { int tmpDrinkLevel; Game.Static.Consumeables.DrinksDictionary.TryGetValue(tmpItem.Id, out tmpDrinkLevel); if (tmpPlayer.Level >= tmpDrinkLevel) { tmpPlayer.Inventory.UseItemByObject(tmpItem); // Helpers.Logger.Append("Drinking " + tmpItem.Name); break; } } } } #endregion } }
internal override void Run() { target = ObjectManager.Target; if (target == null) { return; } if (Grinder.Access.Info.Combat.IsBlacklisted(target)) { return; } var player = ObjectManager.Player; var IsCasting = !(player.Casting == 0 && player.Channeling == 0); var targetIsMoving = (target.MovementState & 0x1) == 0x1; var playerIsMoving = (player.MovementState & 0x1) == 0x1; var distanceToTarget = Calc.Distance3D(player.Position, target.Position); Grinder.Access.Info.PathAfterFightToWaypoint.SetAfterFightMovement(); Grinder.Access.Info.Loot.RemoveRespawnedMobsFromBlacklist(target.Guid); Grinder.Access.Info.Target.SearchDirect = true; Grinder.Access.Info.Combat.LastFightTick = Environment.TickCount + ran.Next(50, 100); if (target != null) { try { if (Grinder.Access.Info.Combat.Attackers.Count != 0 && !Grinder.Access.Info.Combat.IsAttacker(target.Guid)) { var tmpUnit = Grinder.Access.Info.Combat.Attackers[0]; if (tmpUnit == null) { return; } player.SetTarget(tmpUnit.Guid); target = tmpUnit; ObjectManager.Player.Spells.StopCasting(); } } catch { } if (distanceToTarget >= Grinder.Access.Info.Target.CombatDistance && ((!IsCasting && !Grinder.Access.Info.Combat .IsMoving) || !Grinder.Access.Info.Target .InSightWithTarget)) { var tu = Grinder.Access.Info.PathToUnit.ToUnit(target); if (tu.Item1) { player.CtmTo(tu.Item2); } } else { if (!Grinder.Access.Info.Combat.IsMoving) { if (playerIsMoving) { if (!(Grinder.Access.Info.Target.CombatDistance <= 4 && IsCasting && targetIsMoving)) { player.CtmStopMovement(); } } else { ObjectManager.Player.CtmSetToIdle(); player.Face(target); } } else { if (Grinder.Access.Info.Combat.IsMovingBack) { } else if (Grinder.Access.Info.Target.FixFacing) { Grinder.Access.Info.Target.FixFacing = false; } } } CCManager.PreFightPulse(ref target); } }