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 


Question about MemScan()

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

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Feb 05, 2017 4:22 am    Post subject: Question about MemScan() Reply with quote

Hi there,

Code:
MemScan Class (Inheritance: Object)

methods
   firstScan(scanoption, vartype, roundingtype, input1, input2 ,startAddress ,stopAddress ,protectionflags ,alignmenttype ,"alignmentparam" ,isHexadecimalInput ,
            isNotABinaryString, isunicodescan, iscasesensitive);


Questions for firstScan :
1. is input2 required only if scanoption = soValueBetween ?
2. if scanoption = soValueBetween, input1 = 1000, input2 =1100, interval = +10, where is put interval value in methods structure ?
is this right ? --> firstScan(scanoption, vartype, roundingtype, input1, input2 , interval, .. )
3. Is there any other references for firstScan( .. ) summaries, except in main.lua ?.
I mean something like this, example :

scanoption : soExactValue
- Accept both string and number
- Variable Types required = All Valid Types
- Rounding Types required = on number value
- etc....

soUnknownValue
- etc
- etc..

vartype : vtByte
- use when....
- etc...

and so on....

Thanks
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: Sun Feb 05, 2017 5:36 am    Post subject: Reply with quote

1 input2 is always required, but can be an empty string

2 i have no clue where you get interval from (how do you do it in the ce gui?)

3 just main.lua and the ce sourcecode (and the ce gui)

_________________
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
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Feb 05, 2017 6:53 am    Post subject: Reply with quote

Thanks DB...

1. input2 is always required, but can be an empty string

so if no value to search for input2, then i can use :
Code:
firstScan(scanoption, vartype, roundingtype, input1, "" ,startAddress .. )
-- or
firstScan(scanoption, vartype, roundingtype, input1, nil ,startAddress .. )


2. I've read again topic from : http://forum.cheatengine.org/viewtopic.php?t=602311

fcqgju14156 :
Quote:
the script was looking for multiple values.
From 2.309374809 to 2.967968702 (intervals 0.0625).
For example 2.309374809, 2.371874809, 2.434374809, 2.496874809 ..... and so on.
It is necessary that the script was looking for and changed several values at once


Zanzer :
Quote:
To search for all values between 2.309374809 and 2.967968702 use:

Code:
scan.firstScan(soExactValue,vtSingle,rtRounded,"2.309374809","2.967968702",0,0xffffffffffffffff,"+W-C",fsmNotAligned,nil,false,false,false,false);   


Just so you know, 2.967968702 is not one of the values when adding 0.0625...
So decide if you want to stop at 2.934374809 or 2.996874809.

Code:
local start = 2.309374809
local interval = 0.0625
local finish = 2.934374809
local values = {}
for i = start, finish, interval do
  values[i] = true
end   



You can then check if the found value is equal to one of those intervals.
I'm not sure how well this approach will work due to possible rounding differences.
You could do a similar approach and add/subtract 0.0001 to check against a tiny range.

Code:
for i=0,FoundList.Count-1 do
  if values[FoundList.Value[i]] then
    writeFloat(FoundList.Address[i],2.371874809);
  end
end



Sorry for question, the interval value used is NOT in fisrtScan method but use when manipulating foundlist search result which stored on a defined table.

3. Okay, I will try to make summary for firstScan method / MemScan Class referenced in main.lua and also search for some examples in the forum and other sites if any.

Regards
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