-- The Adventures of Batman and Robin
-- 2013, feos and r57shell
function EnemyPos(Base)
x1 = memory.readwordsigned(Base+0x12)-xcam
y1 = memory.readwordsigned(Base+0x14)
x2 = memory.readwordsigned(Base+0x16)-xcam
y2 = memory.readwordsigned(Base+0x18)
hp = memory.readwordsigned(Base+0x1E)
end
function PlayerPos()
sbase1 = memory.readword(0xFFAD5C)+0xFF0000
sbase2 = memory.readword(0xFFADB6)+0xFF0000
p1speedx = memory.readlongsigned(sbase1+0x18)
p1speedy = memory.readlongsigned(sbase1+0x1C)
p2speedx = memory.readlongsigned(sbase2+0x18)
p2speedy = memory.readlongsigned(sbase2+0x1C)
p1accelx = memory.readlong(sbase1+0x20)
p1accely = memory.readlong(sbase1+0x28)
p2accelx = memory.readlong(sbase2+0x20)
p2accely = memory.readlong(sbase2+0x28)
end
gui.register(function ()
xcam = memory.readwordunsigned(0xFFDFC4)
ycam = memory.readwordunsigned(0xFFCD70)
X1 = memory.readword(0xFFAD92)-xcam
Y1 = memory.readword(0xFFAD96)
X2 = memory.readword(0xFFADEC)-xcam
Y2 = memory.readword(0xFFADF0)
Xpos1 = memory.readword(0xFFAD92)
Xpossub1 = memory.readbyteunsigned(0xFFAD94)
Xpos2 = memory.readword(0xFFADEC)
Xpossub2 = memory.readbyteunsigned(0xFFADEE)
PlayerPos()
base = memory.readword(0xFFDEB2)
i = 0
while (base~=0) do
base = base+0xFF0000
if (memory.readword(base+2) == 0) then
break
end
EnemyPos(base)
gui.box(x1,y1,x2,y2,"#00ff0000")
base = memory.readword(base+2)
i = i+1;
if (i>400) then
break;
end
end
base = memory.readword(0xFFDEBA)
i = 0
while (base ~= 0) do
base = base+0xFF0000
if (memory.readword(base+2) == 0) then
break
end
EnemyPos(base)
gui.box(x1,y1,x2,y2,"#00ffff00")
gui.text(x1+2,y1+1,hp,"#ff00ff")
if (x2< 0) then gui.text(x1+2,y2-7,"x:"..x1 ) end
if (x1>=320) then gui.text(x1+2,y2-7,"x:"..x1-320) end
if (y2< 0) then gui.text(x2+2,y2-7,"y:"..y2 ) end
base = memory.readword(base+2)
i = i+1;
if (i>400) then
break;
end
end
gui.text(X1,Y1,string.format("%.3f\n%.3f",p1speedx/0x10000,p1speedy/0x10000,X1))
gui.text(X2,Y2,string.format("%.3f\n%.3f",p2speedx/0x10000,p2speedy/0x10000))
gui.text(130,10,"X1: " .. Xpos1 .. ":" .. Xpossub1, "grey")
gui.text(130,20,"X2: " .. Xpos2 .. ":" .. Xpossub2, "green")
end)