Ejemplo n.º 1
0
 public void Dispose()
 {
     KeyboardHook.UnhookWindowsHookEx(this.hookId);
 }
Ejemplo n.º 2
0
 public MainMenu()
 {
     this.InitializeComponent();
     this.kHook = new KeyboardHook();
     this.kHook.KeyCombinationPressed += new KeyboardHook.someKeyPressed(this.KHook_KeyCombinationPressed);
     this.btnBhopStop.Enabled          = false;
     this.btnTriggerbotStop.Enabled    = false;
     this.btnBhopPause.Enabled         = false;
     if (File.Exists(this.ownscriptpath))
     {
         this.btnCreateOpen.Text = "Open";
     }
     try
     {
         if (Directory.Exists(this.folderpath))
         {
             return;
         }
         Directory.CreateDirectory(this.folderpath);
         int num = (int)MessageBox.Show("Script folder created at: " + this.folderpath, "Folder created!");
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show("Couldn't create folder: " + ex.ToString(), "ERROR!");
     }
     try
     {
         using (StreamWriter text = File.CreateText(this.bhoppath))
         {
             text.WriteLine("F1::");
             text.WriteLine("Suspend");
             text.WriteLine("Return");
             text.WriteLine("*space::");
             text.WriteLine("Loop");
             text.WriteLine("{");
             text.WriteLine("GetKeyState,state,space,P");
             text.WriteLine("If state = U");
             text.WriteLine("Break");
             text.WriteLine("Send,{space}");
             text.WriteLine("Sleep,20");
             text.WriteLine("}");
         }
         using (StreamWriter text = File.CreateText(this.triggerpath))
         {
             text.WriteLine("; --- Change enemy outlines to purple");
             text.WriteLine("Loop");
             text.WriteLine("{");
             text.WriteLine("KeyWait, LCtrl, D");
             text.WriteLine("CoordMode, Pixel, Screen");
             text.WriteLine("PixelSearch, FoundX, FoundY, 957, 519, 961, 583, 0xA145A3, 30, Fast RGB");
             text.WriteLine("If (ErrorLevel = 0){");
             text.WriteLine("sleep, 30");
             text.WriteLine("send {Lbutton down}");
             text.WriteLine("sleep, 10");
             text.WriteLine("send {lbutton up}");
             text.WriteLine("}");
             text.WriteLine("");
             text.WriteLine("}");
             text.WriteLine("return");
         }
         using (StreamWriter text = File.CreateText(this.aaspath))
         {
             text.WriteLine("#NoEnv");
             text.WriteLine("SendMode Input");
             text.WriteLine("#SingleInstance Force");
             text.WriteLine("#MaxThreadsPerHotkey 2");
             text.WriteLine("");
             text.WriteLine("F11::");
             text.WriteLine("toggle := !toggle");
             text.WriteLine("Loop");
             text.WriteLine("{");
             text.WriteLine("if !toggle");
             text.WriteLine("break");
             text.WriteLine("");
             text.WriteLine("Sleep, 51");
             text.WriteLine("MouseClick, left, XAgent, 968");
             text.WriteLine("Sleep, 51");
             text.WriteLine("MouseClick, left, 958, 850");
             text.WriteLine("}");
             text.WriteLine("return");
         }
     }
     catch (Exception ex)
     {
         int num = (int)MessageBox.Show("Error creating scripts: " + ex.ToString(), "ERROR!");
     }
 }