<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="16">
  <Forms>
    <MyTrainer Class="TCEForm" Encoding="Ascii85">b/+8V!Y}vE?VbE.U:_WhjCZ{)n8==KCSJf4ynujV;UGB_G/H3ts{bMDN8%BD2z;+}#z!c*t2N6xzkhemvyD)NXkR(jf8Pcf7kZz8Bur45;)W/c(vS/ll#M6K^y{yCQ;(AIVUe2HzsT^*R51^T/tA2H4gO#vf^!DgGb,?(u#{xwh3*[nwy1QxDGW!FQsL^+RHA{T)Rx:3L?rdKl18wK%LLY08o/i{Sg]iJ4*6#oz{M.H@o90DZ%$#,BYkxP682=8rG:1zRQDp6J4mq@$FM+ujV,+R00$.e,Y3DI0OcXXR85!_W6BeHQQ2Z?24k5[eJ=ZHVUCjtqxyH/.,V^EcG!}YhGd(kW1nPyq20Okv?p!Lb6nk08itZX$kWO_!dTKIX%XpdP9c%YT_g]JBt@f]dK;di(c=!V32%W.8gE,X5ps3wE)s_w?Q@:EBciC$ublRq_KD$YtJ9$);OHx@cd)dMvYJ_HK(0McA2;*=uh_}</MyTrainer>
  </Forms>
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"gold"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>12345678</Address>
      <Offsets>
        <Offset>10</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>1</ID>
      <Description>"ammo"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>12345678</Address>
      <Offsets>
        <Offset>20</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>2</ID>
      <Description>"something else"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>12345678</Address>
      <Offsets>
        <Offset>4</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>3</ID>
      <Description>"shields"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>12345678</Address>
      <Offsets>
        <Offset>8</Offset>
      </Offsets>
    </CheatEntry>
    <CheatEntry>
      <ID>4</ID>
      <Description>"max shields"</Description>
      <Color>80000008</Color>
      <VariableType>4 Bytes</VariableType>
      <Address>12345678</Address>
      <Offsets>
        <Offset>C</Offset>
      </Offsets>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <LuaScript>

al=getAddressList()
gold=al.getMemoryRecordByDescription('gold') --al[0] works too
ammo=al.getMemoryRecordByDescription('ammo') --al[1]
somethingElse=al.getMemoryRecordByDescription('something else') --''
shields=al.getMemoryRecordByDescription('shields') --''
maxShields=al.getMemoryRecordByDescription('max shields') --''



function btn1Click(sender)
  gold.Value=999999
end

function btn2Click(sender)
  ammo.Value=15
end

function btn3Click(sender)
  somethingElse.Value=somethingElse.Value+1
end

function btn4Click(sender)
  shields.Value=maxShields.Value
end

function btn5Click(sender)
  maxShields.Value=maxShields.Value*2
end

function onOpenProcess(processid)
  --called whenever cheatengine opens a process

  --Update the status label
  MyTrainer.lblUpdate.Caption="Attached to process"

  --update the progressbar
  --Right now, the progress is configures to range from 0 to 100
  --Having opened the process probably means fully done, so:
  MyTrainer.CEProgressbar1.Position=100 --100% done
end

MyTrainer.show();
MyTrainer.lblUpdate.Caption="Waiting for the process to be opened"
MyTrainer.CEProgressbar1.Position=50

getAutoAttachList().add('myprocess.exe') --adds the process to the auto attach list
</LuaScript>
</CheatTable>
