<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="51">
  <CheatEntries>
    <CheatEntry>
      <ID>111</ID>
      <Description>"[$LUA] Get Clockwork [15.2]"</Description>
      <Options moDeactivateChildrenAsWell="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then
    return
end
function aOBScanModule(a, b)
    local c = getAddress(a)
    local d = getModuleSize(a) + c;
    local e = createMemScan()
    e.firstScan(soExactValue, vtByteArray, rtRounded, b, nil, c, d, "", fsmNotAligned, "", true, false, false, false,
        false)
    e.waitTillDone()
    local f = createFoundList(e)
    f.initialize()
    local g = createStringlist()
    local h = 0;
    while tonumber(f.Address[h], 16) ~= 0 do
        g.add(f.Address[h])
        h = h + 1
    end
    e.destroy()
    f.deinitialize()
    f.destroy()
    return g
end

local function getClockWork(i)
for h = 0, i.Count - 1 do
    if disassemble(i.String[h]):match('mov') then
        local j = disassemble(i.String[h]):match("%[(.-)%]")
        if readByte(j) then
            registerSymbol("Clockwork_" .. h, j)
            local k = synchronize(function() return AddressList.createMemoryRecord() end)
            synchronize(function()
            k.appendToEntry(memrec)
            k.setDescription("Clockwork_" .. h)
            k.setType(vtDword)
            k.setAddress(j)
            end)
            local l = tonumber(i.String[h], 16)
            local m = l + getInstructionSize(l)
            local n = getNameFromAddress(m)
            local o = getInstructionSize(m)
            local p = string.upper(byteTableToHexString(readBytes(m, o, true)))
            synchronize(function()
                local q = AddressList.createMemoryRecord()
                q.appendToEntry(k)
                q.setDescription("[$LUA/ASM] Sync This Clock to System date")
                q.setType(11)
                q.Script =
                    '[ENABLE]\n{$lua}\nlocal function a(b)if b%4==0 and b%100~=0 or b%400==0 then return true end;return false end;local function c(b,d,e)local f={31,28,31,30,31,30,31,31,30,31,30,31}local g=0;for h=0,b-1 do g=g+(a(h)and 366 or 365)end;for i=1,d-1 do if i==2 and a(b)then g=g+29 else g=g+f[i]end end;g=g+e-1;return g end;local j=os.date("*t")local k=c(j.year,j.month,j.day)\n writeInteger("' ..
                        getNameFromAddress(j) .. '",k)\n self.Active=false;\n{$asm}\n [DISABLE]\n'
                local r = AddressList.createMemoryRecord()
                r.appendToEntry(k)
                r.setDescription("[$ASM] Disable increase of Clockwork_" .. h)
                r.setType(11)
                r.Script = "[ENABLE]\n" .. n .. ":\nNOP " .. o .. "\n[DISABLE]\n" .. n .. ":\ndb " .. p
            end)
            local s, t;
            for i = 1, 10 do
                l = getPreviousOpcode(l)
                s = disassemble(getPreviousOpcode(l))
                if s:match("cmp ax") then
                    local u = getNameFromAddress(s:match("^(.-) %-"))
                    local v = s:match("%- (.-) %-"):gsub("(%w)(%s)", "%1"):gsub("(%w%w)", "%1 ")
                    local w = string.upper(byteTableToHexString(assemble("cmp ax,FFFF", u, nil, false)))
                    t = "[ENABLE]\n" .. u .. ":\n" .. "db " .. w .. "\n[DISABLE]\n" .. u .. ":\ndb " .. v;
                    synchronize(function()
                        local x = AddressList.createMemoryRecord()
                        x.appendToEntry(k)
                        x.setDescription("[$ASM] Increase day time of Clockwork_" .. h)
                        x.setType(11)
                        x.Script = t
                    end)
                    break
                end
            end
        else
            error()
        end
    end
end
end

local i = aOBScanModule(process, "8B 15 ?? ?? ?? ?? ?? ?? 89 15 ?? ?? ?? ?? 48 8D") -- visual only (for 15.2) OR (visual and real 14.x)
local u = aOBScanModule(process, "8B 15 ?? ?? ?? ?? ?? ?? 89 15 ?? ?? ?? ?? FF 05") -- real for 15.2
for y=0,u.Count-1 do i.add(u.String[y]) end
getClockWork(i)



