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 


Help getMousePos

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

Joined: 09 Jun 2021
Posts: 43

PostPosted: Mon Nov 08, 2021 11:23 pm    Post subject: Help getMousePos Reply with quote

getMousePos: returns the x,y coordinates of the mouse

How do I find out the mouse position if the function does not return it.



MousePos.png
 Description:
 Filesize:  8.29 KB
 Viewed:  1884 Time(s)

MousePos.png


Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Nov 08, 2021 11:36 pm    Post subject: Reply with quote

You are not calling the function by doing that. It returns two values as well so you'd want to store/use them like this:

Code:

local x, y = getMousePos();
print(x);
print(y);

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
vovasivy
Cheater
Reputation: 0

Joined: 09 Jun 2021
Posts: 43

PostPosted: Tue Nov 09, 2021 12:08 am    Post subject: Reply with quote

Thanks, it works - print (getMousePos()).
Sorry I forgot about the brackets.


Another question, why is
doKeyPress (VK_Enter) not working.
doKeyPress(0x0D) or doKeyPress(13) - works.
And how can I call a keyboard shortcut, for example Ctrl+ Alt+ R.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Nov 09, 2021 12:57 am    Post subject: Reply with quote

when testing i recommend using 'return' as it gives more info than print
e.g
Code:

return getMousePos()


coincidentally, it's not VK_Enter, it's VK_RETURN

as for multiple keys use keyDown(key) for each key, then wait 100 ms or so, and thrn keyUp(key) for the pressed keys

_________________
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
vovasivy
Cheater
Reputation: 0

Joined: 09 Jun 2021
Posts: 43

PostPosted: Tue Nov 09, 2021 1:21 am    Post subject: Reply with quote

Thanks.
And how to wait 100ms.
I would be grateful if you write a full emulation call Ctrl + Alt + R.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3324

PostPosted: Tue Nov 09, 2021 5:39 am    Post subject: Reply with quote

vovasivy wrote:
And how to wait 100ms.

You close your eye for exactly 100ms.
Set an alarm on your clock, if needed.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Nov 09, 2021 5:46 am    Post subject: Reply with quote

sleep(100)
_________________
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
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