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 


Checkbox Invalid Object Error

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

Joined: 09 Jun 2015
Posts: 77

PostPosted: Wed Jul 13, 2016 2:30 am    Post subject: Checkbox Invalid Object Error Reply with quote

Hey guys, this script keeps returning invalid class object

Code:

function CECheckbox11Change(sender)
  if (checkbox_getState(UDF1.CECheckbox11) == 1) then
    CheatEntry=addresslist_getMemoryRecordByID(addresslist,0)
    memoryrecord_freeze(CheatEntry)
  else
    CheatEntry=addresslist_getMemoryRecordByID(addresslist,0)
    memoryrecord_unfreeze(CheatEntry)
  end
end

function CECheckbox23Change(sender)
  if (checkbox_getState(UDF1.CECheckbox23) == 1) then
    CheatEntry=addresslist_getMemoryRecordByID(addresslist,1)
    memoryrecord_freeze(CheatEntry)
  else
    CheatEntry=addresslist_getMemoryRecordByID(addresslist,1)
    memoryrecord_unfreeze(CheatEntry)
  end
end

I am on Cheat Engine 6.5.1 by the way.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jul 13, 2016 3:33 am    Post subject: Reply with quote

are you sure the ID's of the memoryrecord you're interested in are 0 and 1? (you may want to use index instead)

an ID is an unique value that never changes, not even when a entry before it gets deleted or inserted
easiest way to check the ID is cropy the entries to clipboard and check out the ID field

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

Joined: 09 Jun 2015
Posts: 77

PostPosted: Wed Jul 13, 2016 3:54 am    Post subject: Reply with quote

It still isn't working...
The new code I tried is:
Code:

function CECheckbox11Change(sender)
  if (checkbox_getState(UDF1.CECheckbox11) == 1) then
    CheatEntry=addresslist_getMemoryRecordByIndex(addresslist,0)
    memoryrecord_freeze(CheatEntry)
  else
    CheatEntry=addresslist_getMemoryRecordByIndex(addresslist,0)
    memoryrecord_unfreeze(CheatEntry)
  end
end

function CECheckbox23Change(sender)
  if (checkbox_getState(UDF1.CECheckbox23) == 1) then
    CheatEntry=addresslist_getMemoryRecordByIndex(addresslist,1)
    memoryrecord_freeze(CheatEntry)
  else
    CheatEntry=addresslist_getMemoryRecordByIndex(addresslist,1)
    memoryrecord_unfreeze(CheatEntry)
  end
end


I will provide the cheat table below...



Resident Evil 5 Trainer.CT
 Description:

Download
 Filename:  Resident Evil 5 Trainer.CT
 Filesize:  922 Bytes
 Downloaded:  573 Time(s)

Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jul 13, 2016 4:03 am    Post subject: Reply with quote

have you setup addresslist with getAddressList() ?
_________________
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
Reclaimer Shawn
Advanced Cheater
Reputation: 0

Joined: 09 Jun 2015
Posts: 77

PostPosted: Wed Jul 13, 2016 4:20 am    Post subject: Reply with quote

Dark Byte wrote:
have you setup addresslist with getAddressList() ?


I am using this:
addresslist=getAddressList ()
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jul 13, 2016 4:32 am    Post subject: Reply with quote

what line is giving the error ? And what is the error ? (Because i'm quite sure that addresslist_getMemoryRecordByIndex should have given a new error message as it doesn't exist)

anyhow,
try this code:
Code:

function CECheckbox11Change(sender)
  getAddressList().getMemoryRecord(0).Active=UDF1.CECheckbox11.Checked
end

function CECheckbox23Change(sender)
  getAddressList().getMemoryRecord(1).Active=UDF1.CECheckbox23.Checked
end

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

Joined: 09 Jun 2015
Posts: 77

PostPosted: Wed Jul 13, 2016 2:57 pm    Post subject: Reply with quote

Thank you Dark Byte. It works now! The only problem is that it still throes an invalid class object error (even though the functions still turns off and on 100%) Is there a command in Lua that hides exceptions?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Wed Jul 13, 2016 4:32 pm    Post subject: Reply with quote

Check the line number and check out the code there.
_________________
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
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