Hey guys I have written a pretty simple piece of code in visual basic 6.0 to simulate mouse clicks in a game I play, It seems to run perfectly fine up until the program has been running for a certain time (Roughly 2 hours I had to record it as it has happened multiple times at about 2 hours in)
I can't seem to figure out why the labels and counter disappear from the program and the timers and program stop running (I have attached a couple of images below of what happens)
Here is the code below any help would be much appreciated thank you.
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const KEYEVENTF_KEYUP = &H2
Public Sub Wait(Optional ms As Long = 2000)
On Error Resume Next
Dim tc As Long
tc = GetTickCount
While GetTickCount < tc + ms: Sleep 1: DoEvents: Wend
End Sub
Public Function RandomNumber(ByVal MinValue As Long, Optional _
ByVal MaxValue As Long = 0)
On Error Resume Next
Randomize Timer
RandomNumber = Int((MaxValue - MinValue + 1) * Rnd) + MinValue
End Function
Public Sub KeyDown(KCC As KeyCodeConstants)
keybd_event KCC, 0, 0, 0
End Sub
Public Sub KeyUp(KCC As KeyCodeConstants)
keybd_event KCC, 0, KEYEVENTF_KEYUP, 0
End Sub
Private Sub cmd_Start_Click()
If cmd_Start.Caption = "Start" Then
cmd_Start.Caption = "Stop"
initializeTrainer
Else
End
End If
End Sub
Public Function initializeTrainer()
If GetPixel(GetWindowDC(0), 822, 480) = "4746367" Then 'Tree is spawned
Call SetCursorPos(RandomNumber(750, 850), RandomNumber(420, 570)) ' Click tree
lbl_Status.Caption = "Cutting"
Timer2.Enabled = False
lbl_Timeout.Caption = "0"
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
Wait (1600)
Timer1.Enabled = True
Else
If lbl_Timeout.Caption = "20" Then
cmd_Start.Caption = "Error"
lbl_Status.Caption = "Error"
Beep 500, 5000
Else
lbl_Status.Caption = "Idle..."
Timer2.Enabled = True
Wait (600)
Call initializeTrainer
End If
End If
End Function
Private Sub Timer1_Timer()
If GetPixel(GetWindowDC(0), 100, 55) = "0" Then
lbl_Status.Caption = "Not cutting"
Timer1.Enabled = False
lbl_Status.Caption = "Clearing inventory..."
Call clearInventory
End If
End Sub
Public Function clearInventory()
KeyDown vbKeyShift
If GetPixel(GetWindowDC(0), 808, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
Wait (300)
KeyUp vbKeyShift
Call initializeTrainer
End Function
Private Sub Form_Load()
Call SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub
Private Sub Timer2_Timer()
lbl_Timeout.Caption = lbl_Timeout.Caption + 1
End Sub
![Name: 1.png
Views: 39
Size: 17.4 KB]()
![Name: 222.png
Views: 34
Size: 15.5 KB]()
I can't seem to figure out why the labels and counter disappear from the program and the timers and program stop running (I have attached a couple of images below of what happens)
Here is the code below any help would be much appreciated thank you.
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_EXTENDEDKEY = &H1
Private Const KEYEVENTF_KEYUP = &H2
Public Sub Wait(Optional ms As Long = 2000)
On Error Resume Next
Dim tc As Long
tc = GetTickCount
While GetTickCount < tc + ms: Sleep 1: DoEvents: Wend
End Sub
Public Function RandomNumber(ByVal MinValue As Long, Optional _
ByVal MaxValue As Long = 0)
On Error Resume Next
Randomize Timer
RandomNumber = Int((MaxValue - MinValue + 1) * Rnd) + MinValue
End Function
Public Sub KeyDown(KCC As KeyCodeConstants)
keybd_event KCC, 0, 0, 0
End Sub
Public Sub KeyUp(KCC As KeyCodeConstants)
keybd_event KCC, 0, KEYEVENTF_KEYUP, 0
End Sub
Private Sub cmd_Start_Click()
If cmd_Start.Caption = "Start" Then
cmd_Start.Caption = "Stop"
initializeTrainer
Else
End
End If
End Sub
Public Function initializeTrainer()
If GetPixel(GetWindowDC(0), 822, 480) = "4746367" Then 'Tree is spawned
Call SetCursorPos(RandomNumber(750, 850), RandomNumber(420, 570)) ' Click tree
lbl_Status.Caption = "Cutting"
Timer2.Enabled = False
lbl_Timeout.Caption = "0"
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
Wait (1600)
Timer1.Enabled = True
Else
If lbl_Timeout.Caption = "20" Then
cmd_Start.Caption = "Error"
lbl_Status.Caption = "Error"
Beep 500, 5000
Else
lbl_Status.Caption = "Idle..."
Timer2.Enabled = True
Wait (600)
Call initializeTrainer
End If
End If
End Function
Private Sub Timer1_Timer()
If GetPixel(GetWindowDC(0), 100, 55) = "0" Then
lbl_Status.Caption = "Not cutting"
Timer1.Enabled = False
lbl_Status.Caption = "Clearing inventory..."
Call clearInventory
End If
End Sub
Public Function clearInventory()
KeyDown vbKeyShift
If GetPixel(GetWindowDC(0), 808, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 717) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(713, 728))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 753) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(750, 765))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 789) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(784, 799))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 825) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(822, 833))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 861) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(858, 871))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 896) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(894, 907))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 808, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(810, 828), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 850, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(850, 868), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 892, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(890, 908), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
If GetPixel(GetWindowDC(0), 934, 933) = "4617881" Then
Call SetCursorPos(RandomNumber(930, 948), RandomNumber(929, 940))
Wait (RandomNumber(260, 360))
Mouse_Click (vLeftclick)
lbl_Counter.Caption = lbl_Counter.Caption + 1
End If
Wait (300)
KeyUp vbKeyShift
Call initializeTrainer
End Function
Private Sub Form_Load()
Call SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Sub
Private Sub Timer2_Timer()
lbl_Timeout.Caption = lbl_Timeout.Caption + 1
End Sub