View previous topic :: View next topic |
Author |
Message |
SpiderCreator How do I cheat? Reputation: 0
Joined: 28 Sep 2017 Posts: 2
|
Posted: Thu Sep 28, 2017 1:16 am Post subject: MemoryRecord.Active doesn't read or write |
|
|
I have a cheat table with a Lua script that's supposed to activate a memory record shortly after attaching to a process. My Lua script is as follows:
Code: | aalist=getAutoAttachList()
stringlist_add(aalist,"MyProcess.exe")
function onOpenProcess(processid)
sleep(6000)
local theMemoryRecord = getAddressList().getMemoryRecordByID(0)
print(theMemoryRecord.Description)
print(theMemoryRecord.Active)
print(theMemoryRecord.Type)
theMemoryRecord.Active = True
end |
What I am given in response is the following:
Code: | My Memory Record Description
11 |
As you can see, print(theMemoryRecord.Active) prints nothing. Setting theMemoryRecord.Active to True does not check the box on the memory record.
I don't know what I'm doing wrong and I've checked every piece of documentation I could find. I also tried memoryrecord_freeze and memoryrecord_setActive to no avail. I could really use some help. Thanks.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Thu Sep 28, 2017 2:32 am Post subject: |
|
|
don't sleep in onOpenProcess as the symbolhandler and related things have not been executed at that time.
use a timer instead
And you're sure the ID of your memory record is 0 ? (don't mistake ID for index)
_________________
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 |
|
|
SpiderCreator How do I cheat? Reputation: 0
Joined: 28 Sep 2017 Posts: 2
|
Posted: Thu Sep 28, 2017 2:51 am Post subject: |
|
|
Dark Byte wrote: | don't sleep in onOpenProcess as the symbolhandler and related things have not been executed at that time.
use a timer instead | OK. I'll try that and get back to you.
Dark Byte wrote: | And you're sure the ID of your memory record is 0 ? (don't mistake ID for index) | Yes, I'm positive it's 0. Otherwise, onOpenProcess would not be able to correctly print the description and type of the memory record.
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Sep 28, 2017 8:13 am Post subject: |
|
|
Boolean values can not be printed with just print function. You have to use tostring first, it will covert Boolean to text.
Code: | print(true)
print(false)
print(tostring(true))
print(tostring(false)) |
also, Lua is case sensitive. true is a Boolean, True is a variable.
fixed script
Code: | aalist=getAutoAttachList()
aalist.add("MyProcess.exe")
function onOpenProcess(processid)
local t=createTimer(nil,true)
t.Interval = 6000
t.OnTimer = function()
t.destroy()
local theMemoryRecord = getAddressList().getMemoryRecordByID(0)
print(theMemoryRecord.Description)
print(tostring(theMemoryRecord.Active))
print(theMemoryRecord.Type)
theMemoryRecord.Active = true
end
end |
_________________
|
|
Back to top |
|
|
|