{$asm}
[DISABLE]
{$lua}
synchronize(function()
while memrec.Child[0]do memrec.Child[i].delete()end
end)
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>222</ID>
      <Description>"[$LUA] Get Players [15.2]"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then
    return
end

local PlayersDataAddress
local PlayersDataPointer
local PlayersDataAssembly = aOBScanModuleUnique(process, "4C 8B 05 80 FF 8F 00 48 85 D2 74 14")
if not PlayersDataAssembly then error() else
PlayersDataAddress = disassemble(PlayersDataAssembly):match("%[(.-)%]")
registerSymbol("PlayersData",PlayersDataAddress)
PlayersDataPointer = readPointer(PlayersDataAddress)
end
if not PlayersDataPointer then error() end

local sabotageExceptPlayerScript = createStringlist();

local tempAddress = PlayersDataPointer
local tempAddressPointer = readPointer(tempAddress )
local tempOffset = 0;
local tempCount = 0;

local playerCashValueOffset
local playerCompanyNameOffset
local playerNameOffset

while readByte(tempAddressPointer) do

playerCashValueOffset = readInteger(tempAddressPointer + 0x0058) == 0 and 0x0090 or 0x0058
playerCompanyNameOffset = (not readByte(readPointer(tempAddressPointer + 0x0008))) and 0x0008 or 0x0070
playerNameOffset = 0x0030

synchronize(function()
    local k = AddressList.createMemoryRecord()
    k.setDescription("Player #" .. tempCount)
    k.setAddress("PlayersData")
    k.setType(12)
    k.appendToEntry(memrec)
    k.DontSave = true;
    k.OffsetCount = 2;
    k.Offset[0] = 0x0000;
    k.Offset[1] = tempOffset;
    local l = AddressList.createMemoryRecord()
    l.setDescription("^Credit Value")
    l.setAddress("PlayersData")
    l.setType(3)
    l.Parent = k;
    l.DontSave = true;
    l.ShowAsSigned = true;
    l.OffsetCount = 2;
    l.Offset[0] = playerCashValueOffset;
    l.Offset[1] = tempOffset;
    local m = AddressList.createMemoryRecord()
    m.setDescription("^Company name")
    m.setAddress("PlayersData")
    m.setType(6)
    m.String.size = 255;
    m.Parent = k;
    m.DontSave = true;
    m.OffsetCount = 2;
    m.Offset[0] = playerCompanyNameOffset;
    m.Offset[1] = tempOffset;
    local n = AddressList.createMemoryRecord()
    n.setDescription("^Player name")
    n.setAddress("PlayersData")
    n.setType(6)
    n.String.size = 32;
    n.Parent = k;
    n.DontSave = true;
    n.OffsetCount = 2;
    n.Offset[0] = playerNameOffset;
    n.Offset[1] = tempOffset;
end)


if tempCount ~= 0 then
    sabotageExceptPlayerScript.add('writeQword(getAddress(readPointer(readPointer("PlayersData")+' .. tempOffset .. '))+' .. playerCashValueOffset .. ',0xFFFFFFFFFFFFFFFF);')
else
    sabotageExceptPlayerScript.add('[ENABLE]')
    sabotageExceptPlayerScript.add('{$lua}')
end

tempOffset =  tempOffset + getPointerSize();
tempAddress = tempAddress + getPointerSize();
tempCount = tempCount + 1
tempAddressPointer = readPointer(tempAddress)
end

sabotageExceptPlayerScript.add('beep();self.Active=false;')
sabotageExceptPlayerScript.add('{$asm}')
sabotageExceptPlayerScript.add('[DISABLE]')

  synchronize(function()
      local a = AddressList.createMemoryRecord()
      a.setDescription("[$Lua] Sabotage everyone except Player#0")
      a.setType(11)
      a.Script = sabotageExceptPlayerScript.Text;
      a.appendToEntry(memrec)
  end)
{$asm}
[DISABLE]
{$lua}
synchronize(function()
while memrec.Child[0]do memrec.Child[i].delete()end
end)
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>333</ID>
      <Description>"[$LUA] Get Population data [15.2]"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then return end
local PopulationDataAddress
local PopulationDataPointer
local PopulationDataAssembly = aOBScanModuleUnique(process, "48 8B 05 ? ? ? 00 48 8B 0C D8 8B 41 0C 48 83 C4 ?0 5B C3")
if not PopulationDataAssembly then error() else
PopulationDataAddress = disassemble(PopulationDataAssembly):match("%[(.-)%]")
registerSymbol("PopulationData",PopulationDataAddress)
PopulationDataPointer = readPointer(PopulationDataAddress)
end
if not PopulationDataPointer then error() end


