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 


Auto Assemble use value from {$lua}

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
mrBump
How do I cheat?
Reputation: 0

Joined: 02 Aug 2022
Posts: 5

PostPosted: Tue Aug 02, 2022 5:08 am    Post subject: Auto Assemble use value from {$lua} Reply with quote

Hello! How can I use the variable I got from {$lua} in {$asm}? I have tried but it doesn't work. The variable I want to use is IsAbilityPermittedAddr.

Code:
[ENABLE]
{$lua}
IsAbilityPermittedAddr = getAddress("CastAbility_RL:IsAbilityPermitted")

{$asm}
CastAbility_RL:IsAbilityPermitted + 977:
  jmp IsAbilityPermittedAddr + b72
  nop

[DISABLE]
CastAbility_RL:IsAbilityPermitted + 977:
  jng IsAbilityPermittedAddr + b72
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Tue Aug 02, 2022 5:45 am    Post subject: Reply with quote

You must register a symbol:
Code:

[ENABLE]
{$lua}
registerSymbol('IsAbilityPermittedAddr', getAddress("CastAbility_RL:IsAbilityPermitted"), true)
{$asm}
CastAbility_RL:IsAbilityPermitted+977:
  jmp IsAbilityPermittedAddr+b72
  nop

[DISABLE]
CastAbility_RL:IsAbilityPermitted+977:
  jng IsAbilityPermittedAddr+b72

unregistersymbol(IsAbilityPermittedAddr)


My apologies.


Last edited by LeFiXER on Tue Aug 02, 2022 7:07 am; edited 2 times in total
Back to top
View user's profile Send private message
mrBump
How do I cheat?
Reputation: 0

Joined: 02 Aug 2022
Posts: 5

PostPosted: Tue Aug 02, 2022 6:14 am    Post subject: Reply with quote

LeFiXER wrote:
~

Thank you for your answer. I have tried your code but CE shows a warning. It still can't recognise IsAbilityPermittedAddr.
Code:
Not all code is injectable.
(Error in line 7 (jmp IsAbilityPermittedAddr + b72): This instruction can't be compiled)
Are you sure you want to edit it to this?
Back to top
View user's profile Send private message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1055
Location: 0x90

PostPosted: Tue Aug 02, 2022 7:06 am    Post subject: Reply with quote

mrBump wrote:
...


My apologies, just tested, I forgot that you had to pass an address parameter to the registerSymbol function in Lua.

Try it now.
Back to top
View user's profile Send private message
mrBump
How do I cheat?
Reputation: 0

Joined: 02 Aug 2022
Posts: 5

PostPosted: Tue Aug 02, 2022 7:47 am    Post subject: Reply with quote

LeFiXER wrote:
mrBump wrote:
...


My apologies, just tested, I forgot that you had to pass an address parameter to the registerSymbol function in Lua.

Try it now.

Thank you! Everything works perfectly Very Happy
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