private void SelectedUnitChecker() { if (!InGame || !Installed) { return; } try { using (var s = pd.MakeSuspender()) { var pUnit = GetSelectedUnit(); if (pUnit == IntPtr.Zero) { ToggleMobInfo(false); return; } ToggleMobInfo(true); var unit = pd.Read <UnitAny>(pUnit); Console.WriteLine("{0} {1}", unit.dwUnitId, unit.dwType); UpdateMobInfo(string.Format("{0} {1}", unit.dwUnitId, unit.dwType)); //MessageBox.Show(string.Format("{0} {1}", unit.dwUnitId, unit.dwType)); } } catch (Exception) { } }
void OnTimerTick(object obj, EventArgs args) { if (pd == null) { return; } var newState = Keyboard.IsKeyDown(toggleTreesKey); if (newState == toggleState) { return; } toggleState = newState; if (!noTreesCheckBox.Checked || !inBothModesCheckBox.Checked) { return; } pd.RefreshMemory(); if (pd.HasExited) { return; } using (var suspender = pd.MakeSuspender()) { if (toggleState) { AlwaysSniperBP.Enabled = false; TreeRaidusBp.Enabled = false; AlwaysSniperBP.WriteVals(false, pd); TreeRaidusBp.WriteVals(10, 15, pd); } else { AlwaysSniperBP.Enabled = true; TreeRaidusBp.Enabled = true; AlwaysSniperBP.WriteVals(true, pd); TreeRaidusBp.WriteVals(1000, 1000, pd); } } }