local exclusiveRightsScript = createStringList();
local outstandingRatingScript = createStringList();
local resetExclusiveRightsScriptPO = createStringList();
local disableResidentialGrothScript = createStringList();
local forceResidentialGrothScript = createStringList();

local residentialStringOffset = 0x0098;
local residentialCountOffset = 0x000C;

local tempAddress = PopulationDataPointer
local tempAddressPointer = readPointer(tempAddress )
local tempOffset = 0;
local tempCount = 0;

local resolvedResidentialString

while readByte(tempAddressPointer) do

resolvedResidentialString = readPointer(tempAddressPointer + residentialStringOffset) and readString(readPointer(tempAddressPointer + residentialStringOffset)) or readString(tempAddressPointer + residentialStringOffset)

synchronize(function()
    local l = AddressList.createMemoryRecord()
    l.setDescription(resolvedResidentialString)
    l.setAddress("PopulationData")
    l.setType(2)
    l.appendToEntry(memrec)
    l.DontSave = true;
    l.OffsetCount = 2;
    l.Offset[0] = residentialCountOffset;
    l.Offset[1] = tempOffset;
end)


-- keep writing new scripts.
exclusiveRightsScript.add('writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset ..'))+0xD0,0x03E800FF);writeInteger(getAddress(readPointer(readPointer("PopulationData")+' ..tempOffset .. '))+0xCC,0x0);')
outstandingRatingScript.add('writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset ..'))+0xD0,0x03E87400);;writeInteger(getAddress(readPointer(readPointer("PopulationData")+' ..tempOffset .. '))+0xCC,0x0);')
resetExclusiveRightsScriptPO.add('writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset ..'))+0xCC,0xFF000000);writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset .. '))+0xD0,0x01F40000);')
disableResidentialGrothScript.add('writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset ..'))+0xB8,0x0000);writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset .. '))+0xBC,0x00);')
forceResidentialGrothScript.add('writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset ..'))+0xB8,0x00FF);writeInteger(getAddress(readPointer(readPointer("PopulationData")+' .. tempOffset .. '))+0xBC,0x00);')


tempOffset =  tempOffset + getPointerSize();
tempAddress = tempAddress + getPointerSize();
tempCount = tempCount + 1
tempAddressPointer = readPointer(tempAddress)
end

-- create output scripts.
synchronize(function()
local a = AddressList.createMemoryRecord()
a.setDescription("[$Lua] Try set Outstanding+Exclusive rights");
a.setType(11)
a.appendToEntry(memrec)
a.DontSave = true;
a.Script = '[ENABLE]\n{$lua}\n' .. exclusiveRightsScript.Text .. '\n beep();self.Active=false;\n{$asm}\n[DISABLE]\n'

local b = AddressList.createMemoryRecord()
b.setDescription("[$Lua] Try set Outstanding rating");
b.setType(11)
b.appendToEntry(memrec)
b.DontSave = true;
b.Script = '[ENABLE]\n{$lua}\n' .. outstandingRatingScript.Text .. '\n beep();self.Active=false;\n{$asm}\n[DISABLE]\n'

local c = AddressList.createMemoryRecord()
c.setDescription("[$Lua] Try Reset Exclusive rights");
c.setType(11)
c.appendToEntry(memrec)
c.DontSave = true;
c.Script = '[ENABLE]\n{$lua}\n' .. resetExclusiveRightsScriptPO.Text .. '\n beep();self.Active=false;\n{$asm}\n[DISABLE]\n'

local d = AddressList.createMemoryRecord()
d.setDescription("[$ASM] Try Disable Exclusive rights reset");
d.setType(11)
d.appendToEntry(memrec)
d.DontSave = true;
d.Script = '[ENABLE]\naobscanmodule(MoveOn,openttd.exe,74 13 2C 01 41 88 87 D0 00 00 00)\nMoveOn:\ndb EB\n[DISABLE]\nMoveOn:\ndb 74'

local f = AddressList.createMemoryRecord()
f.setDescription("[$Lua] Try Disable City/Town Groth");
f.setType(11)
f.appendToEntry(memrec)
f.DontSave = true;
f.Script = '[ENABLE]\n{$lua}\n' .. disableResidentialGrothScript.Text .. '\n beep();self.Active=false;\n{$asm}\n[DISABLE]\n'

local g = AddressList.createMemoryRecord()
g.setDescription("[$Lua] Try Force Grow City/Town Population");
g.setType(11)
g.appendToEntry(memrec)
g.DontSave = true;
g.Script = '[ENABLE]\n{$lua}\n' .. forceResidentialGrothScript.Text .. '\n beep();self.Active=false;\n{$asm}\n[DISABLE]\n'

end)


