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 


aobscan Nth result

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 159

Joined: 07 Nov 2008
Posts: 4278
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Oct 21, 2019 7:30 am    Post subject: aobscan Nth result Reply with quote

Installation:
Add below function to autorun folder to existing or new .lua file
You can also copy it to main memory record (AA script with {$Lua} section).

Code:
function find_Nth_Result_AOB(symbol,N,start,pattern)
  if start==' 00000000' then return end
  if N<=1 then registerSymbol(symbol,start) return end
  local script='aobscanregion('..symbol..','..start..'+1,7fffffffffffffff,'..pattern..')\r\nregistersymbol('..symbol..')'
  local success=autoAssemble(script)
  if success and (N>2) then find_Nth_Result_AOB(symbol,N-1,string.format('%08X',getAddress(symbol)),pattern) end
  if not success then unregisterSymbol(symbol); error() end
end


Usage:

Example, if you need second result just use this AA script:
Code:
[ENABLE]
aobscan(myPtr,48 8b 05 * * * * 48 85 c0 0f 85)
LuaCall(find_Nth_Result_AOB('myPtr',2,[=[myPtr]=],"48 8b 05 * * * * 48 85 c0 0f 85"))
...
...
...

[DISABLE]
unregistersymbol(myPtr)
...
...
...



if you need third result from module:
Code:
[ENABLE]
aobscanmodule(myPtr,modulename,48 8b 05 * * * * 48 85 c0 0f 85)
LuaCall(find_Nth_Result_AOB('myPtr',3,[=[myPtr]=],"48 8b 05 * * * * 48 85 c0 0f 85"))
...
...
...

[DISABLE]
unregistersymbol(myPtr)
...
...
...



Tip:
Be sure to check "execute asynchronous"







Notes:
You probably notice this [=[myPtr]=] thing in my code. Everything inside parenthesis of LuaCall is executed by Lua. And Lua treats [=[ and ]=] more or less the same way as quotation marks "

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions 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