コード例 #1
0
 private void buttonsaveandclose_Click(object sender, EventArgs e)
 {
     AntiAFKSettings.Instance.Save();
     AntiAFK.PluginPulsing();
     AntiAFK.AFKLogging("[AntiAFK Bot] Settings are saved!");
     Close();
 }
コード例 #2
0
ファイル: AntiAFK.cs プロジェクト: abrn/exalt-root
    // Token: 0x0600046C RID: 1132 RVA: 0x000176C8 File Offset: 0x000158C8
    public void move(MovePacket move)
    {
        if (!Settings.Default.EnableAntiAFK)
        {
            return;
        }
        DateTime now = DateTime.Now;

        if (this._lastLocation.X != move.NewPosition.X || this._lastLocation.Y != move.NewPosition.Y)
        {
            this._lastMove     = now;
            this._lastLocation = move.NewPosition;
        }
        if (now.Subtract(this._lastMove) > TimeSpan.FromMinutes(5.0))
        {
            this._lastMove = now;
            Process[] processesByName = Process.GetProcessesByName("RotMG Exalt");
            if (processesByName.Any <Process>())
            {
                Console.WriteLine("Client: Activating Anti AFK");
                AntiAFK.PostMessage(processesByName.First <Process>().MainWindowHandle, 513u, 1, 1);
                Thread.Sleep(32);
                AntiAFK.PostMessage(processesByName.First <Process>().MainWindowHandle, 514u, 0, 1);
            }
        }
    }
コード例 #3
0
        private static void SetComboBoxEnum(ComboBox cb, int e)
        {
            CboItem item;

            for (var i = 0; i < cb.Items.Count; i++)
            {
                item = (CboItem)cb.Items[i];
                if (item.E != e)
                {
                    continue;
                }
                cb.SelectedIndex = i;
                return;
            }
            item = (CboItem)cb.Items[0];
            AntiAFK.AFKLoggingDiag("[AntiAFK Bot] Dialog Error: Combobox {0} does not have enum({1}) in list, defaulting to enum({2})", cb.Name, e, item.E);
            cb.SelectedIndex = 0;
        }