{$asm}
[DISABLE]
{$lua}
synchronize(function()
while memrec.Child[0]do memrec.Child[i].delete()end
end)

</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>444</ID>
      <Description>"[$LUA] Get Transport data [15.2]"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then
    return
end
local a = aOBScanModuleUnique(process, "4C 8B 1D 05 CF 92 00") -- updated aob
if not a then
    return error()
end
local b = disassemble(a):match("%[(.-)%]")
registerSymbol("VehiclesData", b)
if getAddress("VehiclesData") and readInteger("VehiclesData") then
    local c = readPointer("VehiclesData")
    if not c then return error() end
    local d = readPointer(c)
    if not d then return error() end
    local e = 0;
    local f = readInteger(d + 0x0058)
    repeat
        local g = readInteger(d + 0x0058)
        if g then
            if g &gt; f + 1000 or g&lt;f then
                break
            else
                if readInteger(d + 0x00F4) ~= 0 then
                    synchronize(function()
                        local h = AddressList.createMemoryRecord()
                        h.setDescription("Vehicle #" .. g)
                        h.setAddress("VehiclesData")
                        h.setType(12)
                        h.appendToEntry(memrec)
                        h.DontSave = true;
                        h.OffsetCount = 2;
                        h.Options = [[moManualExpandCollapse,moHideChildren]]
                        h.Offset[0] = 0x0000;
                        h.Offset[1] = e;
                        local i = AddressList.createMemoryRecord()
                        i.setDescription("Value of #" .. g)
                        i.setAddress("VehiclesData")
                        i.setType(2)
                        i.appendToEntry(h)
                        i.ShowAsSigned = true;
                        i.DontSave = true;
                        i.OffsetCount = 2;
                        i.Offset[0] = 0x00A0;
                        i.Offset[1] = e;
                        local j = AddressList.createMemoryRecord()
                        j.setDescription("Last year profit of #" .. g)
                        j.setAddress("VehiclesData")
                        j.setType(2)
                        j.appendToEntry(h)
                        j.ShowAsSigned = true;
                        j.DontSave = true;
                        j.OffsetCount = 2;
                        j.Offset[0] = 0x0099;
                        j.Offset[1] = e;
                        local k = AddressList.createMemoryRecord()
                        k.setDescription("Current year profit of #" .. g)
                        k.setAddress("VehiclesData")
                        k.setType(2)
                        k.appendToEntry(h)
                        k.ShowAsSigned = true;
                        k.DontSave = true;
                        k.OffsetCount = 2;
                        k.Offset[0] = 0x0091;
                        k.Offset[1] = e;
                        local l = AddressList.createMemoryRecord()
                        l.setDescription("Build date of #" .. g)
                        l.setAddress("VehiclesData")
                        l.setType(2)
                        l.appendToEntry(h)
                        l.ShowAsSigned = true;
                        l.DontSave = true;
                        l.OffsetCount = 2;
                        l.Offset[0] = 0x00EC;
                        l.Offset[1] = e;
                        local m = AddressList.createMemoryRecord()
                        m.setDescription("Current age of #" .. g)
                        m.setAddress("VehiclesData")
                        m.setType(2)
                        m.appendToEntry(h)
                        m.ShowAsSigned = true;
                        m.DontSave = true;
                        m.OffsetCount = 2;
                        m.Offset[0] = 0x00F0;
                        m.Offset[1] = e;
                        local n = AddressList.createMemoryRecord()
                        n.setDescription("Retirement age of #" .. g)
                        n.setAddress("VehiclesData")
                        n.setType(2)
                        n.appendToEntry(h)
                        n.ShowAsSigned = true;
                        n.DontSave = true;
                        n.OffsetCount = 2;
                        n.Offset[0] = 0x00F8;
                        n.Offset[1] = e;
                        local o = AddressList.createMemoryRecord()
                        o.setDescription("Reliability of #" .. g)
                        o.setAddress("VehiclesData")
                        o.setType(1)
                        o.appendToEntry(h)
                        o.DontSave = true;
                        o.OffsetCount = 2;
                        o.Offset[0] = 0x0104;
                        o.Offset[1] = e
                    end)
                end
                f = g
            end
        end
        c = c + 8;
        e = e + 8;
        d = readPointer(c)
    until false
