[Guide] Anti-AFK Bot menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Krillere's Avatar Contributor
    Reputation
    112
    Join Date
    Nov 2007
    Posts
    668
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Guide] Anti-AFK Bot ( Background mode )

    Hello! Welcome to my little guide about how to make a simple Anti-AFK Bot, with background mode!
    This isn't some big Memory reading / writing bot, it's a simple application, but it gets the job done. :-)

    First, we're going to create a Windows Form Application, then create 2 buttons, a "Start Bot", and a "Stop Bot".

    Then double-click on the Start button, and you should find yourself in the code part of the program. Now go to the top of the code document, and you should see some code that looks like this:

    Code:
    using System;
    using System.Data;
    and so on, in the end of that, insert this:

    Code:
    using System.Threading;
    using System.Runtime.InteropServices;
    Under this, write the following:
    Code:
    [DllImport("user32.dll")]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
    [DllImport("user32.dll")]
    public static extern int SendMessage(IntPtr hWnd, UInt32 Msg, Keys wParam, Int32 lParam);
    Yes, I know that isn't the best way to use SendMessage, but it's much easier if you're only going to use it for this.

    and under that, write this:
    Code:
    private void SendTast(IntPtr hWnd, Keys wParam) {
    
    IntPtr hWnd = FindWindow(null, "World of Warcraft");
    
    const int WM_KEYDOWN = 0x100;
    const int WM_KEYUP = 0x101;
    
    SendMessage(hWnd, WM_KEYDOWN, wParam, 0);
    SendMessage(hWnd, WM_KEYUP, wParam, 0);
    
    }
    under that write this:

    Code:
    private void AfkThread() {
    
    IntPtr hWnd_WoW = FindWindow(null, "World of Warcraft");
    System.Random RInterval = new System.Random(0);
    
    int WaitInterval;
    
    for(; ; ) {
    
    SendTast(hWnd_WoW, Keys.A);
    WaitInterval = RInterval.Next(17, 77);
    Thread.Sleep(WaitInterval*1000);
    
    SendTast(hWnd_WoW, Keys.Space);
    WaitInterval = RInterval.Next(17,77);
    Thread.Sleep(WaitInterval*1000);
    
    SendTast(hWnd_WoW, Keys.S);
    WaitInterval = RInterval.Next(17, 77);
    Thread.Sleep(WaitInterval*1000);
    
    }
    
    }
    Before the button_press code, write this:

    Code:
    Thread oAfk;
    Now go in the button code again, and write the following:

    Code:
    oAfk = new Thread(AfkThread);
    oAfk.Start();
    Then, go out to the formdesigner, and double-click the Stop Button, this should bring you to the code part of the button, and then in the button_press, write this:

    Code:
    oAfk.Abort();
    the code file should now look like this:
    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Threading;
    using System.Runtime.InteropServices;
    
    namespace AntiAFK
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
          
            [DllImport("user32.dll")]
            static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    
            [DllImport("user32.dll")]
            public static extern int SendMessage(IntPtr hWnd, UInt32 Msg, Keys wParam, Int32 lParam);
    
    
            private void SendTast(IntPtr hWnd, Keys wParam)
            {
    
                const int WM_KEYDOWN = 0x100;
                const int WM_KEYUP = 0x101;
    
                SendMessage(hWnd, WM_KEYDOWN, wParam, 0);
                SendMessage(hWnd, WM_KEYUP, wParam, 0);
    
            }
    
            private void AfkThread()
            {
    
                IntPtr hWnd_WoW = FindWindow(null, "World of Warcraft");
                System.Random RInterval = new System.Random(0);
    
                int WaitInterval;
    
                for (; ; )
                {
    
                    SendTast(hWnd_WoW, Keys.A);
                    WaitInterval = RInterval.Next(17, 77);
                    Thread.Sleep(WaitInterval * 1000);
    
                    SendTast(hWnd_WoW, Keys.Space);
                    WaitInterval = RInterval.Next(17, 77);
                    Thread.Sleep(WaitInterval * 1000);
    
                    SendTast(hWnd_WoW, Keys.S);
                    WaitInterval = RInterval.Next(17, 77);
                    Thread.Sleep(WaitInterval * 1000);
    
                }
    
            }
    
            Thread oAfk;
    
            private void button1_Click(object sender, EventArgs e)
            {
                oAfk = new Thread(AfkThread);
                oAfk.Start();
            }
    
            private void button2_Click(object sender, EventArgs e)
            {
                oAfk.Abort();
            }
        }
    }
    Now execute the program. GL and HF.

    Any questions, just leave a reply, or give me a PM.
    Last edited by Krillere; 02-15-2010 at 07:32 AM.

    [Guide] Anti-AFK Bot
  2. #2
    [Sadistic]'s Avatar Member
    Reputation
    42
    Join Date
    Sep 2009
    Posts
    247
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow dude nice ty i always woundered how run background modes

  3. #3
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This doesn't really teach anything ;/ It just gives code.

  4. #4
    Krillere's Avatar Contributor
    Reputation
    112
    Join Date
    Nov 2007
    Posts
    668
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok then, should I add some "notes" to what the code does? :-)

Similar Threads

  1. Easy Mac Anti-AFK bot
    By wowpew in forum World of Warcraft Bots and Programs
    Replies: 18
    Last Post: 08-02-2007, 09:04 PM
  2. new undetectable anti-afk bot
    By twitch101 in forum World of Warcraft Bots and Programs
    Replies: 25
    Last Post: 11-04-2006, 07:32 AM
  3. Replies: 4
    Last Post: 09-18-2006, 06:38 PM
  4. [Bot] Anti-AFK Bot (No Injection & Focus not Needed)
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 12
    Last Post: 09-10-2006, 11:14 AM
  5. The Most Comprehensive Anti-AFK Bot... Ever
    By Sym in forum World of Warcraft Bots and Programs
    Replies: 7
    Last Post: 08-24-2006, 07:30 AM
All times are GMT -5. The time now is 03:32 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search