Language: lua
local function playerinfo(color,player,y)
memory = 0x010828 + 0x100 * (player-1)
gui.drawText(335,290 + y, color ,"red", "black", 16)
gui.drawText(345,310 + y, memory.read_s16_le(memory,"WRAM"),"white","black",16)
gui.drawText(430,310 + y, memory.read_s16_le(0x010880,"WRAM"),"white","black",16)
gui.drawText(520,310 + y, memory.read_s16_le(0x010860,"WRAM"),"white","black",16) --Find a way to align the text to the right
end
So I'm creating this function. As you can see, I'm currently working on it so I can reuse the same function for different players. I've noticed the different players has only an offset between some importants infos.
So far I've encountered a couple of problem:
1- I need to be able to do operations in hexademical.However, I'm not sure to know how to do it.
I made an attempt with the 2nd line of the quoted code. But the lua console give me thisL
LuaInterface.LuaScriptException: [string "main"]:124: attempt to index global 'memory' (a number value)
2-I'd like also to align the text of the fouth drawtext to the left. I've tried with
horizalign = 'right',
horizalign= "right"
"right"
None of them worked. So I'm stumped.
Any help would be appreciated!