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 


Clearing All Userdefined Symbols
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
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Tue Mar 08, 2016 12:14 pm    Post subject: Reply with quote

ParkourPenguin wrote:
The documentation in main.lua explains it well enough. When you call register(), it basically just takes every symbol in the list and registers it. I've never used it nor have I ever seen anyone else use it, so it's probably a pretty rare thing.


I was expecting the SymbolList class to be some sort of array of symbols (like stringlist), but it looks a bit more complicated:
This isn't really self-explanatory:

Code:
 addSymbol(modulename, searchkey, address, symbolsize, skipAddressToSymbolLookup OPTIONAL, extradata OPTIONAL)


what is modulename? the symbol isn't necessary in a static address.
what is searchkey,symbolize,skipAddressToSymbolLookup?
registerSymbol only takes 3 arguments (one optional) :
Code:
registerSymbol(symbolname, address, OPTIONAL donotsave)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4725

PostPosted: Tue Mar 08, 2016 12:24 pm    Post subject: Reply with quote

You're thinking about it incorrectly.

A SymbolList object is separate from the userdefined symbols. Two SymbolList objects are separate from each other. Add a symbol to one, and it's not automatically registered, nor is it added to all the other SymbolList objects.

It's like how an AA script keeps a local copy of some symbols regardless if you register them or not (i.e. how you can dealloc(...) something in [DISABLE] without registering it in [ENABLE]). So, all you have to be concerned with are the functions register() and unregister(). Everything else doesn't matter.

IMO the work required for this outweighs the benefits of it.

_________________
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
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Tue Mar 08, 2016 2:39 pm    Post subject: Reply with quote




Code:
  thelist = createSymbolList()


  --skipAddressToSymbolLookup set to false
  thelist.addSymbol('importantPart', 'tutImportantPart', 0x0054DD20,
                    0x24)

  --skipAddressToSymbolLookup set to true
  thelist.addSymbol('importantPartSkipped', 'tutImportantPartSkipped', 0x0054DD45,
                    0x5, true)

  thelist.register()



And then you will see this:

_________________
Back to top
View user's profile Send private message MSN Messenger
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Wed Mar 09, 2016 10:11 am    Post subject: Reply with quote

mgr.inz.Player wrote:
...


Thanks for the example.

The call to register did not add any symbol to the userdefined symbols list, so unregisterSymbol() probably won't unregister it (there is still the unregister() method).

It's possible to do it this way: redefine the register() method (in the metatable) to get the symbollist (as self), and add it to a table that is for symbollists only (not the regular table).
Code:
list:register();-- or list.register(list)

instead of
Code:
list.register();


when the button is clicked, traverse the new table, call the method unregister() on every symbollist, and clear the table.

Not sure if it's necessary because symbollists are uncommon in scripts.
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