<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="14">
  <Forms>
    <CETrainer>ED924D6BDB3018C795787E2F6D6187311863D04B6197A65F60D88E834B4D6C1A95B1DD6459A945542BC84ADB7D867E809EF65DA7C8AE6BB28CB11D76DAC97A2C3DFFDFFF7979340180F9ECEC004281684DC48C8B5B378ABBE8554A96D228465642E84D258D276040BE1EAFCDCFB49495F17A6447682D29AFAD979C83885152CB3EC36FE33E23AB23C61B627BFAA32EF1CAC97943B732F6E19A2FB020A48E540A11C081519CA39A302F4AE200E6C13C4EB5A931D8F1047A4F66C0E84D6D3B88B5E4DF1872202A32511231061A97A282303FC9E065FC250DC2679ED7F1C6871AE7B5B8F149DF012BE17245BEF939124A3DE28C0B67A0783C8D17D1D5450E2FB2F940B6DC2FFBFE45365E2E09963BB2AE920D3752F2DA0FC2EC1A86D71066F356F2F459F2AD96BCEB242FEDA0C615178DEFA055C855EE2DE8296650F08DD4B351F3B03D1DB6B319B467888DD26C110FB0C677F037DC76177AEE60277AEE08004BE28A2069E92538DB19C83B8D3BEDE6FF46EDE4F6ED5C197621799078DB32DBC56C4A9668C3A41B9754DE6B6B653733CB0A98FC389BF853D26041BB8DCEF4F7C3C9C46B5F31BD76478337FACF5737C092DE21494AE7A83BAABB166B6276454AAFA9F87DA5455C2F41CDD641C81F1C5F9D9559BC2A54B053E5646F959F7EAE72F487559EEFAFF2FC5F5509C0FFCEFCAA333F00</CETrainer>
  </Forms>
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"No description"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>400020</Address>
    </CheatEntry>
    <CheatEntry>
      <ID>1</ID>
      <Description>"No description"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>400024</Address>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <LuaScript>addresslist=getAddressList()
memrec1=addresslist_getMemoryRecordByID(addresslist,0)
memrec2=addresslist_getMemoryRecordByID(addresslist,1)

cheat_1_state = false
cheat_2_state = false


function cheat_1()

  if cheat_1_state then memoryrecord_unfreeze(memrec1)
                   else memoryrecord_freeze(memrec1) end

  local isActive=memoryrecord_isActive(memrec1)

  cheatcomponent_setActive(CETrainer_CHEAT0,isActive)

  if cheat_1_state~=isActive then
    beep()
  end

  cheat_1_state = isActive
end

function cheat_2()

  if cheat_2_state then memoryrecord_unfreeze(memrec2)
                   else memoryrecord_freeze(memrec2) end

  local isActive=memoryrecord_isActive(memrec2)

  cheatcomponent_setActive(CETrainer_CHEAT1,isActive)

  if cheat_2_state~=isActive then
    beep()
  end

  cheat_2_state = isActive
end

strings_add(getAutoAttachList(), "calc.exe")
form_show(CETrainer)

function AboutClick()
  showMessage(gAboutText)
end
gAboutText=[[DEMO]]

function CloseClick()
  closeCE()
  return caFree --onClick doesn't care, but onClose would like a result
end

function passwordeditkeypress(sender, key)
  if key ~= '\r' then return key end
  if control_getCaption(editPassword) ~= 'secret' then return end

  createHotkey(cheat_1,VK_F1,VK_MENU)
  createHotkey(cheat_2,VK_F2,VK_MENU)

  control_setVisible(labelPassword, false)
  control_setVisible(editPassword, false)
  control_setVisible(CETrainer_CHEATPANEL, true)
end

control_setVisible(CETrainer_CHEATPANEL, false)

labelPassword = createLabel(CETrainer)
control_setPosition(labelPassword,5,5)
control_setCaption(labelPassword,'password:')

editPassword = createEdit(CETrainer)
setProperty(editPassword,'EchoMode','emPassword')
control_setPosition(editPassword,5,25)
setMethodProperty(editPassword,'OnKeyPress',passwordeditkeypress)

</LuaScript>
</CheatTable>
