View previous topic :: View next topic |
Author |
Message |
Selene How do I cheat?
Reputation: 0
Joined: 26 Aug 2017 Posts: 5
|
Posted: Thu Apr 04, 2019 10:34 am Post subject: keyUp / keyDown not working on administrator process |
|
|
I have a case where the script checks for an address to have some value and then press right click (simulate) but the process has so much of a higher administrator level that cheat engine can't input. Do I have to manipulate game memory now or is there a GrantAdministrator type of lua line?
Also I know the script is really beginner, it's cuz I am new to LUA.
It works but doesn't ingame.
And the game needs admin rights for save files.
Code: |
test1 = nil
if test1 then
print("timer exists")
test1.Enabled = true
else
test1 = createTimer(test1,true)
test1.setInterval(50)
test1.Enabled = true
end
test1.OnTimer = function(test1)
local ESS = readInteger("[addrres]+8")
if ESS then
if ESS > 1 then
--print("PRESS RBUTTON")
keyDown(VK_RBUTTON)
sleep(100)
keyUp(VK_RBUTTON)
sleep(100)
end
end
if isKeyPressed(VK_K) == true then
test1.destroy()
test1 = nil
print("Broke out")
end
end
|
_________________
I'm just an "odd" one.. |
|
Back to top |
|
 |
TheyCallMeTim13 Wiki Contributor
Reputation: 51
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Thu Apr 04, 2019 11:59 am Post subject: |
|
|
If you're running CE as admin then it shouldn't matter, sounds like it may read the mouse differently.
And if the game only needs admin rights to save, you should change the privileges of the folder it saves to so it doesn't need admin rights; and you should do this with any program, needless admin rights tend to be a security rick.
_________________
|
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Thu Apr 04, 2019 12:20 pm Post subject: |
|
|
Use function to send mouse clicks.
Code: | mouse_event(0x8007, 2560,6826) -- XY = 100x150 calculated absolute position |
Left button
0x8007 = {MOUSEEVENTF_ABSOLUTE,MOUSEEVENTF_LEFTDOWN, MOUSEEVENTF_LEFTUP,MOUSEEVENTF_MOVE}
Right button
0x8019 = {MOUSEEVENTF_ABSOLUTE,MOUSEEVENTF_RIGHTDOWN, MOUSEEVENTF_RIGHTUP,MOUSEEVENTF_MOVE}
Single Click in relative to current mouse position
Left button
0x7
Right button
0x19
MOUSEEVENTF_ABSOLUTE means we provide cords
function to calculate absolute position (from X,Y)
Code: | local function CalculateAbsoluteCoordinateX(input,width)
if (not (type(input)=='number' and type(width)=='number')) then
return false
end
return math.floor((input * 65536) / width);
end
local function CalculateAbsoluteCoordinateY(input,height)
if (not (type(input)=='number' and type(height)=='number')) then
return false
end
return math.floor((input * 65536) / height);
end |
source: https://forum.cheatengine.org/viewtopic.php?p=5688755#5688755
to press relative to current position call it this way:
Code: | --Left Click
mouse_event(0x7)
--Right click
mouse_event(0x19)
|
More information at MSDN: https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-mouse_event
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
Selene How do I cheat?
Reputation: 0
Joined: 26 Aug 2017 Posts: 5
|
Posted: Thu Apr 04, 2019 1:01 pm Post subject: |
|
|
So 0x19 is "move", "right click down" and "right click up"
But why "move" in particular? I just need it to rclick so why not 0x18
Or was it a mistake?
_________________
I'm just an "odd" one.. |
|
Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Thu Apr 04, 2019 1:52 pm Post subject: |
|
|
Selene wrote: |
So 0x19 is "move", "right click down" and "right click up"
But why "move" in particular? I just need it to rclick so why not 0x18
Or was it a mistake? |
Yes mistake, as I use this to also move the mouse.
_________________
I'm rusty and getting older, help me re-learn lua. |
|
Back to top |
|
 |
|