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 to display or copy memory record ID?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Y.A.K.E
Advanced Cheater
Reputation: 0

Joined: 15 Jul 2019
Posts: 51

PostPosted: Fri Sep 29, 2023 12:28 pm    Post subject: How to display or copy memory record ID? Reply with quote

Code:

function getMemId(sender)
  local addressList = getAddressList()
  local index_list={}
  for i=0,addressList.count-1 do
    if (addressList[i].Selected)then
       table.insert(index_list,addressList[i].index)
    end
  end

  if index_list ~= {} then
      if #index_list==1 then
         print(string.format ("{%d}",index_list[1]))
      else
         -- index_list = {1,278} -- multiSelect
         -- how to print table, "{1,278}"

      end
  else
      print ("{}")
  end


end

local parent = getMainForm().PopupMenu2.Items;
newItem = createMenuItem(parent);
parent.add(newItem);
newItem.Caption = 'Copy ID';

newItem.OnClick = getMemId;

Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4307

PostPosted: Fri Sep 29, 2023 7:45 pm    Post subject: Reply with quote

Code:
local t = {1, 278}
print('{' .. table.concat(t, ', ') .. '}')

Copy a string to the clipboard with `writeToClipboard`

PS: that outside `if` statement does nothing
Code:
assert({} ~= {})  -- this is always true

_________________
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
Y.A.K.E
Advanced Cheater
Reputation: 0

Joined: 15 Jul 2019
Posts: 51

PostPosted: Sat Sep 30, 2023 7:18 am    Post subject: Reply with quote

ParkourPenguin wrote:
Code:
local t = {1, 278}
print('{' .. table.concat(t, ', ') .. '}')

Copy a string to the clipboard with `writeToClipboard`

PS: that outside `if` statement does nothing
Code:
assert({} ~= {})  -- this is always true



thanks
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
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