-
strange problem
sup guise i got me a problem with this
its a bot for a popular online game however it results in the first click happening but all clicks done thereafter result in me clicking the window bar at the top
HOW DOES FIX?
also tips with regards to this program and that are very welcome:)
Code:
VERSION 5.00
Begin VB.Form frmmain
BackColor = &H80000004&
BorderStyle = 1 'Fixed Single
ClientHeight = 252
ClientLeft = 120
ClientTop = 744
ClientWidth = 1452
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 252
ScaleWidth = 1452
StartUpPosition = 3 'Windows Default
Begin VB.HScrollBar scrollbar
Height = 252
Left = 0
Max = 5000
Min = 1000
TabIndex = 0
Top = 0
Value = 1000
Width = 1452
End
Begin VB.Timer tmclick
Left = 2160
Top = 600
End
Begin VB.Menu mnufile
Caption = "file"
Begin VB.Menu mnufilerun
Caption = "run"
Shortcut = {F1}
End
Begin VB.Menu mnufilestop
Caption = "stop"
Shortcut = {F2}
End
Begin VB.Menu mnufileexit
Caption = "exit"
Shortcut = {DEL}
End
End
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim gotcurpos As Boolean
Dim click_coordinates1_1 As Integer
Dim click_coordinates1_2 As Integer
Dim click_coordinates2_1 As Integer
Dim click_coordinates2_2 As Integer
Dim click_coordinates3_1 As Integer
Dim click_coordinates3_2 As Integer
Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Sub mouse_event Lib "user32" ( _
ByVal dwFlags As Long, _
ByVal dx As Long, _
ByVal dy As Long, _
ByVal cButtons As Long, _
ByVal dwExtraInfo As Long _
)
Private Const MOUSELEFTDOWN = &H2
Private Const MOUSELEFTUP = &H4
Private Const MOUSERIGHTUP = &H8
Private Const MOUSERIGHTDOWN = &H10
Public Function GetXCursorPos() As Long
Dim pt As POINTAPI
GetCursorPos pt
GetXCursorPos = pt.X
End Function
Public Function GetYCursorPos() As Long
Dim pt As POINTAPI
GetCursorPos pt
GetYCursorPos = pt.Y
End Function
Private Sub Form_Load()
tmclick.Enabled = 0
End Sub
Private Sub mnufilerun_Click()
tmclick.Enabled = 1
tmclick.Interval = scrollbar.Value
End Sub
Private Sub mnufilestop_Click()
tmclick.Enabled = 0
End Sub
Private Sub tmclick_Timer()
If gotcurpos = False Then _
click_coordinates1_1 = GetXCursorPos
If gotcurpos = False Then _
click_coordinates1_2 = GetYCursorPos
gotcurpos = True
click_coordinates2_1 = 350 'var2 x
click_coordinates2_2 = 830 'var2 y
click_coordinates3_1 = click_coordinates2_1
click_coordinates3_1 = click_coordinates2_1 - 50
SetCursorPos click_coordinates1_1, click_coordinates1_2
mouse_event MOUSELEFTDOWN, 0, 0, 0, 0
mouse_event MOUSELEFTUP, 0, 0, 0, 0
SetCursorPos click_coordinates2_1, click_coordinates2_2
mouse_event MOUSERIGHTDOWN, 0, 0, 0, 0
mouse_event MOUSERIGHTUP, 0, 0, 0, 0
SetCursorPos click_coordinates3_1, click_coordinates3_2
mouse_event MOUSELEFTDOWN, 0, 0, 0, 0
mouse_event MOUSELEFTUP, 0, 0, 0, 0
End Sub
-
Re: strange problem
all my internets to the man who solves this
-
Re: strange problem
-
Re: strange problem
I think game cheat bots are verboten on vbforums.
-
Re: strange problem
We don't support cheating at on-line games. Thread closed.