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 


why is it not working?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Roman012
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 25 Dec 2022
Posts: 36

PostPosted: Tue Jan 14, 2025 2:25 pm    Post subject: why is it not working? Reply with quote

please tell me how it should be
if there is at least some number, then do not perform
Code:
if getAddressList().getMemoryRecordByDescription("40D").Value ~= '0000005000000001' or '0000000800000001' or '0000004100000001'  then


end
end
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 34

Joined: 16 Feb 2017
Posts: 1442

PostPosted: Wed Jan 15, 2025 7:37 am    Post subject: Reply with quote

Check if it contains a number:

Code:
mem1 = getAddressList().getMemoryRecordByDescription("40D")
mem1adrr0 = mem1.address
mem1adrr4 = mem1.address .. "+04"
if readInteger(mem1adrr0) ~= 0 or readInteger(mem1adrr4) ~= 0 then
   print(mem1.value)
   print(readInteger(mem1adrr0))
   print(readInteger(mem1adrr4))
else
   print("Value: 0")
end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1584

PostPosted: Tue Jan 21, 2025 7:32 pm    Post subject: Reply with quote

Code:
-- thisisfunction = function()
   local bad = { 0000005000000001, 0000000800000001, 0000004100000001} -- if hex add 0x before each number;
   value = getAddressList().getMemoryRecordByDescription("40D").Value;
   for v in pairs(bad) do
      (if value == v) then
    return;
   end
   -- more lua code....
   -- blah blah
   print("do something");
-- end

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
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