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 


How to add register symbo with lua to use it in AA script ?

 
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: 0

Joined: 11 Mar 2016
Posts: 185

PostPosted: Tue May 09, 2017 2:03 pm    Post subject: How to add register symbo with lua to use it in AA script ? Reply with quote

I seen this in main.lua but I cannot figure out how to use it .
registerSymbol(symbolname, address, OPTIONAL donotsave)

I want to store this equation in register symbol(x) then use[ x ] in AA script
In Lua
Code:
x=(m/y)+7
add x as registersymbol() ...

In AA
Code:
mov ecx,[x]
cmp [esi+20],ecx
je code
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 338

Joined: 09 May 2003
Posts: 19826
Location: The netherlands

PostPosted: Tue May 09, 2017 2:09 pm    Post subject: Reply with quote

registersymbol('x',math.floor(x))
or
registersymbol('x',math.floor((m/y)+7))

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
Twistedfate
Expert Cheater
Reputation: 0

Joined: 11 Mar 2016
Posts: 185

PostPosted: Wed May 10, 2017 10:37 am    Post subject: Reply with quote

is there something messing ?
I open lua script
and write
registerSymbol('x',math.floor(x))
then open AA trying to
mov edx,[x] → doesnot work looks like the registerSymbol is not in memory what is the wrong ?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 338

Joined: 09 May 2003
Posts: 19826
Location: The netherlands

PostPosted: Wed May 10, 2017 12:25 pm    Post subject: Reply with quote

what value have you set to x?
is x a readable address ?

did you execute the lua first ?(so not just write it, also execute)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
Twistedfate
Expert Cheater
Reputation: 0

Joined: 11 Mar 2016
Posts: 185

PostPosted: Wed May 10, 2017 2:43 pm    Post subject: Reply with quote

I want to execute lua first .
I want to make equations with Lua .
x=equation
Then use [x] in AA script as register symbol created from Lua .

example :
in lua

Code:
a=readnteger(blah)
b=readnteger(blahblah)
x=a/b

then use x in AA script
Code:
mov eax,[x]
cmp [ecx+10],eax
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 338

Joined: 09 May 2003
Posts: 19826
Location: The netherlands

PostPosted: Wed May 10, 2017 3:24 pm    Post subject: Reply with quote

the registered symbol has to contain an address in memory

also, each time x changes you will have to reregister the symbol

and keep in mind that you will have to reassemble the code again with the new value

perhaps you want to use a timer instead that writes the result of yoyr calculation somewhere in the target process instead

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
panraven
Grandmaster Cheater
Reputation: 25

Joined: 01 Oct 2008
Posts: 637

PostPosted: Wed May 10, 2017 5:46 pm    Post subject: This post has 1 review(s) Reply with quote

I probably miss the point...

If want to make assemble script from simple c script, this online tool may help:

Compiler Explorer

the callIt function is to show how parameter is input and how the result is return, so that it may adapt to AA script.

bye~

_________________
- Retarded.
dropbox
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