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 


Script to export code list address to .txt

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
tonberry901
How do I cheat?
Reputation: 0

Joined: 15 Mar 2024
Posts: 4

PostPosted: Fri Mar 15, 2024 6:44 pm    Post subject: Script to export code list address to .txt Reply with quote

Spent about a week trying to get a pointer for one last address I need to finishing writing a C# application for logging in game match statistics.

I can pull up good working addresses via the code list; and have been manually copying pasting the address to my pointers file that my C# application pulls it's addresses from. But I have to do this every match to preserve my sample integrity.

I've been thinking about a workaround in which I script Cheat Engine to write the new address to a text file each time a new address appears and just have my application pull the new address from there. Like a hand off.

Is this even possible?

Please and thank you.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Fri Mar 15, 2024 11:01 pm    Post subject: Reply with quote

This code saves the addresses in the address list with the given ranges to the given file path.
It filters out duplicate addresses and creates a unique list.
You can read this file in #C form and refresh your list.
Additionally, newly added addresses will always be in the last lines.

The default "F8" key starts or stops recording. You can change it.
You can also change the save path.

Code:
if lstchk then lstchk.Destroy() lstchk=nil end
lstchk=createTimer(MainForm) lstchk.Enabled=false
 lstchk.Interval=5000

local listTbl = {}

function filterCompres(tblold)
flags = {}
aa = 0
flags1 = {}
for i=1, #tblold do
   if not flags[tblold[i]] then
      aa = tonumber(aa) + 1
      flags1[aa] = tblold[i]
      flags[tblold[i]] = true
   end
 end
 return flags1
end
----------------------------------------------
local path = getTempFolder()..[[myAddres_List.txt]] --Your path?

function load_addrList()
  local al=getAddressList()
  cnt = addresslist_getCount(al)
  if cnt > 0 then
     for i=0, cnt-1 do
         local mr = addresslist_getMemoryRecord(al,i)
         table.insert(listTbl,mr.Address)
     end
  end
  newTbl = filterCompres(listTbl)
  newtext = ""
  if newTbl then
   for i,k in pairs(newTbl) do
    newtext=newtext..k.."\n"
   end
   listTbl = newTbl
  end
  if path then
    local fl = io.open(path, "w+") -- delete all text
    fl:write(newtext) -- write new and full text
    fl:close()
  end
  print("\nnewtext:\n"..newtext)
end

lstchk.OnTimer=load_addrList

if startky then startky.Destroy() startky=nil end

startky=createHotkey(function() sleep(200)
                        if lstchk.Enabled==false then
                          lstchk.Enabled=true
                        else
                          lstchk.Enabled=false
                        end
                     end, VK_F8) -- record start-stop key f8 ..

_________________
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
tonberry901
How do I cheat?
Reputation: 0

Joined: 15 Mar 2024
Posts: 4

PostPosted: Sat Mar 16, 2024 4:53 am    Post subject: Reply with quote

Thank you for the generous use of your time.

I've not been able to get this code working immediately, but I'm sure that's on my end.

Question:

I don't have (yet) a good pointer for the address I need; but I keep recalling it via the code list (find what addresses this code writes to).

Does this code complete that task of importing those addresses to my saved addresses list? It looks as though it just writes to .txt the addresses I already have in my Table.

Getting all my other pointers were fairly straight forward, but this last one (tracks a float value for distance) is resisting the pointer scanner

Thank you again for your assistance.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1260

PostPosted: Sat Mar 16, 2024 5:58 am    Post subject: Reply with quote

Ahh! The code only saves the addresses in the address list, and if there is a pointer attached to these addresses, it cannot save them properly.

Additionally, it will be necessary to do research while reading the options you mentioned in your last comment (if they are not in the addresses and found list).

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