Adblock breaks this site

Help with SendKeysHuman

Discussion in 'Programming General' started by Rs2Cheater.net, Sep 27, 2007.

  1. Rs2Cheater.net

    Rs2Cheater.net Member

    Joined:
    Jul 30, 2007
    Posts:
    65
    Referrals:
    0
    Sythe Gold:
    0
    Help with SendKeysHuman

    okay, i would post this in the VB 6 section but its been shut down.

    Does anyone have any tuts or help they can give me for making a script that sends keys like a human. I have found some source code by searching sythe, however i would like to learn VB instead of just copying and pasting.

    Ty :D
     
  2. X Zero

    X Zero Forum Addict

    Joined:
    Jan 21, 2007
    Posts:
    577
    Referrals:
    0
    Sythe Gold:
    0
    Help with SendKeysHuman

    For vb6?
     
  3. Maglor

    Maglor Guest

    Referrals:
    0
    Help with SendKeysHuman

    Id like it for VB.Net. I got the sendkeys thing, but a humantype would be better
     
  4. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Help with SendKeysHuman

    just something simple. requires a timer called 'send', a textbox called 'msg_txt', and two buttons called 'start_btn' and 'stop_btn'

    Code:
        Dim count As Integer = 0
    
        Private Function HumanKeys(ByVal Text As String) As Boolean
            If count = Text.Length Then count = 0 : Return True
            Console.WriteLine(count)
            Console.WriteLine(Text.Length - count)
            System.Windows.Forms.SendKeys.Send(Text.Substring(count, 1))
            count += 1
            Return False
        End Function
    
        Private Function GenInterval() As Integer
            Randomize()
            Dim R As New Random()
            Return R.Next(100, 500)
        End Function
    
        Private Sub start_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles start_btn.Click
            Send.Start()
        End Sub
    
        Private Sub stop_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stop_btn.Click
            Send.Stop()
        End Sub
    
        Private Sub Send_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Send.Tick
            Send.Interval = Math.Abs(GenInterval())
            If HumanKeys(msg_txt.Text) = True Then Send.Stop()
        End Sub
    if you want the interval it types to be wider or shorter, edit the '100, 500' in GenInterval to whatever you want (in milliseconds), considering 100 is the minimum value and 500 is the max. Minimum value can't go below zero!
     
  5. Rs2Cheater.net

    Rs2Cheater.net Member

    Joined:
    Jul 30, 2007
    Posts:
    65
    Referrals:
    0
    Sythe Gold:
    0
    Help with SendKeysHuman

    I tryed this and it works but it makes loads of spelling mistakes?
     
  6. Nullware

    Nullware Guru

    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0
    Help with SendKeysHuman

    Mistakes would either be caused by logical errors in the code or by too short of an interval set between characters.

    Also, the VB6 section has been reopened so if it's VB6 that you're interested in doing this for, you can now make a topic in there. I'd also be willing to help you if you like, my MSN is in my profile.
     
  7. Terrankiller

    Terrankiller Ex-Administrator
    Retired Administrator Visual Basic Programmers

    Joined:
    May 7, 2005
    Posts:
    1,286
    Referrals:
    1
    Sythe Gold:
    1
    Help with SendKeysHuman

    Why even use a timer? I'll write a couple functions for .net.
     
  8. Swan

    Swan When They Cry...
    Retired Global Moderator

    Joined:
    Jan 23, 2007
    Posts:
    4,957
    Referrals:
    0
    Sythe Gold:
    0
    Sythe's 10th Anniversary Member of the Month Winner
    Help with SendKeysHuman

    I wrote it in a hurry, to be honest.

    -- not to mention it wasn't made to be the best.
     
< [request] Runescape Classic World Links | [REQ] Basic IDS >


 
 
Adblock breaks this site