View previous topic :: View next topic |
Author |
Message |
Reaper79 Advanced Cheater
Reputation: 2
Joined: 21 Nov 2013 Posts: 68 Location: Germany
|
Posted: Mon Nov 23, 2020 4:00 pm Post subject: LUA Return Define string to AA ? |
|
|
Hiho,
Weired title i know...
Code: |
{$lua}
local newmem = 'myNewMem'
local result = 0x12345
return ([[ define(%s, %s)]]):format(newmem, string.format('%X',result))
|
It seems the "consts / token" from define doesn't accept strings...
Anyway to get around this ?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25783 Location: The netherlands
|
Posted: Mon Nov 23, 2020 4:15 pm Post subject: |
|
|
seems to work fine
Code: |
alloc(bla,1024)
{$lua}
local newmem = 'myNewMem'
local result = 0x12345
return ([[ define(%s, %s)]]):format(newmem, string.format('%X',result))
{$asm}
bla:
mov eax,myNewMem
|
_________________
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 |
|
 |
Reaper79 Advanced Cheater
Reputation: 2
Joined: 21 Nov 2013 Posts: 68 Location: Germany
|
Posted: Mon Nov 23, 2020 5:03 pm Post subject: |
|
|
I must have expressed myself wrong,
I want the same as if you were doing "Define(newmem, 0x12345)" in AA...
But via LUA script....
Code: |
{$lua}
--psydo code
-- local result = 0x1401234
-- local memoryLabel = 'newmem'
return ([[ define(%s, %s)]]):format(memoryLabel, string.format('%X',result)) |
The AA Define() uses tokens / Const?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25783 Location: The netherlands
|
Posted: Mon Nov 23, 2020 5:23 pm Post subject: |
|
|
define(string,string)
_________________
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 |
|
 |
Reaper79 Advanced Cheater
Reputation: 2
Joined: 21 Nov 2013 Posts: 68 Location: Germany
|
Posted: Tue Nov 24, 2020 3:45 pm Post subject: |
|
|
Hi,
i think i found the issue, issue ?
I called a function from the Cheat Table Lua Script from an AA script:
Cheat Table LUA Script:
Code: |
function luaDefine(label, address)
return ([[define(%s,%s)]]):format(label, string.format('%x',address))
end
|
AA Script:
Code: |
[ENABLE]
luacall(luaDefine('myLabel', 1401234)) //Doesn't work
{$lua}
luaDefine('myLabel', 1401234) -- WORKS
{$asm}
label(pPointer)
registersymbol(pPointer)
myLabel:
pPointer:
dq 0
[DISABLE]
unregistersymbol(pPointer)
|
gaga me or don't know....
It seems luacall doesn't return the return ? Or is it out of scope ?
i did a workaround with registerAutoAssambleCommand in the lua script and it returns how it should ^^ Much cleaner ?
PS: Workaround
Code: |
function luaDefine(parameters, syntaxcheck)
// example 2
https://wiki.cheatengine.org/index.php?title=Lua:registerAutoAssemblerCommand
end
registerAutoAssemblerCommand('luaDefine', luaDefine)
|
|
|
Back to top |
|
 |
|