 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Chobito1337 Expert Cheater
Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 6:20 pm Post subject: Auto Clicker (VB6) |
|
|
So now I want to make an auto clicker.
It's got a test box, a timer, and some labels
I want the clicker to start clicking the interval in the textbox upon pressing F11
I want the clicker to stop clicking upon pressing F12.
Thanks in advance.
This is the current code, tell me what's necessary/what to change
Code: |
Private Declare Sub MOUSE_EVENT Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
Private Const MOUSEEVENTF_LEFTDOWN = &H2 'left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 'left button up
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = Text1.Text
End Sub
Private Sub Timer1_Timer()
MOUSE_EVENT MOUSELEFTDOWN, 0, 0, 0, 0 'left button goes down
MOUSE_EVENT MOUSELEFTUP, 0, 0, 0, 0 'left button comes up
If GetKeyPress(vbKeyF11) Then
Timer1.Enabled = True
End If
If GetKeyPress(vbKeyF12) Then
Timer1.Enabled = False
End If
End Sub
|
Edit: It looks like this
http://s250.photobucket.com/albums/gg247/bopo245/?action=view¤t=Clicker001.png
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
 |
Radiation Grandmaster Cheater
Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sun Mar 13, 2011 6:33 pm Post subject: |
|
|
try:
Code: | Private Declare Sub MOUSE_EVENT Lib "user32" Alias "mouse_event" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
Private Const MOUSEEVENTF_LEFTDOWN = &H2 'left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 'left button up
Private Sub Form_Load()
Timer1.Enabled = False
Text1.Text = 1000
End Sub
Private Sub Text1_Change()
Timer1.Interval = Text1.Text
End Sub
Private Sub Timer1_Timer()
'Clicking Timer
MOUSE_EVENT MOUSELEFTDOWN, 0, 0, 0, 0 'left button goes down
MOUSE_EVENT MOUSELEFTUP, 0, 0, 0, 0 'left button comes up
End Sub
Private Sub Timer2_Timer()
'Hotkey Timer
If GetKeyPress(vbKeyF11) Then
Timer1.Enabled = True
End If
If GetKeyPress(vbKeyF12) Then
Timer1.Enabled = False
End If
End Sub
|
_________________
|
|
Back to top |
|
 |
Chobito1337 Expert Cheater
Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 6:37 pm Post subject: |
|
|
Didn't work. I think we just have the wrong clicking part.
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
 |
Radiation Grandmaster Cheater
Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sun Mar 13, 2011 6:38 pm Post subject: |
|
|
ohh, i forgot to add...
add another timer to your project (Timer2)
_________________
|
|
Back to top |
|
 |
Chobito1337 Expert Cheater
Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 6:39 pm Post subject: |
|
|
Yeah, I did that, too.
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
 |
Radiation Grandmaster Cheater
Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sun Mar 13, 2011 6:40 pm Post subject: |
|
|
now, fix form_load to this:
Code: | Private Sub Form_Load()
Timer1.Enabled = False
Text1.Text = 1000
Timer2.Interval = 1
End Sub |
_________________
|
|
Back to top |
|
 |
Chobito1337 Expert Cheater
Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 6:42 pm Post subject: |
|
|
Still nothing. :\
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
 |
Radiation Grandmaster Cheater
Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sun Mar 13, 2011 6:47 pm Post subject: |
|
|
got it! now try this (replace the old entire code):
Code: | Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
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 LEFTDown = &H2
Private Const LEFTUP = &H4
Private Const MIDDLEDOWN = &H20
Private Const MIDDLEUP = &H40
Private Const MMOVE = &H1
Private Const ABSOLUTE = &H8000
Private Const RIGHTDOWN = &H8
Private Const RIGHTUP = &H10
Private Sub Form_Load()
Text1.Text = 1000
Timer1.Enabled = False
Timer1.Interval = 1000
Timer2.Enabled = True
Timer2.Interval = 1
End Sub
Private Sub Text1_Change()
Timer1.Interval = Text1.Text
End Sub
Private Sub Timer1_Timer()
'Clicking Timer
LeftClick
End Sub
Private Sub Timer2_Timer()
'Hotkey Timer
If GetKeyPress(vbKeyF11) Then
Timer1.Enabled = True
End If
If GetKeyPress(vbKeyF12) Then
Timer1.Enabled = False
End If
End Sub
Private Sub LeftClick()
mouse_event LEFTDown, 0, 0, 0, 0
mouse_event LEFTUP, 0, 0, 0, 0
End Sub
Private Sub RightClick()
mouse_event RIGHTDOWN, 0&, 0&, cButt, dwEI
mouse_event RIGHTUP, 0&, 0&, cButt, dwEI
End Sub |
_________________
|
|
Back to top |
|
 |
Chobito1337 Expert Cheater
Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 6:49 pm Post subject: |
|
|
It still doesn't click >.<
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
 |
Radiation Grandmaster Cheater
Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
Posted: Sun Mar 13, 2011 6:51 pm Post subject: |
|
|
make sure you form_load looks like this:
Code: | Private Sub Form_Load()
Text1.Text = 1000
Timer1.Enabled = False
Timer1.Interval = 1000
Timer2.Enabled = True
Timer2.Interval = 1
End Sub |
now, make sure you have timer1, timer2, and text1 objects on your form
look what i did before:
http://dl.dropbox.com/u/4461017/Mouse%20Clicker.exe
_________________
|
|
Back to top |
|
 |
Chobito1337 Expert Cheater
Reputation: 2
Joined: 06 May 2008 Posts: 197
|
Posted: Sun Mar 13, 2011 6:53 pm Post subject: |
|
|
Alright, now it works. Thanks again, dude! I'll +rep tomorrow cuz I forgot to give you it yesterday, so I gave it to u today.
_________________
.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI |
|
Back to top |
|
 |
Radiation Grandmaster Cheater
Reputation: 14
Joined: 17 Jun 2009 Posts: 842 Location: Chernobyl
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|