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 


Sorting unsorted MemRec list or building sorted MemRec list

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

Joined: 14 Jul 2007
Posts: 3102

PostPosted: Sun Apr 25, 2021 4:17 am    Post subject: Sorting unsorted MemRec list or building sorted MemRec list Reply with quote

Hi guys,
Say, I have 300 memrecs, all memrecs are of the same data type (UnicodeString).
It's hard to find a specific item so I would like to sort the list alphabetically (or, populate the list in alphabetic order in the first place) using the MemRec's actual value to do the sorting.

My basic questions are:
- How does one sort a list of MemRecs? (is there a qsort in CELUA?)
- How does one build a sorted list in the first place? (is there a "find spot then .InsertAt(x)" in CE?).
- Can I disable CE address list updates whilst the sorting is going on? (soft of beginEdit/endEdit but for sorting, to avoid CPU use for UI updates/flickering)
- Are there code templates/examples for either one these?

Thank you!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sun Apr 25, 2021 5:38 am    Post subject: Reply with quote

get the treeview object of the addresslist (getComponent 0 or 1)

then you can do a treeview.beginUpdate()

As for sorting, rhere is currently no move capability so you'll have to rebuild the addresslist from scratch


Perhaps instead if sorting the addresslist you can create a new window with the list sorted there

lua supports table.sort which can be used to sort

_________________
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
Csimbi
I post too much
Reputation: 92

Joined: 14 Jul 2007
Posts: 3102

PostPosted: Sun Apr 25, 2021 11:41 am    Post subject: Reply with quote

Problem is, I need to sort nested MemRecs.
Looks a bit like below.
Meaning, the list is not flat - so the sorting in the new window might not do the trick.

Is this something you'd consider as a feature request?

Thank you!



CE_List_to_sort.png
 Description:
 Filesize:  17.15 KB
 Viewed:  1387 Time(s)

CE_List_to_sort.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sun Apr 25, 2021 4:59 pm    Post subject: Reply with quote

You could use a lua script that changes the description of all records at level 0 with their value and then sort by description
_________________
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
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