Get ID or Index of current Memory Record

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Get ID or Index of current Memory Record

Post by S1N74X »

Hi there,

is there a way to figure out whats the ID or Index the current Memory Record?
I know i can use getAddressList().getMemoryRecordByDescription() and so on...
Afaik every Memory Record has a underlaying ID and Index.
Is there a way to get those more or less direct ?

Thanks for useful suggestions

imjustmaxie
Expert Cheater
Expert Cheater
Posts: 222
Joined: Mon Aug 06, 2018 6:00 pm
Reputation: 186

Re: Get ID or Index of current Memory Record

Post by imjustmaxie »

S1N74X wrote:
Mon Apr 15, 2024 11:39 am
Hi there,

is there a way to figure out whats the ID or Index the current Memory Record?
I know i can use getAddressList().getMemoryRecordByDescription() and so on...
Afaik every Memory Record has a underlaying ID and Index.
Is there a way to get those more or less direct ?

Thanks for useful suggestions
getAddressList().getMemoryRecordByDescription(‘description’).ID or .Index

[Link]

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get ID or Index of current Memory Record

Post by S1N74X »

[/quote]

getAddressList().getMemoryRecordByDescription(‘description’).ID or .Index

[/quote]

Thx for your reply but thats exatctly not the way i need to get the ID or the Index
The Memerc Name or Description can change. The ID is afaik uniqe

imjustmaxie
Expert Cheater
Expert Cheater
Posts: 222
Joined: Mon Aug 06, 2018 6:00 pm
Reputation: 186

Re: Get ID or Index of current Memory Record

Post by imjustmaxie »

S1N74X wrote:
Mon Apr 15, 2024 1:20 pm

Thx for your reply but thats exactly not the way I need to get the ID or the Index.
The memrec name or description can change. The ID is afaik unique
getAddressList().SelectedRecord.ID or getAddressList().SelectedRecord.Index

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get ID or Index of current Memory Record

Post by S1N74X »

imjustmaxie wrote:
Mon Apr 15, 2024 1:53 pm
S1N74X wrote:
Mon Apr 15, 2024 1:20 pm

Thx for your reply but thats exactly not the way I need to get the ID or the Index.
The memrec name or description can change. The ID is afaik unique
getAddressList().SelectedRecord.ID or getAddressList().SelectedRecord.Index
Does it. Thx

S1N74X
Cheater
Cheater
Posts: 39
Joined: Wed Sep 15, 2021 4:25 pm
Reputation: 4

Re: Get ID or Index of current Memory Record

Post by S1N74X »

S1N74X wrote:
Mon Apr 15, 2024 2:00 pm
imjustmaxie wrote:
Mon Apr 15, 2024 1:53 pm
S1N74X wrote:
Mon Apr 15, 2024 1:20 pm

Thx for your reply but thats exactly not the way I need to get the ID or the Index.
The memrec name or description can change. The ID is afaik unique
getAddressList().SelectedRecord.ID or getAddressList().SelectedRecord.Index
Does it. Thx
Aah sh.....
Selected == Activated
So the result doesnt match if you activate more than one script

Thx anyway

imjustmaxie
Expert Cheater
Expert Cheater
Posts: 222
Joined: Mon Aug 06, 2018 6:00 pm
Reputation: 186

Re: Get ID or Index of current Memory Record

Post by imjustmaxie »

S1N74X wrote:
Mon Apr 15, 2024 2:10 pm
S1N74X wrote:
Mon Apr 15, 2024 2:00 pm
imjustmaxie wrote:
Mon Apr 15, 2024 1:53 pm


getAddressList().SelectedRecord.ID or getAddressList().SelectedRecord.Index
Does it. Thx
Aah sh.....
Selected == Activated
So the result doesnt match if you activate more than one script

Thx anyway
Use a for loop on the AddressList and do compares if the AddressList[/i].Selected == true or AddressList[/i].Active == true or not, and do what you want to do afterwards.

Code: Select all

local al = getAddressList()
for i=0,al.Count-1 do
    if al[i].Selected == true then
        -- code here
    end
    -- or
    if al[i].Active == true then
        -- code here
    end
end

Paul44
Table Makers
Table Makers
Posts: 760
Joined: Thu Jul 27, 2017 9:02 am
Reputation: 447

Re: Get ID or Index of current Memory Record

Post by Paul44 »

^^ or: myMr = al.getMemoryRecordByID(ID)
(i never/rarely work with 'byDescr...' since i tend to a) rearrange/rename my entries in due time b) copy/pasting from another table keeps thàt ID (unless it already exists in current table)

Post Reply

Who is online

Users browsing this forum: No registered users