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 


Unexpected results writing to memory
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Feb 11, 2013 3:11 pm    Post subject: Reply with quote

You need to remember that these variables are global and can be reused by other scripts
You most likely ran a previous script that executed "addressList = getAddressList()"

What you can do is:
Code:



AddressList = getAddressList()
addressList = AddressList

So both are defined

_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Mon Feb 11, 2013 3:43 pm    Post subject: Reply with quote

what dark byte said Razz.
I don't remember using addressList.. I usually use caps at the start

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Mon Feb 11, 2013 5:13 pm    Post subject: Reply with quote

Dark Byte wrote:
You need to remember that these variables are global and can be reused by other scripts
You most likely ran a previous script that executed "addressList = getAddressList()"

What you can do is:
Code:



AddressList = getAddressList()
addressList = AddressList

So both are defined

That is probably why it worked since both were in the original session but not the second session.

Flashacking wrote:

what dark byte said .
I don't remember using addressList.. I usually use caps at the start
You did use capitals; look at the copy you sent, there are two: one without capitals(mine) and yours with capitals.
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Mon Feb 11, 2013 11:44 pm    Post subject: Reply with quote

oh now I see it.. I looked only on my post.. I see in your post above, you did something simlar..
also, use local, when you use it only in a function.
(local addresslist=getAddressList() )
I did
Addresslist=getAddressList()
because I used it for 2 functions (if you don't need any more.. ofcourse Razz).
but in general, if you got lots of functions its saves some of your time

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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
Goto page Previous  1, 2
Page 2 of 2

 
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