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 


MemoryRecord Custom Type

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

Joined: 05 Mar 2016
Posts: 75

PostPosted: Sat Jan 20, 2018 7:06 pm    Post subject: MemoryRecord Custom Type Reply with quote

I can't seem to find a way to set a Memory Record to a specific custom type.

Code:

MemoryRecord.setCustomTypeName("My Custom Type") -- doesn't exist
MemoryRecord.CustomTypeName = "My Custom Type" -- doesn't work
MemoryRecord.VarType = "My Custom Type" -- seems to change to the default vtDword, doesn't seem to look for custom types.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Jan 20, 2018 7:31 pm    Post subject: Reply with quote

You have to set "Type" to "vtCustomType" to use custom types, then set "CustomTypeName".

Quote:

CustomTypeName: String - If the type is vtCustomType this will contain the name of the CustomType

_________________
Back to top
View user's profile Send private message Visit poster's website
dl748
Advanced Cheater
Reputation: 0

Joined: 05 Mar 2016
Posts: 75

PostPosted: Sat Jan 20, 2018 8:35 pm    Post subject: Reply with quote

tried that, vtCustomType doesn't work, defaults to vtDword.

According to this. There is no vtCustomType type. There is a vtCustom, but setting CustomTypeName does nothing to the entry.

vtCustom just creates a blank line (i use this a lot to keep a uneditable pointer, to set child memory record to offsets.
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Jan 20, 2018 8:44 pm    Post subject: Reply with quote

Yeah, just pulled that from the "celau.txt" file, but you are right, in "defines.lua" there is only a "vtCustom".

But this works for me on 6.7.
Code:
local mr = AddressList.createMemoryRecord()
mr.Description = 'Custom Type Test'
mr.Type = vtCustom
mr.CustomTypeName = 'Int / 2'


EDIT:
Do you have the custom type registered?

_________________
Back to top
View user's profile Send private message Visit poster's website
dl748
Advanced Cheater
Reputation: 0

Joined: 05 Mar 2016
Posts: 75

PostPosted: Sat Jan 20, 2018 9:58 pm    Post subject: Reply with quote

6.7 here

Yeah, that code doesn't work for me, even if i change the name to yours. Yes its registered because I have some temporary entries using it.

Also, using .Type doesn't work for me either. I have to use .VarType
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sat Jan 20, 2018 10:31 pm    Post subject: Reply with quote

Changing the name to the custom type on my computer will do you no good if you don't have a custom type registered with that same name.

And not sure what to say about the VarType other than the only CE Lua classes that has that property are the "MemScan" and "StructureElement" classes, at lest that I know of.

The only other thing I can say to try is open CE with out a table hook the tutorial process and run this in the Lua Engine form.

Code:
local TypeName = 'Int / 2'
local ByteCount = 4
local IsFloat = false
local function bytesToValue( ... )
   local bytes = { ... }
   return (byteTableToDword({ bytes[1], bytes[2], bytes[3], bytes[4] }) / 2)
end
local function valueToBytes(value)
   local bytes = dwordToByteTable(value * 2)
   return bytes[1], bytes[2], bytes[3], bytes[4]
end
registerCustomTypeLua(TypeName, ByteCount, bytesToValue, valueToBytes, IsFloat)
local mr = AddressList.createMemoryRecord()
mr.Description = 'Custom Type Test'
mr.Type = vtCustom
mr.CustomTypeName = TypeName

_________________
Back to top
View user's profile Send private message Visit poster's website
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