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 


press keyboard botton in LUA?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
happyreadygo
Advanced Cheater
Reputation: 1

Joined: 14 Sep 2011
Posts: 87

PostPosted: Fri Aug 31, 2012 3:20 pm    Post subject: press keyboard botton in LUA? Reply with quote

are there any LUA function to do a keyboard function?

forexample..
Code:

for i=1,totalUnits do
        writeInteger(currentAddress,valuesForEachUnit[i])
        currentAddress=currentAddress+0x8
     
       **keyboardpress("n") --pressing "n" is a hotkey in the game.
end


This way ,, when I copy a specific value to each unit. It ll automatic pressing botton "N" for each one . When "n" is a hotkey in a game to do something.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Fri Aug 31, 2012 3:29 pm    Post subject: Reply with quote

These might help
Code:


keyDown(key) : causes the key to go into down state
sleep(milliseconds)
keyUp(key) :causes the key to go up
doKeyPress(key) : simulates a key press

VK_N is the keycode to use
Note though that this does not work for all games. If that happens you could try a code injection in the game that does the n-key press internally when a specific address has value 1(which is set by your script)

_________________
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
happyreadygo
Advanced Cheater
Reputation: 1

Joined: 14 Sep 2011
Posts: 87

PostPosted: Fri Aug 31, 2012 3:45 pm    Post subject: Reply with quote

thankyou , i ll try it.
Back to top
View user's profile Send private message
mikey1993
Newbie cheater
Reputation: 0

Joined: 20 Jul 2017
Posts: 22

PostPosted: Sat Jul 22, 2017 2:33 pm    Post subject: Reply with quote

This is a 5 year old post. I'm hoping that new information is available during that time.

I've tried the functions you mentioned DarkByte but they don't appear to be working with the game I'm working with.

If still the only option code injection. Could you please post a link that describes in detail how to inject code that does key presses internally.

Thank you
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