• Log in or sign up for an account here: https://www.sythe.org/login

Introduction to Sendkeys() - by Cody

Six

Guru
Joined
Jan 21, 2007
Sythe Gold
12
Messages
1,482
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

wordbotpic9ne.png
 
Runescape Gamblingrunescape gambling
Back
Top