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 


Strange error

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

Joined: 24 Dec 2020
Posts: 1

PostPosted: Thu Dec 24, 2020 4:46 am    Post subject: Strange error Reply with quote

this is my script in cheat engine 7.2 auto assemble

Code:

[ENABLE]
{$lua}
saved_left = readInteger("(0393A64C)+C")
saved_right = readInteger("(0393A64C)+14")
saved_top = readInteger("(0393A64C)+10")
saved_bottom = readInteger("(0393A64C)+18")

my_x = readInteger("(0394E600)+FEC")
my_y = readInteger("(0394E600)+FF0")

writeInteger = ("(0393A64C)+C", my_x-5)
writeInteger = ("(0393A64C)+14", my_x+5)
writeInteger = ("(0393A64C)+10", my_y)
writeInteger = ("(0393A64C)+18", my_y)



[DISABLE]
{$lua}
writeInteger = ("(0393A64C)+C", saved_left)
writeInteger = ("(0393A64C)+14", saved_right)
writeInteger = ("(0393A64C)+10", saved_top)
writeInteger = ("(0393A64C)+18", saved_bottom)


and i getting this
Lua error in the script at line 2:[string "local syntax check,memrec=..."]:10: ')' expected near ',')

help please
Back to top
View user's profile Send private message
jgoemat
Expert Cheater
Reputation: 22

Joined: 25 Sep 2011
Posts: 244

PostPosted: Wed Jan 13, 2021 1:24 pm    Post subject: Reply with quote

The line 2 refers to the start of the lua script itself. The real line number is the ':10' which is the 10th line including `{$lua}`:

Code:
writeInteger = ("(0393A64C)+C", my_x-5)


This is attempting to assign a value to a variable named 'writeInteger', but the value is incorrect. You cannot use a ',' in an expression like this. I think you're wanting to call the 'writeInteger' function which should look like this without the ' = ':

Code:
writeInteger("(0393A64C)+C", my_x-5)
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