Go Back   Gaming Gutter > Non-Gaming > Programming > Tutorials


Tutorials - Looking for programming tutorials to increase your knowledge? Do so here.

» Site Navigation
» Home
» FAQ
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Advertisement
» Recent Threads
Go to first new post Buying 4 month old...
Today 02:19 PM
by mika
Last post by mika
Today 06:11 PM
2 Replies, 3 Views
Go to first new post Redemption?
Today 05:57 PM
by Fly_Boy
Last post by Baby Doll
Today 06:10 PM
5 Replies, 6 Views
Go to first new post Need a MM
Today 06:09 PM
Last post by GoFlyersGo
Today 06:09 PM
0 Replies, 1 Views
Go to first new post Lolatquilt's Underground...
Yesterday 07:46 PM
Last post by Tyler
Today 06:09 PM
2 Replies, 3 Views
Go to first new post I'm back.
Today 05:37 PM
Last post by Baby Doll
Today 06:08 PM
18 Replies, 19 Views
Reply
 
LinkBack Thread Tools Display Modes

 [VB6] How to move the mouse. + Wait Function! [VB6]
Old 08-07-2007, 06:48 PM   #1 (permalink)
Dustyßottems Dustyßottems is online now Gender Male
Full Member
 
Dustyßottems's Avatar
 
Dustyßottems is online now
Join Date: Apr 2007
Location: somewhere up north
Age: 15
Posts: 43
iTrader: 0 / 0%
Dustyßottems Is gaining popularity
Rep Power: 5
Exclamation [VB6] How to move the mouse. + Wait Function! [VB6]

Dustyßottems,
Guide to moving the mouse.


*Note this guide will be writtin step by step, if you mess up.. go outside.

Step 1. Ok open VB6 and start a new .exe project.

Step 2. Add a module (Fig 1.1) and paste the following code into it. (Fig 1.2)

Fig 1.1:


Fig 1.2:
Code:
 
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long 
Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long 
Public Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long 
Public Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long 
Public Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long 
Public Type PointAPI 
    x As Long 
    y As Long 
End Type 
Public Type RECT 
    Left As Long 
    Top As Long 
    Right As Long 
    Bottom As Long 
End Type
Step 2: On your main form add a command button (Do not rename!) then double click on it and call on the module you just made! (Fig 1.3)

Fig 1.3:
Code:
 
SetCursorPos 0, 0
Start her up and hit your command button your mouse should move to the top left hand corner

Now your probabley thinking "This is great and everything but how do i add wait times and make a REAL bot???"

Wait Times

Let's a go!

Step 1: On your current form go to the coding window and scroll down to the very bottom of your code, add this (Fig 1.4)

Fig 1.4:
Code:
 
Public Declare Function timeGetTime Lib "winmm.dll" () As Long 
Public Sub Waitms(Milliseconds As Long) 
  Dim Time1 As Long 
  Time1 = timeGetTime() 
  'Take the time at this point and set it as a variable 

  Do 
    DoEvents 
  'You should know what this does 

  Loop While Time1 + Milliseconds > timeGetTime() 
  'Continue the loop as long as Time1 plus Milliseconds is greater than the 
  'current time.  Eventually the current time will be greater than time1 
  'plus milliseconds and the function will be done waiting. 

End Sub
*Note: i took the time to comment it, read it please?

To use simply call on it as so:
Code:
Waitms (Speed + RandWait)
Well thats it i hope it helps you create more bots and such, +Rep is highly welcome.
  Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Powered by vBadvanced CMPS v3.0 RC2

All times are GMT -7. The time now is 06:11 PM.


vBulletin skin developed by: eXtremepixels
The contents of this webpage are copyright © 2006-2008 GamingGutter.com. All Rights Reserved.

Page generated in 0.15880704 seconds (100.00% PHP - 0% MySQL) with 19 queries