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 


Getting "Invalid Class object" error when executin

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Gascon
Newbie cheater
Reputation: 0

Joined: 03 May 2015
Posts: 11

PostPosted: Sun Nov 15, 2015 12:18 am    Post subject: Getting "Invalid Class object" error when executin Reply with quote

I have this script and it was working fine but then I don't know what happened but it gives "Invalid class object" error and it no longer works.

Code:

addresslist=getAddressList()
memrecAmmo=addresslist.getMemoryRecordByDescription("Inf Ammo")
memrecRestorative=addresslist.getMemoryRecordByDescription("Inf Restorative")
memrecThrowables=addresslist.getMemoryRecordByDescription("Inf Throwables")
memrecInventory=addresslist.getMemoryRecordByDescription("Inventory Editor")
--memrecItemID=addresslist.getMemoryRecordByDescription("Item ID")
--memrecItemCount=addresslist.getMemoryRecordByDescription("Item Count")
--memrecMaxStack=addresslist.getMemoryRecordByDescription("Max Stack")
ItemIDValue=addresslist_getMemoryRecordByDescription(addresslist, "Item ID")
ItemCountValue=addresslist_getMemoryRecordByDescription(addresslist, "Item Count")
ItemMaxStackValue=addresslist_getMemoryRecordByDescription(addresslist, "Max Stack")


memrecAmmo_hotkey1=memrecAmmo.getHotkeyByID(1)
memrecRestorative_hotkey1=memrecRestorative.getHotkeyByID(1)
memrecThrowables_hotkey1=memrecThrowables.getHotkeyByID(1)
memrecInventory_hotkey1=memrecInventory.getHotkeyByID(1)
ItemIDValue=memoryrecord_getValue(memrecItemID)
ItemCountValue=memoryrecord_getValue(memrecItemCount)
ItemMaxStackValue=memoryrecord_getValue(memrecMaxStack)



control_setVisible(ZombiTrainer_InventoryEditorPanel, false)
control_setVisible(ZombiTrainer_IDList, false)

function onPostHotkey0(Hotkey)

  local memrec=Hotkey.Owner
  local isActive=memrec.Active

    if isActive then
      playSound(gActivateSound)
      ZombiTrainer.Label04.Font.Color=0x0000ff
      beep()

    else
      playSound(gDeactivateSound)
      ZombiTrainer.Label04.Font.Color=0xffffff
      beep()

    end

end

memrecAmmo_hotkey1.onPostHotkey=onPostHotkey0

function onPostHotkey1(Hotkey)

  local memrec=Hotkey.Owner
  local isActive=memrec.Active

    if isActive then
      playSound(gActivateSound)
      ZombiTrainer.Label06.Font.Color=0x0000ff
      beep()

    else
      playSound(gDeactivateSound)
      ZombiTrainer.Label06.Font.Color=0xffffff
      beep()

    end

end

memrecRestorative_hotkey1.onPostHotkey=onPostHotkey1

function onPostHotkey2(Hotkey)

  local memrec=Hotkey.Owner
  local isActive=memrec.Active

    if isActive then
      playSound(gActivateSound)
      ZombiTrainer.Label08.Font.Color=0x0000ff
      beep()

    else
      playSound(gDeactivateSound)
      ZombiTrainer.Label08.Font.Color=0xffffff
      beep()

    end

end

memrecThrowables_hotkey1.onPostHotkey=onPostHotkey2

function onPostHotkey3(Hotkey)

  local memrec=Hotkey.Owner
  local isActive=memrec.Active

    if isActive then
      playSound(gActivateSound)
      ZombiTrainer.Label10.Font.Color=0x0000ff
      beep()

      control_setVisible(ZombiTrainer_InventoryEditorPanel, true)
      control_setVisible(ZombiTrainer_IDList, true)

    else
      playSound(gDeactivateSound)
      ZombiTrainer.Label10.Font.Color=0xffffff
      beep()

      control_setVisible(ZombiTrainer_InventoryEditorPanel, false)
      control_setVisible(ZombiTrainer_IDList, false)

    end

end

memrecInventory_hotkey1.onPostHotkey=onPostHotkey3



getAutoAttachList().add("ZOMBI.exe")
gPlaySoundOnAction=true
ZombiTrainer.show()


function CloseClick()

  closeCE()
  return caFree -t
end


function ReadButtonClick(sender)
      control_setCaption(ZombiTrainer_TextBox01, ItemIDValue)
      control_setCaption(ZombiTrainer_TextBox02, ItemCountValue)
      control_setCaption(ZombiTrainer_TextBox03, ItemMaxStackValue)

end
--function WriteButtonClick(sender)

--end
Back to top
View user's profile Send private message Send e-mail
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sun Nov 15, 2015 2:52 am    Post subject: Reply with quote

does it say what line?
And are the memory record entries still in the list?
is the ZombiTrainer form still in the table form list?

_________________
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
Gascon
Newbie cheater
Reputation: 0

Joined: 03 May 2015
Posts: 11

PostPosted: Sun Nov 15, 2015 11:13 am    Post subject: Reply with quote

No it doesn't say what line. It just pops up a "undefined lua error" message and invalid class object in the list thing.
Yes actually the hotkeys still work but nothing else does.the color of the labels don't change anymore, the panel doesn't hide, and the read button won't work.
And yes the form is still there.

Please help me Sad this is driving me crazy

By the way you kinda are like batman Very Happy you watch over the forum and when somebody needs help you fly in to his aid.
Back to top
View user's profile Send private message Send e-mail
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun Nov 15, 2015 9:57 pm    Post subject: Reply with quote

Hi there,

Please check this, it should help :
http://forum.cheatengine.org/viewtopic.php?p=5490226

regards
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