User File #37141778941291944

Upload All User Files

#37141778941291944 - metalslugX hp display

msx_hp.lua
997 downloads
Uploaded 2/19/2017 4:09 PM by mtvf1 (see all 20)
metalslugX simple HP display.
local addrss=0x0010165C
local flag={}
local hp={}
local x={}
local y={}
for i=0,100 do
	flag[i]=addrss+0xB0*i
	hp[i]=addrss+0xB0*i+22
	x[i]=addrss+0xB0*i+4
	y[i]=addrss+0xB0*i+8
end

local function displayfunc()
	j=0
	for i=0,100 do
		if (memory.readshort(flag[i])==16 and memory.readshort(hp[i])<=21000 and memory.readshort(hp[i])>0) then
			j=j+8
			
			if j<=100 then
				gui.text(32,j+32,"" .. memory.readshort(hp[i]),"red")
				gui.text(0,j+32,string.format("%X",hp[i]))
			else
				gui.text(96,j+32-168,"" .. memory.readshort(hp[i]),"red")
				gui.text(64,j+32-168,string.format("%X",hp[i]))
			end
						
		end
	end
	
	gui.text(0,208,"1PX:" .. memory.readshort(0x001014ec))
	gui.text(0,216,"1pdx:" .. memory.readshort(0x00101500))
	gui.text(40,208,"1PY:" .. memory.readshort(0x001014f0))
	gui.text(40,216,"1pdy:" .. memory.readshort(0x00101504))
	gui.text(228,208,"2PX:" .. memory.readshort(0x0010159c))
	gui.text(228,216,"2pdx:" .. memory.readshort(0x001015b0))
	gui.text(268,208,"2PY:" .. memory.readshort(0x001015a0))
	gui.text(268,216,"2pdy:" .. memory.readshort(0x001015b4))

end

gui.register(function()
	displayfunc()
end)