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 to remove non-integer from floating point scan result?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 83

PostPosted: Wed Aug 31, 2022 7:11 am    Post subject: How to remove non-integer from floating point scan result? Reply with quote

When guessing that the value type is a float,
is there an easy way to remove the result such as 1.00256575689455.....?

Can lua be used to filter scan results in detail?



shanchu.jpg
 Description:
 Filesize:  39.38 KB
 Viewed:  2791 Time(s)

shanchu.jpg




Last edited by etioplmld on Wed Aug 31, 2022 11:20 pm; edited 1 time in total
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1069
Location: 0x90

PostPosted: Wed Aug 31, 2022 8:23 am    Post subject: Reply with quote

I assume you mean when scanning. If so just set the type to float.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Wed Aug 31, 2022 8:31 am    Post subject: Reply with quote

yes, do an exact value scan and check lua formula, and give as scanvalue:

e.g:
Code:

value~=1.00256575689455


tip: Do this one when you already have addresses, else it will find every address except the one with this value

_________________
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
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4721

PostPosted: Wed Aug 31, 2022 10:32 am    Post subject: Reply with quote

In general, you can use `value // 1 == value`

`math.floor(...)` could also work, but not with separate Lua states apparently

_________________
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
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 83

PostPosted: Wed Aug 31, 2022 11:23 pm    Post subject: Reply with quote

`value // 1 == value` ?

Is the code used in this script? Too few google search results on how to change Foundlist3
https://www.cheatengine.org/forum/viewtopic.php?p=5774154
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4721

PostPosted: Wed Aug 31, 2022 11:43 pm    Post subject: Reply with quote

What? No. Do what Dark Byte said.

There's a checkbox next to where you enter the scan value labeled "Lua formula". Check that checkbox, put "value // 1 == value" (no quotes) as the scan value, and press the "next scan" button.

That script you linked was made before that "Lua formula" feature existed... I think. I don't know half the features CE has. Regardless, it's obsolete.

_________________
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
etioplmld
Advanced Cheater
Reputation: 0

Joined: 09 Feb 2021
Posts: 83

PostPosted: Thu Sep 01, 2022 1:05 am    Post subject: Reply with quote

Thanks, it worked, google translate is not very accurate
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