public override void Start(RuntimeMod mod) { AllocConsole(); soundCompleteId = hooks_instance.hookSoundComplete(new SoundCompleteAction((int soundId, string f) => { Console.WriteLine("Sound from file " + f + " has finished"); })); voiceCompleteId = hooks_instance.hookVoiceComplete(new VoiceCompleteAction((int vid, string f) => { Console.WriteLine("Voice from file " + f + " has finished"); if (!ff7.HasExited) { getKeys(); IntPtr thisThread = GetCurrentThreadId(); AttachThreadInput(thisThread, new IntPtr(ff7.Threads[0].Id), true); keySim.KeyDown((WindowsInput.Native.VirtualKeyCode)Keys[KeyBoardBindings.OK]); Thread.Sleep(200); keySim.KeyUp((WindowsInput.Native.VirtualKeyCode)Keys[KeyBoardBindings.OK]); AttachThreadInput(thisThread, new IntPtr(ff7.Threads[0].Id), false); } })); initId = hooks_instance.hookInit(new InitAction(() => { Console.WriteLine("Starting"); Thread.Sleep(1000); getProccess(); getKeys(); })); closeId = hooks_instance.hookClose(new CloseAction(() => { Console.WriteLine("Closing"); })); }