Results 1 to 14 of 14
  1. #1
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused

    Timing Countdown

    Ok i need help to code this:

    Pressing down the key "D" for only 10 milliseconds. after that it will stop.
    how would i do that?

  2. #2
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    User32 commands!

    Too lazy to write up, but you can find it on MSDN.

    There's one address for sending the key "D" then one for lifting the key "D".

    It's the same as an auto clicker, there's one for sending the click, and one for lifting the click.

  3. #3
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    make a timer of 1 millisecond
    make it enabled

    dim number as string

    Timer1.Tick
    if number <= 10 then
    sendkeys.send(keys.d)
    number = number + 1
    else
    timer1.enabled = false
    end if
    end sub


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

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  4. #4
    Erinador's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    224
    Reputation
    14
    Thanks
    111
    My Mood
    Bored
    Quote Originally Posted by mnpeepno2 View Post
    make a timer of 1 millisecond
    make it enabled

    dim number as string

    Timer1.Tick
    if number <= 10 then
    sendkeys.send(keys.d)
    number = number + 1
    else
    timer1.enabled = false
    end if
    end sub
    Could work and I advice to use Integer instead of string

  5. #5
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    yea agree...why would you pick a string for numbers =P



  6. #6
    mnpeepno2's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    In a barren wasteland
    Posts
    905
    Reputation
    10
    Thanks
    81
    i dunno its what came to my mind at the time...


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

    My site: here
    My Blog: here
    My member's area: here
    Minecraft Sever Forum: here


    Minecraft Servers:

    Public:



    Private:



  7. #7
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    wat if i want to make it hold "D" down for 5 seconds.

    right now the code:
    Code:
    Timer1.Tick
    if number <= 5000 then
    sendkeys.send(keys.d)
    number = number + 1
    else
    timer1.enabled = false
    end if
    end sub
    It keeps clicking "D" for 5 seconds.

  8. #8
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Learn User32 key commands!

    Google it.

    It's complicated but it's the only way to solve your problem.

  9. #9
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    would someone be able to post a tut on user32.dll for key presses.

  10. #10
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Quote Originally Posted by ppl2pass View Post
    would someone be able to post a tut on user32.dll for key presses.
    Code:
    Timer1.Tick
    if number <= 5000 then
    sendkeys.send(keys.d)
    number = number + 1000
    else
    timer1.enabled = false
    end if
    end sub
    Code:
    Timer1.Interval = 1000
    timer1.enabled = true
    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
    timer.tick...

    Code:
    Dim f1 As Boolean
    
            f1 = GetAsyncKeyState(Keys.F1)
    
            If f1 = True Then
             'your code
            End If
    Last edited by Blubb1337; 03-02-2010 at 04:23 PM.



  11. The Following User Says Thank You to Blubb1337 For This Useful Post:

    ppl2pass (03-02-2010)

  12. #11
    ppl2pass's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Posts
    804
    Reputation
    5
    Thanks
    111
    My Mood
    Amused
    thanks would this code work i wanted to hold the key "D" for 5 seconds?

    Code:
     Timer1
    Dim f1 As Boolean
            Dim number As String
    
    
            f1 = GetAsyncKeyState(Keys.F1)
    
            If f1 = True Then
                Timer1.Interval = 1000
                Timer1.Enabled = True
                If number <= 5000 Then
                    SendKeys.Send(Keys.D)
                    number = number + 1000
                End If
            End If
    btw when i press f2 the numbers 68 show up.
    Last edited by ppl2pass; 03-02-2010 at 04:44 PM.

  13. #12
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    Code:
    Dim f1 As Boolean
            Dim number As String
    
    
            f1 = GetAsyncKeyState(Keys.F1)
    
            If f1 = True Then
                Timer1.Interval = 1000
                Timer1.Enabled = True
                If number <= 5000 Then
                    SendKeys.Send(Keys.D)
                    number = number + 1000
                End If
            End If
    Will work, however, it will not hold the keydown , it will press it, on and off..


     


     


     



    The Most complete application MPGH will ever offer - 68%




  14. #13
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    pinvoke.net: sendinput (user32)

    READ this article, and don't just copy and paste it!

    It'll help you with your problem.

  15. The Following User Says Thank You to Lolland For This Useful Post:

    NextGen1 (03-02-2010)

  16. #14
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    Nextgen is a FREKIN beast at helping people. along with lolland
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  17. The Following User Says Thank You to zmansquared For This Useful Post:

    NextGen1 (03-02-2010)

Similar Threads

  1. My Time.
    By Dave84311 in forum News & Announcements
    Replies: 8
    Last Post: 11-24-2007, 10:45 PM
  2. i think its time for a new sig
    By darkone1149 in forum Help & Requests
    Replies: 9
    Last Post: 02-06-2006, 03:52 PM
  3. Free Infantry, time to kill it
    By Super-Man in forum General Game Hacking
    Replies: 2
    Last Post: 01-09-2006, 01:58 PM
  4. cap 4 flag in 1 time
    By slash83 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 01-04-2006, 04:24 AM