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 


Multiply a float value?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Sat Jan 09, 2021 5:14 pm    Post subject: Multiply a float value? Reply with quote

Hi, i've searched and read a couple of posts on this matter, but i always found them too complex or somehow they didn't apply to this case.
I can set the values in auto assembler like this:

Code:
[ENABLE]
[VehicleMain]+8C4:
dd (float)0.9
{$lua}
if syntaxcheck then return end
local t=createTimer()
t.Interval=100
t.OnTimer=function()
  memrec.Active=false
  t.destroy()
end
[DISABLE]


This sets the value in that offset but my aim is to be able to, for example, multiply the original value for a value set by me, and write that in.
What would be the better approach to this?

Thank you.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4711

PostPosted: Sat Jan 09, 2021 5:45 pm    Post subject: Reply with quote

You didn't specify how you want to set the value. I'm assuming it's just a constant.
Code:
[ENABLE]
{$lua}
if syntaxcheck then return end
local addr = getAddress"[VehicleMain]+8c4"
writeFloat(addr, readFloat(addr)*2.0)
createTimer(100, function() memrec.Active = false; end)
{$asm}
[DISABLE]

_________________
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
careca777
Expert Cheater
Reputation: 0

Joined: 27 Jul 2013
Posts: 121

PostPosted: Sat Jan 09, 2021 8:09 pm    Post subject: Reply with quote

That was exactly what i was looking for! Amazing. Thank you!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Jan 10, 2021 2:58 am    Post subject: Reply with quote

you can also use a hotkey and make it set the value to
Code:

value*2

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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