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 


Why doesn't lua work?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
eigocc
Newbie cheater
Reputation: 0

Joined: 22 Dec 2018
Posts: 15

PostPosted: Mon Dec 31, 2018 9:46 pm    Post subject: Why doesn't lua work? Reply with quote

I want the program to check the register every time it runs here, but it can't!


1.png
 Description:
 Filesize:  19.29 KB
 Viewed:  979 Time(s)

1.png


Back to top
View user's profile Send private message Send e-mail
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4291

PostPosted: Mon Dec 31, 2018 10:32 pm    Post subject: Reply with quote

{$lua} blocks act more like preprocessor macros. They run before most other things and are replaced by whatever string they return (if any).

You could call Lua code to run from the game, but that would be ridiculous for something like this. Just use assembly.

Code:
newmem:
  cmp eax,1
  je short checkagain
originalcode:
  mov [esi+ecx*4],ebx
exit:
  mov eax,ebx
  jmp returnhere
checkagain:
  lea eax,[ecx-C]
  cmp eax,1
  ja short originalcode
  jmp short exit

PS: the 0x prefix exists in Lua.

_________________
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