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 do you check or filter invalid floats in lua?

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

Joined: 15 Dec 2016
Posts: 31

PostPosted: Tue Feb 08, 2022 1:39 pm    Post subject: How do you check or filter invalid floats in lua? Reply with quote

I tried to search for this answer. But I'm not sure I know what to look or ask for.

So I'm doing an aobsan to locate my Values. This works great when you transition from one area to the next. Normally the float value I'm checking for is between 180 and -180. When you go to the next area the float value becomes something like 1.81837043E-38. How do I check for this invalid float so that I can trigger a new aobsan in lua. Thanks for any help given.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4704

PostPosted: Tue Feb 08, 2022 3:04 pm    Post subject: Reply with quote

That isn't an invalid float value- it's a little more than 0, which is between -180 and 180.

I guess you could make a timer that periodically checks the float and runs some code if it's between 0 and some small positive number, but have you considered better alternatives?

Performing an aobscan for mutable data has always been an awful idea IMO. It's better to use code injection (search "injection copy") or find a pointer.

_________________
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
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Feb 08, 2022 4:24 pm    Post subject: Reply with quote

Only accept if the value v matches with ((v>0.00001) or (v<-0.00001))
_________________
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
AmyGrrl
Cheater
Reputation: 0

Joined: 15 Dec 2016
Posts: 31

PostPosted: Tue Feb 08, 2022 4:24 pm    Post subject: Reply with quote

I ended up monitoring a string that was always in the same location from value I was using. Whenever you transition to a new area. This string blanks out and so then I just trigger a new aobscan when this happens.
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