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 


Change text on F1 Press

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
WALLED
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 17 Feb 2020
Posts: 16

PostPosted: Mon Oct 12, 2020 6:11 am    Post subject: Change text on F1 Press Reply with quote

Hello,

I want to do like if you press F1 on your keyboard, the specified text will be changed to "Succeed" from "Waiting..."

So for example, i open my Trainer, i click on F1 and it will write "Succeed" text.

Any ideas how i can do that?

I did that, but it's not working (112 means F1)

Code:
if doKeyPress(112) then
UDF1.CELabel1.Caption = "Succeed"
end
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3327

PostPosted: Mon Oct 12, 2020 8:35 am    Post subject: Re: Change text on F1 Press Reply with quote

WALLED wrote:
Hello,

I want to do like if you press F1 on your keyboard, the specified text will be changed to "Succeed" from "Waiting..."

So for example, i open my Trainer, i click on F1 and it will write "Succeed" text.

Any ideas how i can do that?

I did that, but it's not working (112 means F1)

Code:
if doKeyPress(112) then
UDF1.CELabel1.Caption = "Succeed"
end

Add your code to the OnClick event of the button.
Back to top
View user's profile Send private message
WALLED
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 17 Feb 2020
Posts: 16

PostPosted: Mon Oct 12, 2020 8:42 am    Post subject: Re: Change text on F1 Press Reply with quote

Csimbi wrote:
WALLED wrote:
Hello,

I want to do like if you press F1 on your keyboard, the specified text will be changed to "Succeed" from "Waiting..."

So for example, i open my Trainer, i click on F1 and it will write "Succeed" text.

Any ideas how i can do that?

I did that, but it's not working (112 means F1)

Code:
if doKeyPress(112) then
UDF1.CELabel1.Caption = "Succeed"
end

Add your code to the OnClick event of the button.


I already did that, but it's not working
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3327

PostPosted: Mon Oct 12, 2020 8:45 am    Post subject: Reply with quote

Does the rest of the OnClick code run on tapping F1?
Back to top
View user's profile Send private message
WALLED
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 17 Feb 2020
Posts: 16

PostPosted: Mon Oct 12, 2020 8:46 am    Post subject: Reply with quote

Csimbi wrote:
Does the rest of the OnClick code run on tapping F1?


After i tap F1, nothing happens, even the text isn't changing. But i do not get any error when i press or run the code.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Mon Oct 12, 2020 10:33 am    Post subject: Reply with quote

You might be looking for isKeyPressed instead of doKeyPress. If so, createHotkey is probably better.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
MMM-304
Expert Cheater
Reputation: 0

Joined: 17 Aug 2020
Posts: 170
Location: Milkey Way

PostPosted: Mon Oct 12, 2020 12:06 pm    Post subject: Reply with quote

ParkourPenguin wrote:
You might be looking for isKeyPressed instead of doKeyPress. If so, createHotkey is probably better.

this and you need to checking for the keyPress state continuously, make a timer or loop or something because if statement executes only once (unless its in a loop or something)
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