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 


How can I change the address value display in the CEedit?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Stephen Yang
Newbie cheater
Reputation: 0

Joined: 22 Feb 2015
Posts: 14

PostPosted: Wed Mar 18, 2015 1:05 pm    Post subject: How can I change the address value display in the CEedit? Reply with quote

I used CEedit1.text = readFloat(address),and the text show the value such as 0.47.
Is it possible to convert the value display type into value like 47?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Mar 18, 2015 1:12 pm    Post subject: Reply with quote

string.format("%f",readFloat(address)*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
Stephen Yang
Newbie cheater
Reputation: 0

Joined: 22 Feb 2015
Posts: 14

PostPosted: Wed Mar 18, 2015 1:30 pm    Post subject: Reply with quote

Dark Byte wrote:
string.format("%f",readFloat(address)*100)


Thx for reply, Dark Byte,but I still have some quests.

How to display the string value in the text?

Like this? CEedit.text = string.format("%f",readFloat(address)*100)

And the number 100 is fixed or I can change it if I need?
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Wed Mar 18, 2015 2:25 pm    Post subject: Reply with quote

if you want to make 47 from 0.47 you need to multiply it with 100, that's what the number's doing there. Of course you can change that freely ...
Back to top
View user's profile Send private message
Stephen Yang
Newbie cheater
Reputation: 0

Joined: 22 Feb 2015
Posts: 14

PostPosted: Wed Mar 18, 2015 10:26 pm    Post subject: Reply with quote

hhhuut wrote:
if you want to make 47 from 0.47 you need to multiply it with 100, that's what the number's doing there. Of course you can change that freely ...


Thx a lot.

If I wish to make my own string what should I do?
for example I'd like to do this:
(a/3)+25

and I also want to know what does %f mean?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Mar 18, 2015 10:34 pm    Post subject: Reply with quote

http://www.cplusplus.com/reference/cstdio/printf/

Not entirely sure what you mean by wanting to create that string. Just put quotes around it?

Unless you wanted:

Code:
value = readFloat(address)
value = value * 100
total = value / 3 + 25
result = string.format("(%0.2f/3)+25=%0.2f", value, total)
Back to top
View user's profile Send private message
Stephen Yang
Newbie cheater
Reputation: 0

Joined: 22 Feb 2015
Posts: 14

PostPosted: Wed Mar 18, 2015 10:38 pm    Post subject: Reply with quote

Zanzer wrote:

Not entirely sure what you mean by wanting to create that string. Just put quotes around it?

Unless you wanted:

Code:
value = readFloat(address)
value = value * 100
total = value / 3 + 25
result = string.format("(%0.2f/3)+25=%0.2f", value, total)


Thank you,that's what I want, can you tell what does 0.2f mean?
and how I can place the result into CEedit.text?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Wed Mar 18, 2015 10:43 pm    Post subject: Reply with quote

Read the URL I posted for all the possible format specifiers.
f means the value will be a float, 0.2 means to display 2 digits after the decimal.

Code:
CEedit.text = result
Back to top
View user's profile Send private message
Stephen Yang
Newbie cheater
Reputation: 0

Joined: 22 Feb 2015
Posts: 14

PostPosted: Wed Mar 18, 2015 10:46 pm    Post subject: Reply with quote

Zanzer wrote:
Read the URL I posted for all the possible format specifiers.
f means the value will be a float, 0.2 means to display 2 digits after the decimal.

Code:
CEedit.text = result


Thank you very very very much.
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 Lua Scripting 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