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 Click In Lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Sting9x
Expert Cheater
Reputation: 0

Joined: 27 Jul 2016
Posts: 124

PostPosted: Sat Dec 03, 2016 6:12 am    Post subject: Auto Click In Lua Reply with quote

When I move the mouse to a certain position. I will press the one hotkey presets and my cursor will auto click. Please give me one code. Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Sat Dec 03, 2016 7:30 am    Post subject: Reply with quote

this will press the left mouse button when f2 has been pressed
Code:

function bla()
  mouse_event(MOUSEEVENTF_LEFTDOWN)
  sleep(100)
  mouse_event(MOUSEEVENTF_LEFTUP)
end

if hk then
  hk.destroy()
  hk=nil
end
hk=createHotkey(bla,VK_F2)


another related topic:
http://forum.cheatengine.org/viewtopic.php?p=5698224#5698224

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Sting9x
Expert Cheater
Reputation: 0

Joined: 27 Jul 2016
Posts: 124

PostPosted: Thu Dec 15, 2016 2:19 am    Post subject: Reply with quote

Code:
if mytimer == nil then
  mytimer = createTimer(nil, false)
end
mytimer.OnTimer = function(timer)
  mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP)
end
mytimer.Interval = 1

if myhotkey then
  myhotkey.Destroy()
end
myhotkey = createHotkey(function()
  mytimer.Enabled = not mytimer.Enabled
end, VK_CONTROL)

Is there any way the mouse pointer kept in one location when I activate this code does not ??? Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Dec 15, 2016 3:40 am    Post subject: Reply with quote

play with those two commands:
Code:
 
x, y=getMousePos()
setMousePos(x, y)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
catfood
Cheater
Reputation: 0

Joined: 22 Jun 2015
Posts: 34

PostPosted: Mon Apr 17, 2017 10:05 am    Post subject: Reply with quote

Hey, I tried all of the scripts in this thread and the other one Dark Byte mentioned.

What i did was

[enable]
{$lua}
<script>
[disable]


and did the f2, ctrl, or whatever else the trigger was. with all of the scripts in this and the other thread, it caused Lua Engine to popup with errors looping, so i had to force close CE each time.


am i applying this correctly to my table?
Thanks
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 Lua Scripting 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