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 


How do I move a record to a specified location

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
yazigegeda
Expert Cheater
Reputation: 0

Joined: 22 Jan 2019
Posts: 183

PostPosted: Wed Jun 26, 2024 11:31 am    Post subject: How do I move a record to a specified location Reply with quote

Code:


local al = getAddressList()
al.getMemoryRecord(al.Count-1).index=0



I want to move group 3 to the first place. How do I do that

I may have made a mistake. Help me



Screenshot_2024-06-27-01-28-13-22_2665fb67b16260a8d818298cef8dc107.jpg
 Description:
 Filesize:  59.29 KB
 Viewed:  3284 Time(s)

Screenshot_2024-06-27-01-28-13-22_2665fb67b16260a8d818298cef8dc107.jpg




Last edited by yazigegeda on Wed Jun 26, 2024 8:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1528

PostPosted: Wed Jun 26, 2024 12:32 pm    Post subject: Reply with quote

Code:
local al=getAddressList()

function resIndexRecord(desc)
local index = "not"
cnt = addresslist_getCount(al)
  if cnt > 0 then
     for i=0, cnt-1 do
      local mr = addresslist_getMemoryRecord(al,i)
      aldesc = memoryrecord_getDescription(mr)
      print("Available Descriptions: "..aldesc)
      if aldesc==desc then
        index = desc.." index: "..i
      end
     end
  end
     if index == "not" then
      index = desc.. " not found!"
     end
  return index
end

-- use:
descindex = resIndexRecord("Group 1")
print(descindex)
-- or :
local mr1 = addresslist_getMemoryRecord(al,2)
aldesc1 = memoryrecord_getDescription(mr1)
print(aldesc1)

-- Change mr1 desc :
mr1.Description = "Group 88"
aldesc1 = memoryrecord_getDescription(mr1)
print(aldesc1)

_________________
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
yazigegeda
Expert Cheater
Reputation: 0

Joined: 22 Jan 2019
Posts: 183

PostPosted: Wed Jun 26, 2024 7:57 pm    Post subject: Reply with quote

AylinCE wrote:
Code:
local al=getAddressList()

function resIndexRecord(desc)
local index = "not"
cnt = addresslist_getCount(al)
  if cnt > 0 then
     for i=0, cnt-1 do
      local mr = addresslist_getMemoryRecord(al,i)
      aldesc = memoryrecord_getDescription(mr)
      print("Available Descriptions: "..aldesc)
      if aldesc==desc then
        index = desc.." index: "..i
      end
     end
  end
     if index == "not" then
      index = desc.. " not found!"
     end
  return index
end

-- use:
descindex = resIndexRecord("Group 1")
print(descindex)
-- or :
local mr1 = addresslist_getMemoryRecord(al,2)
aldesc1 = memoryrecord_getDescription(mr1)
print(aldesc1)

-- Change mr1 desc :
mr1.Description = "Group 88"
aldesc1 = memoryrecord_getDescription(mr1)
print(aldesc1)




I wonder how group 3 can be moved to the first position,Like in the picture



Screenshot_2024-06-27-09-58-00-63_2665fb67b16260a8d818298cef8dc107.jpg
 Description:
 Filesize:  8.8 KB
 Viewed:  3258 Time(s)

Screenshot_2024-06-27-09-58-00-63_2665fb67b16260a8d818298cef8dc107.jpg


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

Joined: 16 Feb 2017
Posts: 1528

PostPosted: Wed Jun 26, 2024 11:47 pm    Post subject: Reply with quote

If there is no appropriate and short-cut answer on this issue,
I will recommend copying all records as Xml output, changing the ">ID<" and pasting them again.

If there is for now, wait for a shorter solution.

_________________
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
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Jun 27, 2024 12:11 am    Post subject: Reply with quote

Currently not possible.

You might have luck invoking the click handler of the description column which sorts everything, but i doubt that's what you want

or as AylinCE mentioned, save table, reorganize, and load table, but you'll lose activated entry states

_________________
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
yazigegeda
Expert Cheater
Reputation: 0

Joined: 22 Jan 2019
Posts: 183

PostPosted: Thu Jun 27, 2024 12:51 am    Post subject: Reply with quote

Dark Byte wrote:
Currently not possible.

You might have luck invoking the click handler of the description column which sorts everything, but i doubt that's what you want

or as AylinCE mentioned, save table, reorganize, and load table, but you'll lose activated entry states


Thanks, did I find this feature from the cheat engine source code, manually move the code to the specified location, then locate the call from memory and invoke the call using ce, as shown below? But I don't know where the source code is



GIF 2024-6-27 14-46-39.gif
 Description:
 Filesize:  8.42 KB
 Viewed:  3203 Time(s)

GIF 2024-6-27 14-46-39.gif


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

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

PostPosted: Thu Jun 27, 2024 1:03 am    Post subject: Reply with quote

that would break as soon as there's a new version
_________________
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