예제 #1
0
        public Bot(FlatListBox logLB)
        {
            //Attach Bluestacks process
            if (BotProcess.ProcessExist("HD-Frontend"))
            {
                bs = new BotProcess("HD-Frontend");
            }
            else
            {
                MessageBox.Show("Bluestacks is not open, please start it and restart the bot.");
                Environment.Exit(0);
            }

            //Set the default state
            botState = BotState.Free;

            //Set the listbox log
            logListBox = logLB;

            //Create the config
            cfgParser = new FileIniDataParser();

            //Worker configuration
            botWorker         = new AbortableBackgroundWorker();
            botWorker.DoWork += botWorker_DoWork;
            botWorker.WorkerSupportsCancellation = true;

            //JS engine configuration
            js = new Engine(cfg => cfg.AllowClr()).SetValue("BotMouse", bs.mouse)
                 .SetValue("BotKeyboard", bs.keyboard)
                 .SetValue("BotImage", bs.image)
                 .SetValue("BotWindow", bs.window)
                 .SetValue("Config", cfgData)
                 .SetValue("Bot", this);

            //Load the config
            ReloadConfig();
        }
예제 #2
0
 private void lstHistory_DrawItem(object sender, DrawItemEventArgs e)
 {
     FlatListBox.DrawItemHandler(sender, e);
 }
예제 #3
0
 public static void Init(FlatListBox listlog, FlatStatusBar statusbar)
 {
     log = listlog;
     status = statusbar;
 }