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 write lua if a > b then...

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

Joined: 09 Mar 2012
Posts: 32

PostPosted: Wed Jan 30, 2019 8:01 am    Post subject: how to write lua if a > b then... Reply with quote

if i write
=================
if a==b then
print("a is b")
else
print("a is not b")
end
=================
work correct


but if i write
=================
if a>b then
print("a is bigger than b")
else
print("a is smaller than b")
end
=================
it work incorrect....

(a and b is a integer number)


so how to write if a>b???
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater
Reputation: 36

Joined: 09 Aug 2013
Posts: 969

PostPosted: Wed Jan 30, 2019 8:28 am    Post subject: Reply with quote

basic math works in lua so.... use tonumber to make sure they're actually numbers not strings which compare differently (alphabetical order basically)
_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
cancandodo
Cheater
Reputation: 0

Joined: 09 Mar 2012
Posts: 32

PostPosted: Sat Feb 02, 2019 9:41 pm    Post subject: Reply with quote

FreeER wrote:
basic math works in lua so.... use tonumber to make sure they're actually numbers not strings which compare differently (alphabetical order basically)


tks," actually numbers not string"is the keyword
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