User File #638383917777397496

Upload All User Files

#638383917777397496 (unlisted) - icecreamcastle position and speed

icecreamcastle.lua
20 downloads
Uploaded 12/17/2023 6:36 AM by CasualPokePlayer (see all 9)
icecreamcastle position and speed
local function get_x()
	return memory.readbyte(0x0008, "WRAM") + (memory.readbyte(0x0009, "WRAM") / 0x100)
end

local function get_y()
	return memory.readbyte(0x000A, "WRAM") + (memory.readbyte(0x000B, "WRAM") / 0x100)
end

local last_x = get_x()
local last_y = get_y()

client.SetClientExtraPadding(0, 0, 200, 0)

while true do
	local x = get_x()
	local y = get_y()
	gui.text(5, 5, string.format("X: %f", x), nil, "topright")
	gui.text(5, 25, string.format("X Speed: %f", x - last_x), nil, "topright")
	gui.text(5, 50, string.format("Y: %f", y), nil, "topright")
	gui.text(5, 75, string.format("Y Speed: %f", y - last_y), nil, "topright")
	last_x = x
	last_y = y

	emu.frameadvance()
end