|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Lemchast How do I cheat? Reputation: 0
Joined: 11 Jun 2019 Posts: 6
|
Posted: Tue Jun 11, 2019 10:46 pm Post subject: Get number of results for a string search using LUA |
|
|
I have .txt file containing search strings, each separated by a new line. I would like to write a LUA script that reads one line at a time from the .txt file.
For each line that is read, a String memory scan should be performed on the opened process in Cheat Engine (in my case, BlueStacks).
The number of results for that scan should then be printed to the console. This should repeat with new scans for each search string in the .txt file until the end is reached.
I would greatly appreciate any help on this matter. Thanks very much!
|
|
Back to top |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Wed Jun 12, 2019 12:20 am Post subject: |
|
|
something like this:
Code: |
s=createStringlist()
s.LoadFromFile([[d:\bla.txt]])
local protectionflags='' --change this to the kind you need. empty string is everything *X*C*W
local casesensitive=true
local ms=createMemScan()
local fl=createFoundList(ms)
local i
for i=0,s.count-1 do
ms.firstScan(soExactValue, vtString,nil,s[i],'',0,0x7fffffffffffffff,protectionflags,fsmNotAligned,'1',false,true,false,casesensitive)
ms.waitTillDone()
fl.initialize()
print(s[i]..'='..fl.count)
fl.deinitialize()
end
fl.destroy()
ms.destroy()
s.destroy()
|
use threads if you don't want the gui to freeze, or start multiple scans at the same time by moving the waitTillDone() out of the loop and create a new memscan for each string, or use the OnScanDone event of the memscan objects
_________________
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 |
|
|
Lemchast How do I cheat? Reputation: 0
Joined: 11 Jun 2019 Posts: 6
|
Posted: Fri Jun 14, 2019 1:51 am Post subject: |
|
|
Dark Byte wrote: | something like this:
Code: |
s=createStringlist()
s.LoadFromFile([[d:\bla.txt]])
local protectionflags='' --change this to the kind you need. empty string is everything *X*C*W
local casesensitive=true
local ms=createMemScan()
local fl=createFoundList(ms)
local i
for i=0,s.count-1 do
ms.firstScan(soExactValue, vtString,nil,s[i],'',0,0x7fffffffffffffff,protectionflags,fsmNotAligned,'1',false,true,false,casesensitive)
ms.waitTillDone()
fl.initialize()
print(s[i]..'='..fl.count)
fl.deinitialize()
end
fl.destroy()
ms.destroy()
s.destroy()
|
use threads if you don't want the gui to freeze, or start multiple scans at the same time by moving the waitTillDone() out of the loop and create a new memscan for each string, or use the OnScanDone event of the memscan objects |
Much appreciated, Dark Byte! That's exactly what I was looking for. Many thanks!
|
|
Back to top |
|
|
|
|
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
|
|