Rem-> Coded by Jazz00006
Rem-> Please remember to give credit if you use this in your project
Rem-> Visit http://jazz.cruels.net/ for more source or
Rem-> http://cruels.net to learn more about coding, we have a great forum
Rem-> and friendly staff, it is a good place to learn.
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, _
ByVal Y As Long) As Long
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Private Sub Form_Load()
MsgBox "Jazz Owns"
End Sub
Private Sub Command1_Click()
Rem-> Declare our variables
Dim SplitOut() As String
Dim i As Integer
Rem-> First some error checking
If InStr(1, Text1.Text, ",", vbTextCompare) = 0 Then MsgBox "Make sure you " & _
"have entered in two co-ordinates seperated " & _
"by a comma!", _
vbCritical = vbOKOnly, "Error": Exit Sub
SplitOut = Split(Text1.Text, ",")
For i = 0 To 1
If Not IsNumeric(SplitOut(i)) Then MsgBox "You have not entered in a valid number for" & _
" value number " & i + 1, vbCritical = vbOKOnly, _
"Error": Exit Sub
Next i
If Not IsNumeric(Text2.Text) Then MsgBox "Make sure you have entered in a " & _
"number for the wait time!", _
vbCritical = vbOKOnly, "Error": Exit Sub
Rem-> Now we add the data into a listbox
List1.AddItem CInt(SplitOut(0)) & "|" & CInt(SplitOut(1))
Rem-> And we hide the wait time.... why? Because I want to _
confuse you!
List1.ItemData(List1.ListCount - 1) = CLng(Text2.Text)
End Sub
Private Sub Command2_Click()
Rem-> I wonder what this does >_<
List1.Clear
End Sub
Private Sub Command3_Click()
Rem-> Lets declare the value i
Dim i As Long
Rem-> For each value we have entered into the listbox
For i = 0 To List1.ListCount - 1
Rem-> select each value
List1.ListIndex = i
Rem-> Grab the X and Y co-ordinates, and move the mouse there
SetCursorPos CLng(Split(List1.Text, "|")(0)), CLng(Split(List1.Text, "|")(0))
Rem-> Wait for the specified time
Wait List1.ItemData(List1.ListCount - 1)
Next i
End Sub
Public Sub Wait(TimeOut As Long)
Rem-> Declare the variable TimeNow
Dim TimeNow As Long
Rem-> Get the starting time
TimeNow = timeGetTime()
Rem-> Loop
Do
Rem-> Make the program go so it doesn't freeze
DoEvents
Rem-> Check to see if we have gone over the wait time _
if we have, then end the loop and let the program _
get on with what it is doing.
Loop While TimeNow + TimeOut > timeGetTime()
End Sub