Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Auto Clicker (VB6)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Chobito1337
Expert Cheater
Reputation: 2

Joined: 06 May 2008
Posts: 197

PostPosted: Sun Mar 13, 2011 6:20 pm    Post subject: Auto Clicker (VB6) Reply with quote

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&current=Clicker001.png

_________________

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
Back to top
View user's profile Send private message
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Sun Mar 13, 2011 6:33 pm    Post subject: Reply with quote

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

_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Chobito1337
Expert Cheater
Reputation: 2

Joined: 06 May 2008
Posts: 197

PostPosted: Sun Mar 13, 2011 6:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Sun Mar 13, 2011 6:38 pm    Post subject: Reply with quote

ohh, i forgot to add...

add another timer to your project (Timer2)

_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Chobito1337
Expert Cheater
Reputation: 2

Joined: 06 May 2008
Posts: 197

PostPosted: Sun Mar 13, 2011 6:39 pm    Post subject: Reply with quote

Yeah, I did that, too.
_________________

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
Back to top
View user's profile Send private message
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Sun Mar 13, 2011 6:40 pm    Post subject: Reply with quote

now, fix form_load to this:

Code:
Private Sub Form_Load()
Timer1.Enabled = False
Text1.Text = 1000
Timer2.Interval = 1
End Sub

_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Chobito1337
Expert Cheater
Reputation: 2

Joined: 06 May 2008
Posts: 197

PostPosted: Sun Mar 13, 2011 6:42 pm    Post subject: Reply with quote

Still nothing. :\
_________________

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
Back to top
View user's profile Send private message
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Sun Mar 13, 2011 6:47 pm    Post subject: Reply with quote

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

_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Chobito1337
Expert Cheater
Reputation: 2

Joined: 06 May 2008
Posts: 197

PostPosted: Sun Mar 13, 2011 6:49 pm    Post subject: Reply with quote

It still doesn't click >.<
_________________

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
Back to top
View user's profile Send private message
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Sun Mar 13, 2011 6:51 pm    Post subject: Reply with quote

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

_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Chobito1337
Expert Cheater
Reputation: 2

Joined: 06 May 2008
Posts: 197

PostPosted: Sun Mar 13, 2011 6:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
Radiation
Grandmaster Cheater
Reputation: 14

Joined: 17 Jun 2009
Posts: 842
Location: Chernobyl

PostPosted: Sun Mar 13, 2011 6:55 pm    Post subject: Reply with quote

check out the link, i made an autoclicker:

http://dl.dropbox.com/u/4461017/Mouse%20Clicker.exe

if you want the source:

http://dl.dropbox.com/u/4461017/mouse%20clicker.zip

_________________
Jesus loves you, Hitler! Smile

Playing/Embedding XM and MOD files in Visual Basic 6

.erutangis ruoy ni siht esu neht ,sdrawkcab siht daer ot hguone trams erew uoy fI
I can spell your name backwards: ‮Hitler
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites