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 


Scripting scans not working as intended

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

Joined: 12 Jun 2017
Posts: 1

PostPosted: Mon Jun 12, 2017 4:37 pm    Post subject: Scripting scans not working as intended Reply with quote

For some reason in lua, the memscan_nextScan method keeps the old addresses that have not changed, and appends the ones that have changed into the list again.
I'm not sure if cheat engine is bugged, or I'm doing something incorrect, and a few google searches do not seem to help.
The testing I've been doing:
Code:
function myFirst(id)
  local scan = getCurrentMemscan()
  scan.newScan()
  scan.firstScan(soExactValue, vtDword, rtRounded, id, nil, 0, 0x7fffffffffffffff, "+W-C", fsmAligned, "4", false, false, false, false)
  scan.waitTillDone()
end

function myNext(id)
  local scan = getCurrentMemscan()
  scan.nextScan(soExactValue, rtRounded, id, nil, false, false, false, false, false)
  scan.waitTillDone()
end

myFirst("1561")
--myNext("1744")

I start the scan with a search for a DWORD of 1561, then in my game I change the value, then change the code to run "myNext" for 1744.
Cheat Engine says it found 8 (which is correct) but displays a few hundred, most values are from the first search and should not appear in the list instead of clearing the address list when you press the next scan button normally.
When I use memscan_firstScan, Cheat Engine says 282 found (and 282 shown)
I attached a screenshot of what happens when I use memscan_nextScan on the same scan object. (8 found and 290 shown, when only 8 should be shown)

I just want those 8 in the list by themselves instead of everything that arrived with the first search...



firstScan.png
 Description:
 Filesize:  100.86 KB
 Viewed:  4902 Time(s)

firstScan.png



nextScan.png
 Description:
 Filesize:  102.18 KB
 Viewed:  4902 Time(s)

nextScan.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25295
Location: The netherlands

PostPosted: Tue Jun 13, 2017 5:26 am    Post subject: Reply with quote

you may need to reinitialize the foundlist
_________________
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
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 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