Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed

    [HELP]Whats wrong with this?

    Yes its me, Golden. the noob back with another question

    Whats wrong with this code?
    Code:
    Public Class Form1
        Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Int32) As Int16
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            If GetAsyncKeyState(Keys.F5) Then
                Timer1.Enabled = True
            ElseIf GetAsyncKeyState(Keys.F6) Then
                Timer1.Enabled = False
            End If
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            If GetAsyncKeyState(Keys.F5) Then
                Timer1.Enabled = True
            ElseIf GetAsyncKeyState(Keys.F6) Then
                Timer1.Enabled = False
            End If
        End Sub
    
        Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
            If Timer1.Enabled = True Then
                Label1.Text = "AFK BOT ENABLED, PRESS F6 TO DISABLE!"
                Label1.ForeColor = Color.Green
            ElseIf Timer1.Enabled = False Then
                Label1.Text = "AFK BOT DISABLED, PRESS F5 TO ENABLE!"
                Label1.ForeColor = Color.Red
    
            End If
        End Sub
    End Class

  2. #2
    'Bruno's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Portugal
    Posts
    2,883
    Reputation
    290
    Thanks
    1,036
    My Mood
    Busy
    Logic... as soon as you stop the timer you cant get it to work again... <.< and why the hell you have the key check on form load? no reason...

    Your timer will only start when you press the key, which is being checked if pressed on the timer it self... So... you see whats the problem there? (and why a label click?)
    Light travels faster than sound. That's why most people seem bright until you hear them speak.

  3. The Following 3 Users Say Thank You to 'Bruno For This Useful Post:

    Hassan (08-05-2010),Jason (08-05-2010),NextGen1 (08-05-2010)

  4. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,679
    My Mood
    Mellow
    Quote Originally Posted by Brinuz View Post
    Logic... as soon as you stop the timer you cant get it to work again... <.< and why the hell you have the key check on form load? no reason...

    Your timer will only start when you press the key, which is being checked if pressed on the timer it self... So... you see whats the problem there? (and why a label click?)
    As Brinuz said, logic is the main fault here, specifically:

    [php]
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    If GetAsyncKeyState(Keys.F5) Then
    Timer1.Enabled = True
    ElseIf GetAsyncKeyState(Keys.F6) Then
    Timer1.Enabled = False
    End If
    End Sub
    [/php]

    Once you've pressed F6 this timer is no longer active and therefore any code contained within it is null and void.

    Create a new timer specifically for hotkeys.

    i.e

    [php]
    Private Sub Hotkeys_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Hotkeys.Tick
    dim Start as boolean = GetAsyncKeyState(Keys.F5)
    dim Stop as Boolean = GetAsyncKeyState(Keys.F6)


    If Start Then
    Timer1.Enabled = True
    ElseIf Stop Then
    Timer1.Enabled = False
    End If

    End Sub
    [/php]

    Something like that

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  5. #4
    Lonely Tedy Bear's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Location
    Utah,Salt Lake Posts: 5,371 ►►►►Lonely-Tedy◄◄◄◄
    Posts
    1,541
    Reputation
    -151
    Thanks
    321
    My Mood
    Lonely
    Quote Originally Posted by Brinuz View Post
    Logic... as soon as you stop the timer you cant get it to work again... <.< and why the hell you have the key check on form load? no reason...

    Your timer will only start when you press the key, which is being checked if pressed on the timer it self... So... you see whats the problem there? (and why a label click?)
    haha i was going to help but you got this good job =p
    also i lol! so hard when i seen the hotkey in the load event
    the way i do my hotkeys is set the timer to 50 interval

    edit:
    Last edited by Lonely Tedy Bear; 08-05-2010 at 12:42 PM.
             

  6. #5
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    Ok, Techial helped me out over teamviewer :P
    Another noob question ( i havent used VB in a month... ) whats the word for space
    Because
    SendKeys.Send("{Space}") is wrong.?

  7. #6
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,136
    My Mood
    Dead
    Quote Originally Posted by Golden. View Post
    Ok, Techial helped me out over teamviewer :P
    Another noob question ( i havent used VB in a month... ) whats the word for space
    Because
    SendKeys.Send("{Space}") is wrong.?
    Code:
    SendKeys.Send(" ")

  8. #7
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    Lol no,That prints ' Space ' as text
    I Want it to press spacebar xD

  9. #8
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,136
    My Mood
    Dead
    Quote Originally Posted by Golden. View Post
    Lol no,That prints ' Space ' as text
    I Want it to press spacebar xD
    Facepalm. No it just creates a space ' ' (Actually pressing the space key, not printing space).

  10. #9
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    Ahh
    But i want it to press Space key
    i understand what you are saying
    But this is an Afk bot, so by pressing space it will jump :3

  11. #10
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,679
    My Mood
    Mellow
    Quote Originally Posted by Golden. View Post
    Ahh
    But i want it to press Space key
    i understand what you are saying
    But this is an Afk bot, so by pressing space it will jump :3
    [php]
    Public Declare Function keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) As Long

    Const KEYEVENTF_KEYUP = &H2
    [/php]

    [php]

    Public Sub PressKey (ByVal tehkey as Keys)

    keybd_event(tehkey, 0, 0, 0)
    keybd_event(tehkey, 0, KEYEVENTF_KEYUP, 0)

    End Sub

    [/php]

    [php]
    PressKey(Keys.Space)
    [/php]

    There you go, completely noob proof.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  12. The Following 2 Users Say Thank You to Jason For This Useful Post:

    Golden. (08-05-2010),Lolland (08-05-2010)

  13. #11
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Kinda the same... :

    [php]#Region "Press Key"

    Declare Sub keybd_event Lib "user32.dll" ( _
    ByVal bVk As Byte, _
    ByVal bScan As Byte, _
    ByVal dwFlags As Long, _
    ByVal dwExtraInfo As Long)

    Private Sub pk(ByVal vk As Int32) 'press key
    keybd_event(vk, 0&, 0&, 0&)
    keybd_event(vk, 0&, KEYEVENTF_KEYUP, 0&)
    End Sub

    #End Region
    [/php]

    [php]pk(keys.f5)[/php]

    https://www.mpgh.net/forum/33-visual-...ot-code-s.html



  14. #12
    Golden.'s Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    156
    Reputation
    10
    Thanks
    3
    My Mood
    Amazed
    J-Deezy Solved it.
    Thanks man
    ~ Close please.

  15. #13
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,679
    My Mood
    Mellow
    Quote Originally Posted by Blubb1337 View Post
    Kinda the same... :

    [php]#Region "Press Key"

    Declare Sub keybd_event Lib "user32.dll" ( _
    ByVal bVk As Byte, _
    ByVal bScan As Byte, _
    ByVal dwFlags As Long, _
    ByVal dwExtraInfo As Long)

    Private Sub pk(ByVal vk As Int32) 'press key
    keybd_event(vk, 0&, 0&, 0&)
    keybd_event(vk, 0&, KEYEVENTF_KEYUP, 0&)
    End Sub

    #End Region
    [/php]

    [php]pk(keys.f5)[/php]

    https://www.mpgh.net/forum/33-visual-...ot-code-s.html
    Repeated post is repeated, nice one Kevin

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  16. #14
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    I am just pointing out that this has just been posted a day ago. With a little bit of researching(Search Function) he could have found it.

    + we have a sticky about that.

    = Copy Cat11!111eleven!11one!!
    Last edited by Blubb1337; 08-05-2010 at 09:55 PM.



  17. #15
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,679
    My Mood
    Mellow
    Quote Originally Posted by Blubb1337 View Post
    I am just pointing out that this has just been posted a day ago. With a little bit of researching(Search Function) he could have found it.

    + we have a sticky about that.

    = Copy Cat11!111eleven!11one!!
    /me = original + sexy

    = C+P nub.


    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

Page 1 of 3 123 LastLast

Similar Threads

  1. whats wrong with this?
    By whitten in forum C++/C Programming
    Replies: 3
    Last Post: 08-21-2009, 07:41 PM
  2. Whats wrong with this?
    By superHackz in forum Visual Basic Programming
    Replies: 1
    Last Post: 05-31-2008, 11:35 AM
  3. Whats wrong with this?
    By superHackz in forum WarRock - International Hacks
    Replies: 1
    Last Post: 05-26-2008, 04:03 AM
  4. Whats wrong with this code ?
    By bohnenbong in forum WarRock - International Hacks
    Replies: 7
    Last Post: 10-26-2007, 06:57 AM
  5. whats wrong with this...
    By NetNavi in forum WarRock - International Hacks
    Replies: 6
    Last Post: 09-03-2007, 01:19 AM