end

{$asm}
[DISABLE]
{$lua}
synchronize(function()
while memrec.Child[0]do memrec.Child[i].delete()end
end)
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>17944</ID>
      <Description>"[$LUA] Get World Industry Buildings [15.2]"</Description>
      <Options moHideChildren="1"/>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then
    return
end

local IndustryDataAddress
local IndustryDataPointer
local IndustryDataAssembly = aOBScanModuleUnique(process, "48 8B ?? ?? ?? ?? 00 4A 8B ?? ?? 4C 8? ?? ?? ?? ?? ?? ?? E8")
if not IndustryDataAssembly then error() else
IndustryDataAddress = disassemble(IndustryDataAssembly):match("%[(.-)%]")
registerSymbol("IndustryData",IndustryDataAddress)
IndustryDataPointer = readPointer(IndustryDataAddress)
end
if not IndustryDataPointer then error() end

-- more fixated approach
local IndustryCountAddress
local IndustryCountAssembly = aOBScanModuleUnique(process, "48 8B 05 91 B9 84 00")
if not IndustryCountAssembly then error() else
IndustryCountAddress = disassemble(IndustryCountAssembly):match("%[(.-)%]")
registerSymbol("IndustryDataCount",IndustryCountAddress)
end
if not IndustryCountAddress then error() end

local closureAllIndustryScript = createStringList();

local industryStringOffset = 0x0078;
local industryClosureOffset = 0x0058;

local tempAddress = IndustryDataPointer
local tempAddressPointer = readPointer(tempAddress )
local tempOffset = 0;
local tempCount = 0;

local industryIndex
local industryString

local count = readInteger(IndustryCountAddress)

for x = 0,count do
if readByte(tempAddressPointer) then

industryIndex = readByte(tempAddressPointer)
industryString = readPointer(tempAddressPointer+industryStringOffset) and readString(readPointer(tempAddressPointer+industryStringOffset),255) or "undiscovered"

                synchronize(function()
                    local i = AddressList.createMemoryRecord()
                    i.setDescription(industryString.." Industry field #" .. industryIndex)
                    i.setAddress("IndustryData")
                    i.setType(0)
                    i.appendToEntry(memrec)
                    i.DontSave = true;
                    i.Options = [[moManualExpandCollapse]]
                    i.OffsetCount = 2;
                    i.Offset[0] = industryClosureOffset;
                    i.Offset[1] = tempOffset;
                    i.DropDownList.Text = [[
0:[ CLOSE ]
16:[ ACTIVE ]
]]
                    i.DropDownDescriptionOnly = true;
                    i.DisplayAsDropDownListItem = true;
                    i.DropDownReadOnly = true
                end)

closureAllIndustryScript.add('writeInteger(getAddress(readPointer(readPointer("IndustryData")+' .. tempOffset ..'))+'.. industryClosureOffset ..',0x00);')



tempOffset =  tempOffset + getPointerSize();
tempAddress = tempAddress + getPointerSize();
tempCount = tempCount + 1
tempAddressPointer = readPointer(tempAddress)




end
end


synchronize(function()
local a = AddressList.createMemoryRecord()
a.setDescription("[$Lua] Try close all Industry at once");
a.setType(11)
a.appendToEntry(memrec)
a.DontSave = true;
a.Script = '[ENABLE]\n{$lua}\n' .. closureAllIndustryScript.Text .. '\n beep();memrec.Active=false;\n{$asm}\n[DISABLE]\n'
end)


{$asm}
[DISABLE]
{$lua}
synchronize(function()
while memrec.Child[0]do memrec.Child[i].delete()end
end)
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>445</ID>
      <Description>"[$LUA] Get Placed Buildings [15.2]"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
if syntaxcheck then
    return
end

