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

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

Joined: 15 Mar 2017
Posts: 1
Location: Dubai

PostPosted: Tue Apr 18, 2017 7:07 am    Post subject: HELP Reply with quote

I was trying to paste a lua script when I realised I am literally unable to make or paste scripts as I get "unexpected symbol near '(whatever is put on the first line)'" no matter what I do, literally NOTHING works, please tell me what I'm doing wrong Crying or Very sad
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Apr 18, 2017 7:56 am    Post subject: Reply with quote

if you're using Cheat Engines auto assembler scripts note that by default they expect a script in assembly not lua and you have to use
Code:
{$lua}
to switch the parser, eg.

Code:

[ENABLE]
// switch to lua parser
{$lua}
-- lua code goes here
...
-- switch back to assembly parser
{$asm}
// possible assembly code here

[DISABLE]
// possible assembly code here


note that lua code runs before the asm code, right after you activate the script, if you return a string in the lua section it will be parsed as assembly code as if you had written it in the auto assembly script

example with code

Code:

[ENABLE]
{$lua}
return [[400290: // a code cave in the i386 3.3 tutorial process
  db ]] .. ("90 "):rep(10)
  -- should return, and thus assemble
  -- 400290: // a code cave in the i386 3.3 tutorial process
  --   db 90 90 90 90 90 90 90 90 90
{$asm}

[DISABLE]


The lua parser does understand the [ENABLE] and [DISABLE] lines/flags so if your entire script is lua you can just use {$lua} at the top without worrying about it.

Also note that CE will attempt to run any lua code in the script when you click "OK" to save the script, you may need to use
Code:
if syntaxcheck then return end
somewhere in your script (probably near the top) to prevent that when CE is running the script purely to check it's syntax (syntaxcheck will be true in that case, and false otherwise).

Beyond that.... I don't have any ideas off the top of my head just from what info you've given.
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