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 


help to use lua registersymbol value to an Address .

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Twistedfate
Expert Cheater
Reputation: 1

Joined: 11 Mar 2016
Posts: 231

PostPosted: Fri Jul 07, 2017 4:04 pm    Post subject: help to use lua registersymbol value to an Address . Reply with quote

in AA :
Code:
mov [myaddress],edx
//edx=7

//  so [myaddress] = 7
when I go to  add address manually and add [myaddress] I see its value 7
→ thats good

but in Lua script
Code:
x=7
registerSymbol(x)

//when I go to  add address manually and add [x] I see its value ????? nothing

how to fix that ?
I am trying to make complicated equations with Lua then write the equation to an address then use that address in my AA script
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Fri Jul 07, 2017 8:24 pm    Post subject: Reply with quote

As the celua.txt (and presumably the wiki I never use) says

Code:
registerSymbol(symbolname, address, OPTIONAL donotsave): Registers a userdefined symbol. If donotsave is true this symbol will not get saved when the table is saved


In lua registerSymbol takes a symbol name and an address eg.

Code:
registerSymbol("xSymbolName", xAddressValue)


However in CE 6.7 you can use lua to calculate symbols in AA pretty easily, here's an arbitrary example

Code:
{$lua}
function calcAddr()
  return readPointer('Tutorial-i386.exe+1FD5D0')+0x400+math.pow(2,7)
end
{$asm}
 
[ENABLE]
$calcAddr():
{$lua}
return "dd " .. math.random(-80,80)

[DISABLE]
$getAddress('[Tutorial-i386.exe+1FD5D0]+480'):
  dd #100


both, as you might expect write to [Tutorial-i386.exe+1FD5D0]+480 (017801C0 during my testing) which is the pointer for step 2 of the tutorial.
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