[HELP] AFK Bot menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    nightshack's Avatar Contributor
    Reputation
    107
    Join Date
    Jan 2007
    Posts
    248
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [HELP] AFK Bot

    Heey!

    I was learning Autoit and making things on it..Like my SAAFK anti afk bot etc.

    But then I discovered Visual Basic and I like it more..

    I need help!

    1. How do I make a "Sleep" command like on Autoit

    2. If I use "Send ("1")" when a button is clicked for example it tells me something like "Cant be used in a function" or something


    and other stuff, so please contact me or reply
    MSN : [email protected]
    AIM: nightshack


    These ads disappear when you log in.

  2. #2
    Zurkei's Avatar Contributor

    Reputation
    91
    Join Date
    Apr 2007
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To your first question add
    Code:
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    To the top of your code then you can just use the sleep command
    Code:
    Sleep 1000 ' This is in milliseconds so 1000 means 1 second you can change the 1000 to what ever you need just remember it is in milliseconds
    This should work as I use it for a bot on another game I play.

  3. #3
    nightshack's Avatar Contributor
    Reputation
    107
    Join Date
    Jan 2007
    Posts
    248
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot, but now, How do i make it to send keys to WoW window?


  4. #4
    Y R U A NUB ?'s Avatar Banned
    Reputation
    103
    Join Date
    Nov 2007
    Posts
    436
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For sending a key you do:

    Code:
    SendKeys.Send("1")
    As for "non digit or letter keys" such as space, add these brackets:

    Code:
    SendKeys.Send("{SPACE}")
    More: http://msdn.microsoft.com/en-us/libr...keys.send.aspx

    I would actually use AutoIT for these purposes, though.
    Last edited by Y R U A NUB ?; 11-05-2008 at 11:56 PM.

  5. #5
    Zurkei's Avatar Contributor

    Reputation
    91
    Join Date
    Apr 2007
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by nightshack View Post
    Thanks a lot, but now, How do i make it to send keys to WoW window?
    Ok this should work put this into your code somewhere
    Code:
    AppActivate ("World of Warcraft")
    SendKeys ("put the keys you want here")
    SendKeys ("{to do enter,shift, caps lock, and such put them in these brackets in all capitals}")
    An example of that last part would be
    Code:
    SendKeys ("{ENTER}")
    Make sure each new SendKeys is on a new line and is in order.

    For sending a key you do:


    Code:
    SendKeys.Send("1")


    As for "non digit or letter keys" such as space, add these brackets:


    Code:
    SendKeys.Send("{SPACE}")


    More: http://msdn.microsoft.com/en-us/libr...keys.send.aspx

    I would actually use AutoIT for these purposes, though.
    Your problem there is that he also asked how to send it to the WoW window not just plain out send keys so you need to have
    Code:
    AppActivate ("World of Warcraft")
    above your SendKeys code.
    Last edited by Zurkei; 11-06-2008 at 12:00 AM.

  6. #6
    Molleren's Avatar Sergeant
    Reputation
    2
    Join Date
    Nov 2007
    Posts
    58
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd use PostMessage as it automaticly sends to a decided window, and I'd use FindWindow for finding the HWND of WoW.

    I think the declaration are like this:
    Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    And then do like this: (This is Delphi code, but you can probably figure it out)
    PostMessage(FindWindow(nil, 'World of Warcraft'), WM_KEYDOWN, $0D, 0);
    PostMessage(FindWindow(nil, 'World of Warcraft'), WM_KEYUP, $0D, 0);
    &0D is the key code for return.

  7. #7
    Zurkei's Avatar Contributor

    Reputation
    91
    Join Date
    Apr 2007
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Molleren View Post
    I'd use PostMessage as it automaticly sends to a decided window, and I'd use FindWindow for finding the HWND of WoW.

    I think the declaration are like this:


    And then do like this: (This is Delphi code, but you can probably figure it out)


    &0D is the key code for return.
    Mine does the same the question is though which is more proffecient, and which is more complicated I will see which is when I get home from school and can get on VB.

  8. #8
    nightshack's Avatar Contributor
    Reputation
    107
    Join Date
    Jan 2007
    Posts
    248
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sendkeys doesnt work i already explained. Going to try with Sendkeys.Send later


  9. #9
    Zurkei's Avatar Contributor

    Reputation
    91
    Join Date
    Apr 2007
    Posts
    406
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by nightshack View Post
    Sendkeys doesnt work i already explained. Going to try with Sendkeys.Send later
    You said send not sendkeys so I didn't know entirely what you meant.

  10. #10
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,753
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In VB.NET, use SendKeys.SendWait instead of Send. This lets the app you're sending to process the message pumps, while Send doesn't. Also, SendKeys only works on the active application.

    Using SendMessage or PostMessage lets you send keys to non-activated windows. (There's a thread in this section about using the PostMessage in VB.NET)

  11. #11
    nightshack's Avatar Contributor
    Reputation
    107
    Join Date
    Jan 2007
    Posts
    248
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HELP!!

    Code:
    Public Class Form1
        Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim start As String
            start = "start"
            Do Until start = "stop"
                AppActivate("World of Warcraft")
                SendKeys.SendWait("1")
                Sleep(10000)
    
            Loop
    
        End Sub
    
        Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
            Dim start As String
            start = "stop"
        End Sub
    End Class
    When I click the first button, the GUI goes white and doesn't respond, but the program keeps running.
    How do I make it so the GUI doesn't freeze?


  12. #12
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,753
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remove the Sleep(10000) and make sure you're sending keys to the proper window. (SendKeys.SendWait won't return until the key has been processed by the active application. So the Sleep is pointless, and will make your GUI go unresponsive.)

    Also, don't use the PInvoke Sleep. System.Threading.Thread.Sleep(10000) is what you should use. (PInvoke Sleep is quite different)

  13. #13
    nightshack's Avatar Contributor
    Reputation
    107
    Join Date
    Jan 2007
    Posts
    248
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Remove the Sleep(10000) and make sure you're sending keys to the proper window. (SendKeys.SendWait won't return until the key has been processed by the active application. So the Sleep is pointless, and will make your GUI go unresponsive.)

    Also, don't use the PInvoke Sleep. System.Threading.Thread.Sleep(10000) is what you should use. (PInvoke Sleep is quite different)
    Sleep pointless? why?
    Do you know any other way to sleep it then? (Without the freezing ofcourse)


    --------------------------------------------------------

    So anyone knows how to make it so the GUI doesn't freeze?



  14. #14
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,753
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Add a timer. Set it to tick every 10000ms. And put your logic there.

    Code:
    Private Sub timer1_Tick(....)
                AppActivate("World of Warcraft")
                SendKeys.SendWait("1")
    EndSub
    GUI won't freeze, and it will 'sleep' for you that way. (The other way, is using a new thread to do the work.)

  15. #15
    nightshack's Avatar Contributor
    Reputation
    107
    Join Date
    Jan 2007
    Posts
    248
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    Add a timer. Set it to tick every 10000ms. And put your logic there.

    Code:
    Private Sub timer1_Tick(....)
                AppActivate("World of Warcraft")
                SendKeys.SendWait("1")
    EndSub
    GUI won't freeze, and it will 'sleep' for you that way. (The other way, is using a new thread to do the work.)
    And...how do I add a timer?


Page 1 of 2 12 LastLast

Similar Threads

  1. [HELP] Fishing bot afking
    By kingviper in forum WoW Memory Editing
    Replies: 9
    Last Post: 09-20-2012, 09:24 PM
  2. Pirox Anti-Afk Bot | Pics, Tips and Help
    By Rectal Exambot in forum World of Warcraft Guides
    Replies: 20
    Last Post: 01-25-2008, 10:14 AM
  3. Replies: 4
    Last Post: 09-18-2006, 06:38 PM
  4. [Program] WoW AV AFK Bot
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 0
    Last Post: 05-22-2006, 05:04 AM
  5. AutoIt Macro for WoW AFK Bot
    By Matt in forum World of Warcraft Bots and Programs
    Replies: 8
    Last Post: 04-06-2006, 06:01 AM
All times are GMT -5. The time now is 02:11 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search