View previous topic :: View next topic |
Author |
Message |
vovasivy Cheater
Reputation: 0
Joined: 09 Jun 2021 Posts: 43
|
Posted: Mon Nov 08, 2021 11:23 pm Post subject: Help getMousePos |
|
|
getMousePos: returns the x,y coordinates of the mouse
How do I find out the mouse position if the function does not return it.
Description: |
|
Filesize: |
8.29 KB |
Viewed: |
1884 Time(s) |

|
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 08, 2021 11:36 pm Post subject: |
|
|
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 |
|
 |
vovasivy Cheater
Reputation: 0
Joined: 09 Jun 2021 Posts: 43
|
Posted: Tue Nov 09, 2021 12:08 am Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25792 Location: The netherlands
|
Posted: Tue Nov 09, 2021 12:57 am Post subject: |
|
|
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 |
|
 |
vovasivy Cheater
Reputation: 0
Joined: 09 Jun 2021 Posts: 43
|
Posted: Tue Nov 09, 2021 1:21 am Post subject: |
|
|
Thanks.
And how to wait 100ms.
I would be grateful if you write a full emulation call Ctrl + Alt + R.
|
|
Back to top |
|
 |
Csimbi I post too much
Reputation: 97
Joined: 14 Jul 2007 Posts: 3324
|
Posted: Tue Nov 09, 2021 5:39 am Post subject: |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25792 Location: The netherlands
|
Posted: Tue Nov 09, 2021 5:46 am Post subject: |
|
|
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 |
|
 |
|