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 


setAddress() Unexpected Behavior

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Mon Sep 14, 2015 12:19 pm    Post subject: setAddress() Unexpected Behavior Reply with quote

This might be a bug or just something stupid that I'm doing since I'm completely new to Lua, but the setAddress() method of the MemoryRecord class isn't working for me. Any time I call it with any kind of argument, it just clears out the address of the memory record I'm working with.

Here's a SSCCE:
Code:
al = getAddressList()
rec = al:createMemoryRecord()
print('initial:', rec:getAddress())
rec:setAddress("1")
print('final:', rec:getAddress())


Expected output:
Code:
initial: 0
final: 1


Actual output:
Code:
initial: 0
final: 


OS: Windows 7 64-bit
CE: Cheat Engine 6.4
CE was in 64-bit mode when the example above was run.
If you'd like any other information, feel free to ask.

Does this happen for anyone else?
Are there any ideas for why this is happening?

_________________
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: 25778
Location: The netherlands

PostPosted: Mon Sep 14, 2015 1:20 pm    Post subject: Reply with quote

I know this may sound strange, but instead of rec:setAddress use rec.setAddress()
_________________
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: 4695

PostPosted: Mon Sep 14, 2015 1:40 pm    Post subject: Reply with quote

It works perfectly now. Thank you!

Should I use . instead of : on all the classes listed in main.lua?

_________________
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
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