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 


Basic Scripting Help

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

Joined: 29 Jun 2012
Posts: 3

PostPosted: Fri Jun 29, 2012 12:10 am    Post subject: Basic Scripting Help Reply with quote

Good evening gents,

I am trying to write a quick Lua script to search through a series of values and de-reference the pointers to see whether they point to the address I am looking for or not.

Browsing through the docs this is what I have come up with:

Code:

memscan = createMemScan();
foundlist = createFoundList(memscan);

memscan_firstScan(memscan, soExactValue, vtAll, rtTruncated, 0x01F7E420, input2, 0 , 0xffffffffffffffff , "+X+W"  ,fsmNotAligned, ""
,true ,false, false, false);

memscan_waitTillDone(memscan);
foundlist_initialize(foundlist)

print(foundlist_getCount(foundlist));

print("done");


Things I am not clear about: 1) what goes in the input1 and input2 parameters? Is that the value I am searching for?(in this case 0x01D5E420)
2) The alignment parameter string, i've seen it blank, i've seen it with "4" in it, etc. What effect does that have, if any, on my search?

Finally, the issue I am having with the script is that it returns a count of about 177,000 values give or take, while doing the same search manually returns approximately 387,000 values. It is obvious that I am missing something, I'm just not entirely sure what that is.

Thanks in advanced gents,

emist


Last edited by emist on Fri Jun 29, 2012 8:29 am; edited 1 time in total
Back to top
View user's profile Send private message
emist
How do I cheat?
Reputation: 0

Joined: 29 Jun 2012
Posts: 3

PostPosted: Fri Jun 29, 2012 8:27 am    Post subject: Reply with quote

By the way, what I meant from "a manual scan" is what is in the image attached. I can't post urls just yet it looks like.

It seems my code should return identical results to that because I have set all the same parameters. hexvalue, all, truncated, +X+W.

Not really sure what is going on.

[EDIT] The only thing different is my code doesn't reflect the "Fast Scan" option. I'm not sure where it goes in the firstscan function, but attempts at introducing it have led to complete cheatengine crashes.



cheatengine.jpg
 Description:
 Filesize:  215.48 KB
 Viewed:  9001 Time(s)

cheatengine.jpg


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

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

PostPosted: Fri Jun 29, 2012 10:23 am    Post subject: Reply with quote

Input1 and Input2 should be strings with the value (integers may work too as it may be converted internally, but it's designed for strings
The alignment value is the same as the checkbox right of fastscan, if fastscan is enabled this defines the stepsize, or the value an address should end with. In your case it isn't used (stepsize of 1=disabled, which is the same as unchecked)


Anyhow, according to your picture you should use +W*X-C

_________________
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
emist
How do I cheat?
Reputation: 0

Joined: 29 Jun 2012
Posts: 3

PostPosted: Fri Jun 29, 2012 11:14 am    Post subject: Reply with quote

Dark Byte wrote:
Input1 and Input2 should be strings with the value (integers may work too as it may be converted internally, but it's designed for strings
The alignment value is the same as the checkbox right of fastscan, if fastscan is enabled this defines the stepsize, or the value an address should end with. In your case it isn't used (stepsize of 1=disabled, which is the same as unchecked)


Anyhow, according to your picture you should use +W*X-C


Thanks for the reply mate. Going to give it a shot and report back.
Back to top
View user's profile Send private message
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