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 


How to perform mouse click in LUA?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Sat Jan 12, 2013 3:04 pm    Post subject: How to perform mouse click in LUA? Reply with quote

How can you perform a mouse click in LUA.. like, I want make a sort of a bot that will repeat the stuff while you AFKor something.
So I got a form, button.
On button click it moving mouse coord to some spot, but I can't make it click on it?
tried
Code:
keyUp(VK_LBUTTON)
keyDown(VK_LBUTTON)

tried
Code:
keyUp(VK_LBUTTON)
sleep(10)
keyDown(VK_LBUTTON)

tried
Code:
keyDown(GetAsyncKeyState(VK_LBUTTON))
sleep(10)
keyUp(GetAsyncKeyState(VK_LBUTTON))

(which giving error)

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
ablonevn
Advanced Cheater
Reputation: 1

Joined: 02 Oct 2011
Posts: 59

PostPosted: Sun Jan 13, 2013 1:53 am    Post subject: Re: How to perform mouse click in LUA? Reply with quote

Flashacking wrote:
How can you perform a mouse click in LUA.. like, I want make a sort of a bot that will repeat the stuff while you AFKor something.
So I got a form, button.
On button click it moving mouse coord to some spot, but I can't make it click on it?
tried
Code:
keyUp(VK_LBUTTON)
keyDown(VK_LBUTTON)

tried
Code:
keyUp(VK_LBUTTON)
sleep(10)
keyDown(VK_LBUTTON)

tried
Code:
keyDown(GetAsyncKeyState(VK_LBUTTON))
sleep(10)
keyUp(GetAsyncKeyState(VK_LBUTTON))

(which giving error)

i think you can not do that because wndproc of target window dont retrive event VK_LBUTTON, or it override VK_LBUTTON you register from lua. these is only way to make vl_BUTton down is using assmbler and sendmessage to send wm_lbuttondowm and coordinates in lparams to target window. and one thing more, as i known, it seem these is no GetAsyncKeyState for mouse button or gamepad
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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