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 


Code scan does not work, but manual scan gives results

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

Joined: 08 Oct 2012
Posts: 577

PostPosted: Wed Oct 08, 2014 2:36 pm    Post subject: Code scan does not work, but manual scan gives results Reply with quote

Part of a coded scan:
Code:
function RecalculateAddresses(sender)

 local AL = getAddressList()
 local MS = createMemScan()
 local FL = createFoundList(MS)
   memscan_firstScan(MS,
   soExactValue, vtQword, rtRounded, goldvalue, "",
   0, 0xffffffffffffffff, "*X*C*W", fsmNotAligned, "",
   false, true, false, false)

 memscan_waitTillDone(MS)
 foundlist_initialize(FL)
 print("Num of Gold found ", foundlist_getCount(FL))

The code finds no results and the following coded lines fail of course.
When selecting a 4 byte number a manual scan results in finding one value in this case.
What is wrong with the code?
BTW goldvalue is NOT nil and has the value entered (code not shown but this works as goldvalue is the amount to be searched)
Back to top
View user's profile Send private message Yahoo Messenger
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Oct 08, 2014 3:34 pm    Post subject: Reply with quote

change vtQword to vtDword
_________________
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
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Wed Oct 08, 2014 3:38 pm    Post subject: Reply with quote

But the value of gold can be considerably larger than 16^4
Back to top
View user's profile Send private message Yahoo Messenger
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Oct 08, 2014 4:00 pm    Post subject: Reply with quote

So, what is the problem?
All values below 16^4 can be encoded using 2 byte values,. so the next big thing would be 4 byte, as your 4 byte scan showed. (Dword is 4 byte, Qword is 8 byte)

16^4 is 65536
Note that the 4 in this notation means the number of hexadecimal digits not bytes

_________________
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
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Wed Oct 08, 2014 4:39 pm    Post subject: Reply with quote

Ok, my bad. I thought that Dword would only go up to 65535
Back to top
View user's profile Send private message Yahoo 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