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 


Attempt to call a nil value in Cheat Table

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
TPRammus
Advanced Cheater
Reputation: 0

Joined: 05 Jan 2016
Posts: 61
Location: Germany

PostPosted: Sat Jun 18, 2016 4:29 pm    Post subject: Attempt to call a nil value in Cheat Table Reply with quote

Hey!

I have a problem creating my trainer.
When I add a timer which writes the value of an address to a label, everything is okay at first. But when I reopen my cheat table, an error pops up "Error:attempt to call a nil value". And again and again and again (maybe because the timer is trying to call an address already?). Because of this I barely can go to UDF1 -> Edit.
But when I am in the "editing" windows, the error does not pop up anymore.

The timer is on 1000ms. onTimer:
Code:
function CETimer1Timer(sender)
UDF1.CELabel2.Caption = getAddressList().getMemoryRecordByDescription("HealthOfSomething").Value:match("^%d+") or "???"
end


EDIT: It looks like that(attachment):



23321321.PNG
 Description:
nil
 Filesize:  25.32 KB
 Viewed:  17503 Time(s)

23321321.PNG


Back to top
View user's profile Send private message  
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Sat Jun 18, 2016 4:42 pm    Post subject: Reply with quote

getMemoryRecordByDescription("HealthOfSomething") may not exist, which makes it a nil value, trying to get the match causes the error.
Back to top
View user's profile Send private message  
ParkourPenguin
I post too much
Reputation: 150

Joined: 06 Jul 2014
Posts: 4657

PostPosted: Sat Jun 18, 2016 4:45 pm    Post subject: Reply with quote

cooleko: if that were the case, the error would be "attempt to index a nil value".


In the Lua engine window, deselect View -> Show on "print" and it won't bring that window to the foreground every time something new is printed to it.

Your problem is probably because the function CETimer1Timer isn't defined. You need to make sure the Lua script is executed when you open the cheat table. By default, it should ask you if you want to run it or not. If it doesn't, run it yourself. You can configure the default behavior in the general settings.

_________________
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  
TPRammus
Advanced Cheater
Reputation: 0

Joined: 05 Jan 2016
Posts: 61
Location: Germany

PostPosted: Sat Jun 18, 2016 5:39 pm    Post subject: Reply with quote

Thank you!
Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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