Introduction to Sendkeys() - by Cody

Discussion in 'Archives' started by Six, May 12, 2007.

Introduction to Sendkeys() - by Cody
  1. Unread #1 - May 12, 2007 at 10:54 AM
  2. Six
    Joined:
    Jan 21, 2007
    Posts:
    1,482
    Referrals:
    4
    Sythe Gold:
    12

    Six Guru

    Introduction to Sendkeys() - by Cody

    any of the first programs made for Runescape are Word Spammers, Also known as a way to push a key to send text

    Visual basic has a function called Sendkeys which allows you to do this and in this tutorial you will learn how to do it.

    First of all you will be using timers. Timers are the Image icon

    Drag it to your client screen (dont worry it wont show up in the program)

    In the properties window make sure the interval is set to about 1000. 1000 is 1 second in miliseconds

    and make a textbox named text1

    Now for the code

    First declare this at the top of your code screen


    Code:
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer

    This is a function to check what key is pressed.

    Now for the timer insert this code


    Code:
    Private Sub Timer1_Timer()
    If GetAsyncKeyState(vbKeyF1) Then
    SendKeys text1.Text
    SendKeys "{Enter}"
    End If

    this will send what ever is in text1 and will also press enter when you press F1.

    To press enter you use

    Code:
    SendKeys "{Enter}"
    if you also wanted to send some text use

    Code:
    SendKeys "OMG"

    now that was WAY easy. say you wanted to change the F key

    just change the # in

    Code:
    If GetAsyncKeyState(vbKeyF#) Then


    ok now say you want to be able to change the interval of the timer within the program. THis is also very easy to do

    Make a new textbox called text2 and make a command button called command1

    Put this code into your form

    Code:
    Private Sub Command1_Click()
    Timer1.Interval = Text1.Text
    End Sub

    this will make it so the user can put in how many milliseconds to wait to do the next sendkeys if you want to be able to just type the seconds add a * 1000 at the end if text1.text


    now here is the SOURCE CODE to one of my word bots i made for a game:

    DOWNLOAD: http://omglol.info/WordSpam.zip

    [​IMG]
     
< S3LL1NG 0.W.N.A.G.E. B4rr4g3r with dt done, and also 85str and 70+ att!!! | sellin lvl 52 wit 76 fishin and 77 cookin >

Users viewing this thread
1 guest


 
 
Adblock breaks this site