local PlacedBuildingsAddress
local PlacedBuildingsPointer
local PlacedBuildingsAssembly = aOBScanModuleUnique(process, "48 8B 15 04 59 58 00")
if not PlacedBuildingsAssembly then error() else
PlacedBuildingsAddress = disassemble(PlacedBuildingsAssembly):match("%[(.-)%]")
registerSymbol("PlacedBuildingsData",PlacedBuildingsAddress)
PlacedBuildingsPointer = readPointer(PlacedBuildingsAddress)
end
if not PlacedBuildingsPointer then error() end

local placedBuildingStringOffset = 0x0050;
local placedBuildingStringOffsetFallback = 0x0028;
local placedBuildingStringOffsetFallbackPointer = 0x0070;
local placedBuildingStringOffsetFallbackPointerOffset = 0x0098;

local tempAddress = PlacedBuildingsPointer
local tempAddressPointer = readPointer(tempAddress )
local tempOffset = 0;
local tempCount = 0;

local resolvedPlacedBuildingString

while readByte(tempAddressPointer) do
resolvedPlacedBuildingString = (readPointer(tempAddressPointer + placedBuildingStringOffset)) and readString(readPointer(tempAddressPointer + placedBuildingStringOffset),255) or readByte(tempAddressPointer + placedBuildingStringOffsetFallback)~=0 and readString(tempAddressPointer + placedBuildingStringOffsetFallback,255) or readByte(tempAddressPointer + placedBuildingStringOffset)==0 and readByte(tempAddressPointer + placedBuildingStringOffsetFallback)==0 and readPointer(tempAddressPointer + placedBuildingStringOffsetFallbackPointer) and readString(readPointer(tempAddressPointer + placedBuildingStringOffsetFallbackPointer)+placedBuildingStringOffsetFallbackPointerOffset) or readString(tempAddressPointer + placedBuildingStringOffset,255)

synchronize(function()
    local i = AddressList.createMemoryRecord()
    i.setDescription(resolvedPlacedBuildingString .. " Building #" .. tempCount)
    i.setAddress("PlacedBuildingsData")
    i.setType(12)
    i.appendToEntry(memrec)
    i.DontSave = true;
    i.OffsetCount = 2;
    i.Options = [[moManualExpandCollapse]]
    i.Offset[0] = 0x0000;
    i.Offset[1] = tempOffset;
end)

tempOffset =  tempOffset + getPointerSize();
tempAddress = tempAddress + getPointerSize();
tempCount = tempCount + 1
tempAddressPointer = readPointer(tempAddress)

end
{$asm}
[DISABLE]
{$lua}
synchronize(function()
while memrec.Child[0]do memrec.Child[i].delete()end
end)
</AssemblerScript>
    </CheatEntry>
    <CheatEntry>
      <ID>107</ID>
      <Description>"[$LUA] Quick Test AOB"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript Async="1">[ENABLE]
{$lua}
for i = 0, synchronize(function() return AddressList.Count end) - 2 do

    if synchronize(function() return AddressList.MemoryRecord[i].Script end) then
        if not readByte(process) then return end
        print(synchronize(function() return AddressList.MemoryRecord[i].Description end))
        for line in synchronize(function() return AddressList.MemoryRecord[i].Script end):gmatch("[^\r\n]+") do
            -- for more celua "squashed" code use for word.
            if line:find("aOBScanModuleUnique") then
                local luacall = line:match('aOBScanModuleUnique%b()') -- okay its lua, test aob right now.
                if luacall then
                  print(luacall)
                  local result, er = load("return " .. luacall) -- try load code
                  if er then
                      print(er)
                  else
                    local ok, result = pcall(result) -- test it trough safe environment.
                    -- if aob is in variable or table make sure then to test aob - manually
                    print(((not ok) and "Error: "..result) or result and "OK!" or "FAIL")
                  end
                end
            elseif line:find("aobscanmodule") then
                local target, arrayofbytes = line:match('aobscanmodule%([^,]+,([^,]+),"?([^"]-)"?%)')
                if target and target:find("$process") then target = process end -- meh.
                if target then
                  print(target,arrayofbytes)
                  local r = aOBScanModuleUnique(target,arrayofbytes) -- test it trough lua instead.
                  -- if aob is in define make sure to test aob - manually
                  print(r and "OK!" or "FAIL")
                end
            end
        end
        print("-----oOo-----")
    end

end
{$asm}
[DISABLE]
</AssemblerScript>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
  <Comments>v15.2
Lights &amp; Motion - Sypher
https://youtu.be/pCZ2cvYAr5I?si=2pEMuuqEja7vHCpE
</Comments>
</CheatTable>
