private void MemoryModThread() { while (true) { // Shared AP mod if (_sharedApEnabled) { if (!MemoryReader.CheckProcess()) { break; } try { Dispatcher.Invoke(UpdateSharedAPState); } catch (Exception ex) { // App probably exited, silent exception } var writeBuffer = new byte[8]; for (var i = 0; i < 8; i++) { writeBuffer[i] = _sharedApState[i]; } MemoryReader.WriteBytes(_offsetInBattle, writeBuffer); MemoryReader.WriteBytes(_offsetGainedAp, writeBuffer); } Thread.Sleep(10); } }
public void ProcessChecker() { while (true) { if (!MemoryReader.CheckProcess()) { Dispatcher.Invoke((MethodInvoker) delegate { Close(); }); return; } Thread.Sleep(100); } }