diff --git a/lua/Cheat Engine/Supermarket.lua b/lua/Cheat Engine/Supermarket.lua index a9219f1..c6c1e04 100644 --- a/lua/Cheat Engine/Supermarket.lua +++ b/lua/Cheat Engine/Supermarket.lua @@ -59,9 +59,8 @@ function getFieldFromName(class, name, shouldBeStatic) end --[[ - mono wrappers + mono class wrappers ]] --- UNUSED function MonoArray(addr) local classId, className = mono_object_getClass(addr) if not className then error("address did not point to valid object") end @@ -92,7 +91,6 @@ function MonoArray(addr) return array end --- UNUSED local stringClass = mono_findClass("System", "String") local string_Length = getFieldFromName(stringClass, "_stringLength") local string_FirstChar = getFieldFromName(stringClass, "_firstChar") @@ -241,6 +239,15 @@ function MonoClass(namespace, name) }) end +local typeClass = MonoClass("System", "Type") +function Type(typeName) + local typeStr = mono_new_string(typeName) + local getType = typeClass:getMethod("GetType") + local typeRet = getType(typeStr) + + print(type(typeRet), typeRet) +end + --[[ game ]] @@ -253,8 +260,6 @@ printf("GameData.Instance field offset: %x", instanceOffset or 0) local gameDataInstance = GameDataClass:getStaticField(instanceOffset) printf("GameData: %x", gameDataInstance or 0) -local moneySpentHelper = GameDataClass:getMethod("CmdAlterFundsWithoutExperience") - -printf("GameData.CmdAlterFundsWithoutExperience: %x", moneySpentHelper._id or 0) - -moneySpentHelper(gameDataInstance, -51170) +local alterFunds = GameDataClass:getMethod("CmdAlterFunds") +printf("GameData.CmdAlterFunds: %x", alterFunds._id or 0) +alterFunds(gameDataInstance, 13371337)