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 


[TUTORIAL] Export string scan results.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Wed Aug 16, 2023 3:46 am    Post subject: [TUTORIAL] Export string scan results. Reply with quote

Code:
local listIndex = 0

function resultList(myvalue,leng)
local rst = ""
ms=createMemScan()
ms.firstScan(soExactValue,vtString,0,myvalue,"",0, 0xffffffffffffffff, "+W", fsmNotAligned, "1", false, false, false, false)
ms.waitTillDone()

fl=createFoundList(ms);
fl.initialize();

 if fl.Count > 0 then
  for i=0,fl.Count-1 do
   address = fl.Address[i]
   local other = readString(address, tonumber(leng))
   listIndex = tonumber(listIndex) + 1
   rst = rst .. "\n------------------  " .. listIndex .. "  ------------------"
   rst = rst .. "\n" .. other
   rst = rst .. "\n----------------------------------------"
  end
 else
  print("Value not found!")
 end

fl.destroy()
ms.destroy()
return rst
end

function saveList(myvalue,leng,path,wFlag)
 if wFlag=="w+" then listIndex=0 end -- update mode
fnd = resultList(myvalue,leng)

print(fnd)

-- write file
 if path then -- (Creates the path or prints it to the path if it exists.)
  local f1 = io.open(path, wFlag)
  f1:write(fnd)
  f1:close()
 end
end

--use
local path = [[C:\Users\Public\Documents\zanzer.txt]]
local search = "claim"
-- write flag:
-- "w+" : update mode, all previous data is deleted;
-- "a+" : add update mode, previous data is preserved, writing is allowed only at the end of the file.

saveList(search,200,path,"a+")

_________________
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