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 use Lua inside Autoassembler to change AA variable

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

Joined: 06 Dec 2010
Posts: 189

PostPosted: Mon Nov 26, 2018 5:01 pm    Post subject: How to use Lua inside Autoassembler to change AA variable Reply with quote

I allocated variables inside the AA script and wish to use LUA to place a mathematical return value into them. Now this is to initialize a math variable for use that is later injected into a variable, changed by AA.

like this:

{$lua}
a = math.sqrt(3)
return value = a

{$asm}
_address:
mov eax,[value]

I want something done like this. or...if you can supply an easier way. I will greatly appreciate it.

_________________
Life can be a blitz. What's right and wrong will fly right past you without you having to do a thing about it.

"Cheating only means you want to hold on to the things you value."
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4711

PostPosted: Mon Nov 26, 2018 5:16 pm    Post subject: Reply with quote

If you want to take this:
Code:
alloc(my_value,8)

my_value:
  dq (double)7.0

and replace 7.0 with some arbitrary number from Lua, then:
Code:
alloc(my_value,8)

my_value:
{$lua}
return ('  dq (double)%f'):format(math.sqrt(3))
{$asm}

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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