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 


What's wrong with this block?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Tue Jan 21, 2014 6:14 pm    Post subject: What's wrong with this block? Reply with quote

I've had this block of code in a table that was developed in either 6.1 or 6.2. Anyway using 6.3 I get an error: Invalid class object.

Code:
function CECheckbox1Click(sender)
boxstate = checkbox_getState(CheatPanel_CECheckbox1)
print("The state of the check box is ", boxstate)
if boxstate == cbChecked then
  timer_setEnabled(t, true)
  print("The timer is enabled")
else
  timer_setEnabled(t, false)
  print("The timer is not enabled")
end
end

CE freezes and is greyed out and I get 4 more CE's on the tool bar. The first is a 6.3, the second is Lua engine, the third is CheatPanel, Lua script:Cheat Table. All are greyed out. The print statements work down to and including "The timer is enabled", after that output is the error statement.

EDIT: I just checked another game with:
Code:
function CECheckbox1Click(sender)
boxstate = checkbox_getState(CheatPanel_CECheckbox1)
if boxstate == cbChecked then
  timer_setEnabled(t, true)
  print("The timer is enabled")
else
  timer_setEnabled(t, false)
  print("The timer is not enabled")
end
end
and get no errors! Both had identical timer statements 1st:
Code:
t = createTimer(nil, true)
timer_onTimer(t, MaxHP)
timer_setInterval(t, 500)--checks every 500 milliseconds
timer_setEnabled(t, false)
print("The timer is not enabled")
and the 2nd:
Code:
t = createTimer(nil, true)
timer_onTimer(t, MaxHP)
timer_setInterval(t, 500)--checks every 500 milliseconds
timer_setEnabled(t, false)
print("The timer is not enabled")
Back to top
View user's profile Send private message Yahoo Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25804
Location: The netherlands

PostPosted: Tue Jan 21, 2014 6:48 pm    Post subject: Reply with quote

check the MaxHP code
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Tue Jan 21, 2014 7:42 pm    Post subject: Reply with quote

DB, you were precisely correct. This is a first to my remembrance, but one of the memoryrecord statements was truncated. Perhaps a fat finger on the keyboard at an inopportune time.
Thanks as always
Back to top
View user's profile Send private message Yahoo Messenger
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Wed Jan 22, 2014 8:14 am    Post subject: Reply with quote

Hey bknight, verify that the addresses do exist (like in the script I've sent you, make sure you have ALL params that you need for action).

About your request, I haven't had really time lately.
So to avoid the headache I might get from trying to understand your request (English is my 3rd language), a example script (comment what and etc. you wish to do) or an image would help me.

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
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