All pastes #1733426 Raw Edit

Phantasy Star IV Improved Party

public lua v1 · immutable
#1733426 ·published 2009-12-31 21:10 UTC
rendered paste body
-- Phantasy Star IV - Improved party stat display-- Written by: FreshFeelingif not gens.emulating() then	print("ROM must be loaded first.")	returnend-- Intention left the checksum out because (1) I suck and (2) there are a lot of different-- compatible dumps with the recent release of the semi-localized prototypes.-- RAM locations-- In-battleinbattle_off  = 0xff50ef -- this is no longer used - used to test whether in a battle or not, but it didn't work well-- Character positions -- actual positions of the characters in battlepos1_off      = 0xfff40apos2_off      = 0xfff40bpos3_off      = 0xfff40cpos4_off      = 0xfff40dpos5_off      = 0xfff40e-- Character offsets -- all data is associated with the character, positions are only used for drawing the data onscreenchaz_off      = 0xfff500alys_off      = 0xfff580hahn_off      = 0xfff600rune_off      = 0xfff680gryz_off      = 0xfff700rika_off      = 0xfff780demi_off      = 0xfff800wren_off      = 0xfff880raja_off      = 0xfff900kyra_off      = 0xfff980seth_off      = 0xfffa00-- Character data offsetslevel_off     = 0x08 -- wordexp_off       = 0x0a -- longhpcur_off     = 0x0e -- wordhpmax_off     = 0x10 -- wordtpcur_off     = 0x12 -- wordtpmax_off     = 0x14 -- wordstrch_off     = 0x18 -- bytestreq_off     = 0x19 -- bytestrib_off     = 0x1a -- bytemtlch_off     = 0x1b -- bytemtleq_off     = 0x1c -- bytemtlib_off     = 0x1d -- byteagich_off     = 0x1e -- byteagieq_off     = 0x1f -- byteagiib_off     = 0x20 -- bytedexch_off     = 0x21 -- bytedexeq_off     = 0x22 -- bytedexib_off     = 0x23 -- byteatkeq_off     = 0x24 -- wordatkib_off     = 0x26 -- worddefeq_off     = 0x28 -- worddefib_off     = 0x2a -- wordmdfeq_off     = 0x2c -- wordmdfib_off     = 0x2e -- word-- Action offsets -- these SORT of work... just not with macrospos1act_off   = 0xff41a3pos2act_off   = 0xff41a5pos3act_off   = 0xff41a7pos4act_off   = 0xff41a9pos5act_off   = 0xff41ab-- Variablescurpos1_off = 0xfff500curpos1name = "Alys"curpos2_off = 0xfff500curpos2name = "Chaz"curpos3_off = 0xfff500curpos3name = "Hahn"curpos4_off = 0xfff500curpos4name = "Rune"curpos5_off = 0xfff500curpos5name = "Rika"-- Main stuffzwhile gens.emulating() do    -- use capslock to display the new GUI    if input.get().capslock then	  gui.transparency(0) -- looks pretty cool with transparency(1) too	else	  gui.transparency(10)	end 		gens.frameadvance()	-- a the large chunk below draws boxes that nicely match the ones used by the game    gui.drawline(16,168,303,168,"#00006b")	gui.drawline(17,169,302,169,"#6b6d6b")    gui.drawline(18,170,301,170,"#b5b6b5")	gui.drawline(20,171,299,171,"#6b6d6b")	gui.drawline(16,168,16,255,"#00006b")	gui.drawline(17,170,17,255,"#6b6d6b")	gui.drawbox(18,171,19, 255,"#b5b6b5")	gui.drawline(20,172,20,255,"#6b6d6b")	gui.drawbox(21,172,73, 192,"#00006b") --to leave default action icon, x2 is 55 instead of 73	gui.drawbox(21,192,73, 255,"#00006b")	gui.drawline(74,172,74,255,"#6b6d6b")	gui.drawbox(75,171,76, 255,"#b5b6b5")	gui.drawline(77,172,77,255,"#6b6d6b")	gui.drawbox(78,172,129, 192,"#00006b") --to leave default action icon, x2 is 111 instead of 129	gui.drawbox(78,192,129, 255,"#00006b")	gui.drawline(130,172,130,255,"#6b6d6b")	gui.drawbox(131,171,132, 255,"#b5b6b5")	gui.drawline(133,172,133,255,"#6b6d6b")	gui.drawbox(134,172,185, 192,"#00006b") --to leave default action icon, x2 is 167 instead of 185	gui.drawbox(134,192,185, 255,"#00006b")	gui.drawline(186,172,186,255,"#6b6d6b")	gui.drawbox(187,171,188, 255,"#b5b6b5")	gui.drawline(189,172,189,255,"#6b6d6b")	gui.drawbox(190,172,241, 192,"#00006b") --to leave default action icon, x2 is 223 instead of 241	gui.drawbox(190,192,241, 255,"#00006b")	gui.drawline(242,172,242,255,"#6b6d6b")	gui.drawbox(243,171,244, 255,"#b5b6b5")	gui.drawline(245,172,245,255,"#6b6d6b")	gui.drawbox(246,172,298, 192,"#00006b") --to leave default action icon, x2 is 279 instead of 298	gui.drawbox(246,192,298, 255,"#00006b")	gui.drawline(299,172,299,255,"#6b6d6b")	gui.drawbox(300,171,301, 255,"#b5b6b5")	gui.drawline(302,170,302,255,"#6b6d6b")	gui.drawline(303,168,303,255,"#00006b")	-- this whole section below checks which character is in position 1 (ie. the middle, or the march leader)	-- it also associates their name with the position for fun	if memory.readbyte(pos1_off) == 0 then	  curpos1_off = chaz_off	  curpos1name = "Chaz"    end	if memory.readbyte(pos1_off) == 1 then	  curpos1_off = alys_off	curpos1name = "Alys"    end	if memory.readbyte(pos1_off) == 2 then	  curpos1_off = hahn_off	  curpos1name = "Hahn"	end	if memory.readbyte(pos1_off) == 3 then	  curpos1_off = rune_off	  curpos1name = "Rune"	end	if memory.readbyte(pos1_off) == 4 then	  curpos1_off = gryz_off	  curpos1name = "Gryz"    end	if memory.readbyte(pos1_off) == 5 then	  curpos1_off = rika_off	  curpos1name = "Rika"	end	if memory.readbyte(pos1_off) == 6 then	  curpos1_off = demi_off	  curpos1name = "Demi"    end	if memory.readbyte(pos1_off) == 7 then	  curpos1_off = wren_off	  curpos1name = "Wren"	end	if memory.readbyte(pos1_off) == 8 then	  curpos1_off = raja_off	  curpos1name = "Raja"	end	if memory.readbyte(pos1_off) == 9 then	  curpos1_off = kyra_off	  curpos1name = "Kyra"	end	if memory.readbyte(pos1_off) == 10 then	  curpos1_off = seth_off	  curpos1name = "Seth"	end    if memory.readbyte(pos1_off) > 10 then	  curpos1_off = 0	  curpos1name = ""	end	-- this whole section below checks which character is in position 2 (ie. second from the left)	-- it also associates their name with the position for fun		if memory.readbyte(pos2_off) == 0 then	  curpos2_off = chaz_off	  curpos2name = "Chaz"    end	if memory.readbyte(pos2_off) == 1 then	  curpos2_off = alys_off	  curpos2name = "Alys"	end	if memory.readbyte(pos2_off) == 2 then	  curpos2_off = hahn_off	  curpos2name = "Hahn"	end	if memory.readbyte(pos2_off) == 3 then	  curpos2_off = rune_off	  curpos2name = "Rune"	end	if memory.readbyte(pos2_off) == 4 then	  curpos2_off = gryz_off	  curpos2name = "Gryz"	end	if memory.readbyte(pos2_off) == 5 then	  curpos2_off = rika_off	  curpos2name = "Rika"	end	if memory.readbyte(pos2_off) == 6 then	  curpos2_off = demi_off	  curpos2name = "Demi"	end	if memory.readbyte(pos2_off) == 7 then	  curpos2_off = wren_off	  curpos2name = "Wren"	end	if memory.readbyte(pos2_off) == 8 then	  curpos2_off = raja_off	  curpos2name = "Raja"	end	if memory.readbyte(pos2_off) == 9 then	  curpos2_off = kyra_off	  curpos2name = "Kyra" 	end	if memory.readbyte(pos2_off) == 10 then	  curpos2_off = seth_off	  curpos2name = "Seth"	end    if memory.readbyte(pos2_off) > 10 then	  curpos2_off = 0	  curpos2name = ""	end	-- this whole section below checks which character is in position 3 (ie. second from the right)	-- it also associates their name with the position for fun	    if memory.readbyte(pos3_off) == 0 then	  curpos3_off = chaz_off	  curpos3name = "Chaz"    end	if memory.readbyte(pos3_off) == 1 then	  curpos3_off = alys_off	  curpos3name = "Alys"	end	if memory.readbyte(pos3_off) == 2 then	  curpos3_off = hahn_off	  curpos3name = "Hahn"	end	if memory.readbyte(pos3_off) == 3 then	  curpos3_off = rune_off	  curpos3name = "Rune"	end	if memory.readbyte(pos3_off) == 4 then	  curpos3_off = gryz_off	  curpos3name = "Gryz"	end	if memory.readbyte(pos3_off) == 5 then	  curpos3_off = rika_off	  curpos3name = "Rika"	end	if memory.readbyte(pos3_off) == 6 then	  curpos3_off = demi_off	  curpos3name = "Demi"	end	if memory.readbyte(pos3_off) == 7 then	  curpos3_off = wren_off	  curpos3name = "Wren"	end	if memory.readbyte(pos3_off) == 8 then	  curpos3_off = raja_off	  curpos3name = "Raja"	end	if memory.readbyte(pos3_off) == 9 then	  curpos3_off = kyra_off	  curpos3name = "Kyra"	end	if memory.readbyte(pos3_off) == 10 then	  curpos3_off = seth_off	  curpos3name = "Seth"	end    if memory.readbyte(pos3_off) > 10 then	  curpos3_off = 0	  curpos3name = ""	end	-- this whole section below checks which character is in position 4 (ie. the leftmost in combat)	-- it also associates their name with the position for fun		if memory.readbyte(pos4_off) == 0 then	  curpos4_off = chaz_off	  curpos4name = "Chaz"    end	if memory.readbyte(pos4_off) == 1 then	  curpos4_off = alys_off	  curpos4name = "Alys"	end	if memory.readbyte(pos4_off) == 2 then	  curpos4_off = hahn_off	  curpos4name = "Hahn"	end	if memory.readbyte(pos4_off) == 3 then	  curpos4_off = rune_off	  curpos4name = "Rune"	end	if memory.readbyte(pos4_off) == 4 then	  curpos4_off = gryz_off	  curpos4name = "Gryz"	end	if memory.readbyte(pos4_off) == 5 then	  curpos4_off = rika_off	  curpos4name = "Rika"	end	if memory.readbyte(pos4_off) == 6 then	  curpos4_off = demi_off	  curpos4name = "Demi"	end	if memory.readbyte(pos4_off) == 7 then	  curpos4_off = wren_off	  curpos4name = "Wren"	end	if memory.readbyte(pos4_off) == 8 then	  curpos4_off = raja_off	  curpos4name = "Raja"	end	if memory.readbyte(pos4_off) == 9 then	  curpos4_off = kyra_off	  curpos4name = "Kyra"	end	if memory.readbyte(pos4_off) == 10 then	  curpos4_off = seth_off	  curpos4name = "Seth"	end    if memory.readbyte(pos4_off) > 10 then	  curpos4_off = 0	  curpos4name = ""	end	-- this whole section below checks which character is in position 5 (ie. rightmost in combat)	-- it also associates their name with the position for fun	if memory.readbyte(pos5_off) == 0 then	  curpos5_off = chaz_off	  curpos5name = "Chaz"    end	if memory.readbyte(pos5_off) == 1 then	  curpos5_off = alys_off	  curpos5name = "Alys"	end	if memory.readbyte(pos5_off) == 2 then	  curpos5_off = hahn_off	  curpos5name = "Hahn"	end	if memory.readbyte(pos5_off) == 3 then	  curpos5_off = rune_off	  curpos5name = "Rune"	end	if memory.readbyte(pos5_off) == 4 then	  curpos5_off = gryz_off	  curpos5name = "Gryz"	end	if memory.readbyte(pos5_off) == 5 then	  curpos5_off = rika_off	  curpos5name = "Rika"	end	if memory.readbyte(pos5_off) == 6 then	  curpos5_off = demi_off	  curpos5name = "Demi"	end	if memory.readbyte(pos5_off) == 7 then	  curpos5_off = wren_off	  curpos5name = "Wren"	end	if memory.readbyte(pos5_off) == 8 then	  curpos5_off = raja_off	  curpos5name = "Raja"	end	if memory.readbyte(pos5_off) == 9 then	  curpos5_off = kyra_off	  curpos5name = "Kyra"	end	if memory.readbyte(pos5_off) == 10 then	  curpos5_off = seth_off	  curpos5name = "Seth"	end	if memory.readbyte(pos5_off) > 10 then	  curpos5_off = 0	  curpos5name = ""	end	-- if position 4 (leftmost) isn't blank, draw some stats    if curpos4_off ~= 0 then	  	  gui.text(40,162,curpos4name,"white","#00006b")	  --gui.text(22, 172,"Lv:","white","#00006b")	  --gui.text(34, 172,memory.readword(curpos4_off + level_off),"white","#00006b")	  	  --gui.text(22, 178,"Ex:","white","#00006b")	  --gui.text(34, 178,memory.readlong(curpos4_off + exp_off),"white","#00006b")	  	  gui.text(22, 172,"HP:","white","#00006b")	  gui.text(34, 172,memory.readword(curpos4_off + hpcur_off),"red","#00006b")	  gui.text(46, 172,"/","white","#00006b")	  gui.text(50, 172,memory.readword(curpos4_off + hpmax_off),"white","#00006b")	  	  -- This section attempts show what the character is doing on their turn,	  -- like the action icon used in the game.	  -- Unfortunately this doesn't work well for macros.	  if memory.readbyte(pos4act_off) == 0 then	  gui.text(66, 172,"At","red","black")	  end	  if memory.readbyte(pos4act_off) == 1 then	  gui.text(66, 172,"Tc","red","black")	  end	  if memory.readbyte(pos4act_off) == 2 then	  gui.text(66, 172,"Sk","red","black")	  end	  if memory.readbyte(pos4act_off) == 3 then	  gui.text(66, 172,"It","red","black")	  end	  if memory.readbyte(pos4act_off) == 4 then	  gui.text(66, 172,"Df","red","black")	  end	  	  gui.text(22, 178,"TP:","white","#00006b")	  gui.text(34, 178,memory.readword(curpos4_off + tpcur_off),"red","#00006b")	  gui.text(46, 178,"/","white","#00006b")	  gui.text(50, 178,memory.readword(curpos4_off + tpmax_off),"white","#00006b")	  	  gui.text(22, 184,"At:","white","#00006b")	  gui.text(34, 184,memory.readword(curpos4_off + atkib_off),"red","#00006b")	  gui.text(46, 184,"/","white","#00006b")	  gui.text(50, 184,memory.readword(curpos4_off + atkeq_off),"white","#00006b")	  	  gui.text(22, 190,"Df:","white","#00006b")	  gui.text(34, 190,memory.readword(curpos4_off + defib_off),"red","#00006b")	  gui.text(46, 190,"/","white","#00006b")	  gui.text(50, 190,memory.readword(curpos4_off + defeq_off),"white","#00006b")	  	  gui.text(22, 196,"MD:","white","#00006b")	  gui.text(34, 196,memory.readword(curpos4_off + mdfib_off),"red","#00006b")	  gui.text(46, 196,"/","white","#00006b")	  gui.text(50, 196,memory.readword(curpos4_off + mdfeq_off),"white","#00006b")	  	  gui.text(22, 202,"St:","white","#00006b")	  gui.text(34, 202,memory.readbyte(curpos4_off + strib_off),"red","#00006b")	  gui.text(46, 202,"/","white","#00006b")	  gui.text(50, 202,memory.readbyte(curpos4_off + streq_off),"white","#00006b")	  gui.text(62, 202,"/","white","#00006b")	  gui.text(66, 202,memory.readbyte(curpos4_off + strch_off),"grey","#00006b")	  	  gui.text(22, 208,"Mn:","white","#00006b")	  gui.text(34, 208,memory.readbyte(curpos4_off + mtlib_off),"red","#00006b")	  gui.text(46, 208,"/","white","#00006b")	  gui.text(50, 208,memory.readbyte(curpos4_off + mtleq_off),"white","#00006b")	  gui.text(62, 208,"/","white","#00006b")	  gui.text(66, 208,memory.readbyte(curpos4_off + mtlch_off),"grey","#00006b")	  	  gui.text(22, 214,"Ag:","white","#00006b")	  gui.text(34, 214,memory.readbyte(curpos4_off + agiib_off),"red","#00006b")	  gui.text(46, 214,"/","white","#00006b")	  gui.text(50, 214,memory.readbyte(curpos4_off + agieq_off),"white","#00006b")	  gui.text(62, 214,"/","white","#00006b")	  gui.text(66, 214,memory.readbyte(curpos4_off + agich_off),"grey","#00006b")	  	  --gui.text(22, 220,"Dx:","white","#00006b")	  --gui.text(34, 220,memory.readbyte(curpos4_off + dexib_off),"red","#00006b")	  --gui.text(46, 220,"/","white","#00006b")	  --gui.text(50, 220,memory.readbyte(curpos4_off + dexeq_off),"white","#00006b")	  --gui.text(62, 220,"/","white","#00006b")	  --gui.text(66, 220,memory.readbyte(curpos4_off + dexch_off),"grey","#00006b")	  	  	end		-- if position 2 isn't blank, draw some stats    if curpos2_off ~= 0 then		-- note that I was extremely lazy about doing math from here on out	gui.text(40+57,162,curpos2name,"white","#00006b")	  	  --gui.text(22+57, 172,"Lv:","white","#00006b")	  --gui.text(34+57, 172,memory.readword(curpos2_off + level_off),"white","#00006b")	  	  --gui.text(22+57, 178,"Ex:","white","#00006b")	  --gui.text(34+57, 178,memory.readlong(curpos2_off + exp_off),"white","#00006b")	  	  gui.text(22+57, 172,"HP:","white","#00006b")	  gui.text(34+57, 172,memory.readword(curpos2_off + hpcur_off),"red","#00006b")	  gui.text(46+57, 172,"/","white","#00006b")	  gui.text(50+57, 172,memory.readword(curpos2_off + hpmax_off),"white","#00006b")	  	  -- This section attempts show what the character is doing on their turn,	  -- like the action icon used in the game.	  -- Unfortunately this doesn't work well for macros.	  if memory.readbyte(pos2act_off) == 0 then	  gui.text(66+56, 172,"At","red","black")	  end	  if memory.readbyte(pos2act_off) == 1 then	  gui.text(66+56, 172,"Tc","red","black")	  end	  if memory.readbyte(pos2act_off) == 2 then	  gui.text(66+56, 172,"Sk","red","black")	  end	  if memory.readbyte(pos2act_off) == 3 then	  gui.text(66+56, 172,"It","red","black")	  end	  if memory.readbyte(pos2act_off) == 4 then	  gui.text(66+56, 172,"Df","red","black")	  end	  	  gui.text(22+57, 178,"TP:","white","#00006b")	  gui.text(34+57, 178,memory.readword(curpos2_off + tpcur_off),"red","#00006b")	  gui.text(46+57, 178,"/","white","#00006b")	  gui.text(50+57, 178,memory.readword(curpos2_off + tpmax_off),"white","#00006b")	  	  gui.text(22+57, 184,"At:","white","#00006b")	  gui.text(34+57, 184,memory.readword(curpos2_off + atkib_off),"red","#00006b")	  gui.text(46+57, 184,"/","white","#00006b")	  gui.text(50+57, 184,memory.readword(curpos2_off + atkeq_off),"white","#00006b")	  	  gui.text(22+57, 190,"Df:","white","#00006b")	  gui.text(34+57, 190,memory.readword(curpos2_off + defib_off),"red","#00006b")	  gui.text(46+57, 190,"/","white","#00006b")	  gui.text(50+57, 190,memory.readword(curpos2_off + defeq_off),"white","#00006b")	  	  gui.text(22+57, 196,"MD:","white","#00006b")	  gui.text(34+57, 196,memory.readword(curpos2_off + mdfib_off),"red","#00006b")	  gui.text(46+57, 196,"/","white","#00006b")	  gui.text(50+57, 196,memory.readword(curpos2_off + mdfeq_off),"white","#00006b")	  	  gui.text(22+57, 202,"St:","white","#00006b")	  gui.text(34+57, 202,memory.readbyte(curpos2_off + strib_off),"red","#00006b")	  gui.text(46+57, 202,"/","white","#00006b")	  gui.text(50+57, 202,memory.readbyte(curpos2_off + streq_off),"white","#00006b")	  gui.text(62+56, 202,"/","white","#00006b")	  gui.text(66+56, 202,memory.readbyte(curpos2_off + strch_off),"grey","#00006b")	  	  gui.text(22+57, 208,"Mn:","white","#00006b")	  gui.text(34+57, 208,memory.readbyte(curpos2_off + mtlib_off),"red","#00006b")	  gui.text(46+57, 208,"/","white","#00006b")	  gui.text(50+57, 208,memory.readbyte(curpos2_off + mtleq_off),"white","#00006b")	  gui.text(62+56, 208,"/","white","#00006b")	  gui.text(66+56, 208,memory.readbyte(curpos2_off + mtlch_off),"grey","#00006b")	  	  gui.text(22+57, 214,"Ag:","white","#00006b")	  gui.text(34+57, 214,memory.readbyte(curpos2_off + agiib_off),"red","#00006b")	  gui.text(46+57, 214,"/","white","#00006b")	  gui.text(50+57, 214,memory.readbyte(curpos2_off + agieq_off),"white","#00006b")	  gui.text(62+56, 214,"/","white","#00006b")	  gui.text(66+56, 214,memory.readbyte(curpos2_off + agich_off),"grey","#00006b")	  	  --gui.text(22+57, 220,"Dx:","white","#00006b")	  --gui.text(34+57, 220,memory.readbyte(curpos2_off + dexib_off),"red","#00006b")	  --gui.text(46+57, 220,"/","white","#00006b")	  --gui.text(50+57, 220,memory.readbyte(curpos2_off + dexeq_off),"white","#00006b")	  --gui.text(62+57, 220,"/","white","#00006b")	  --gui.text(66+57, 220,memory.readbyte(curpos2_off + dexch_off),"grey","#00006b")	  	  	end		-- if position 1 (center) isn't blank (which shouldn't be possible), draw some stats    	if curpos1_off ~= 0 then		gui.text(40+113,162,curpos1name,"white","#00006b")	  	  --gui.text(22+113, 172,"Lv:","white","#00006b")	  --gui.text(34+113, 172,memory.readword(curpos1_off + level_off),"white","#00006b")	  	  --gui.text(22+113, 178,"Ex:","white","#00006b")	  --gui.text(34+113, 178,memory.readlong(curpos1_off + exp_off),"white","#00006b")	  	  gui.text(22+113, 172,"HP:","white","#00006b")	  gui.text(34+113, 172,memory.readword(curpos1_off + hpcur_off),"red","#00006b")	  gui.text(46+113, 172,"/","white","#00006b")	  gui.text(50+113, 172,memory.readword(curpos1_off + hpmax_off),"white","#00006b")	  	  -- This section attempts show what the character is doing on their turn,	  -- like the action icon used in the game.	  -- Unfortunately this doesn't work well for macros.	  if memory.readbyte(pos1act_off) == 0 then	  gui.text(66+112, 172,"At","red","black")	  end	  if memory.readbyte(pos1act_off) == 1 then	  gui.text(66+112, 172,"Tc","red","black")	  end	  if memory.readbyte(pos1act_off) == 2 then	  gui.text(66+112, 172,"Sk","red","black")	  end	  if memory.readbyte(pos1act_off) == 3 then	  gui.text(66+112, 172,"It","red","black")	  end	  if memory.readbyte(pos1act_off) == 4 then	  gui.text(66+112, 172,"Df","red","black")	  end	  	  gui.text(22+113, 178,"TP:","white","#00006b")	  gui.text(34+113, 178,memory.readword(curpos1_off + tpcur_off),"red","#00006b")	  gui.text(46+113, 178,"/","white","#00006b")	  gui.text(50+113, 178,memory.readword(curpos1_off + tpmax_off),"white","#00006b")	  	  gui.text(22+113, 184,"At:","white","#00006b")	  gui.text(34+113, 184,memory.readword(curpos1_off + atkib_off),"red","#00006b")	  gui.text(46+113, 184,"/","white","#00006b")	  gui.text(50+113, 184,memory.readword(curpos1_off + atkeq_off),"white","#00006b")	  	  gui.text(22+113, 190,"Df:","white","#00006b")	  gui.text(34+113, 190,memory.readword(curpos1_off + defib_off),"red","#00006b")	  gui.text(46+113, 190,"/","white","#00006b")	  gui.text(50+113, 190,memory.readword(curpos1_off + defeq_off),"white","#00006b")	  	  gui.text(22+113, 196,"MD:","white","#00006b")	  gui.text(34+113, 196,memory.readword(curpos1_off + mdfib_off),"red","#00006b")	  gui.text(46+113, 196,"/","white","#00006b")	  gui.text(50+113, 196,memory.readword(curpos1_off + mdfeq_off),"white","#00006b")	  	  gui.text(22+113, 202,"St:","white","#00006b")	  gui.text(34+113, 202,memory.readbyte(curpos1_off + strib_off),"red","#00006b")	  gui.text(46+113, 202,"/","white","#00006b")	  gui.text(50+113, 202,memory.readbyte(curpos1_off + streq_off),"white","#00006b")	  gui.text(62+112, 202,"/","white","#00006b")	  gui.text(66+112, 202,memory.readbyte(curpos1_off + strch_off),"grey","#00006b")	  	  gui.text(22+113, 208,"Mn:","white","#00006b")	  gui.text(34+113, 208,memory.readbyte(curpos1_off + mtlib_off),"red","#00006b")	  gui.text(46+113, 208,"/","white","#00006b")	  gui.text(50+113, 208,memory.readbyte(curpos1_off + mtleq_off),"white","#00006b")	  gui.text(62+112, 208,"/","white","#00006b")	  gui.text(66+112, 208,memory.readbyte(curpos1_off + mtlch_off),"grey","#00006b")	  	  gui.text(22+113, 214,"Ag:","white","#00006b")	  gui.text(34+113, 214,memory.readbyte(curpos1_off + agiib_off),"red","#00006b")	  gui.text(46+113, 214,"/","white","#00006b")	  gui.text(50+113, 214,memory.readbyte(curpos1_off + agieq_off),"white","#00006b")	  gui.text(62+112, 214,"/","white","#00006b")	  gui.text(66+112, 214,memory.readbyte(curpos1_off + agich_off),"grey","#00006b")	  	  --gui.text(22+113, 220,"Dx:","white","#00006b")	  --gui.text(34+113, 220,memory.readbyte(curpos1_off + dexib_off),"red","#00006b")	  --gui.text(46+113, 220,"/","white","#00006b")	  --gui.text(50+113, 220,memory.readbyte(curpos1_off + dexeq_off),"white","#00006b")	  --gui.text(62+112, 220,"/","white","#00006b")	  --gui.text(66+112, 220,memory.readbyte(curpos1_off + dexch_off),"grey","#00006b")	  	  	end		-- if position 3 isn't blank, draw some stats    if curpos3_off ~= 0 then		gui.text(40+169,162,curpos3name,"white","#00006b")	  	  --gui.text(22+169, 172,"Lv:","white","#00006b")	  --gui.text(34+169, 172,memory.readword(curpos3_off + level_off),"white","#00006b")	  	  --gui.text(22+169, 178,"Ex:","white","#00006b")	  --gui.text(34+169, 178,memory.readlong(curpos3_off + exp_off),"white","#00006b")	  	  gui.text(22+169, 172,"HP:","white","#00006b")	  gui.text(34+169, 172,memory.readword(curpos3_off + hpcur_off),"red","#00006b")	  gui.text(46+169, 172,"/","white","#00006b")	  gui.text(50+169, 172,memory.readword(curpos3_off + hpmax_off),"white","#00006b")	  	  -- This section attempts show what the character is doing on their turn,	  -- like the action icon used in the game.	  -- Unfortunately this doesn't work well for macros.	  if memory.readbyte(pos3act_off) == 0 then	  gui.text(66+168, 172,"At","red","black")	  end	  if memory.readbyte(pos3act_off) == 1 then	  gui.text(66+168, 172,"Tc","red","black")	  end	  if memory.readbyte(pos3act_off) == 2 then	  gui.text(66+168, 172,"Sk","red","black")	  end	  if memory.readbyte(pos3act_off) == 3 then	  gui.text(66+168, 172,"It","red","black")	  end	  if memory.readbyte(pos3act_off) == 4 then	  gui.text(66+168, 172,"Df","red","black")	  end	  	  gui.text(22+169, 178,"TP:","white","#00006b")	  gui.text(34+169, 178,memory.readword(curpos3_off + tpcur_off),"red","#00006b")	  gui.text(46+169, 178,"/","white","#00006b")	  gui.text(50+169, 178,memory.readword(curpos3_off + tpmax_off),"white","#00006b")	  	  gui.text(22+169, 184,"At:","white","#00006b")	  gui.text(34+169, 184,memory.readword(curpos3_off + atkib_off),"red","#00006b")	  gui.text(46+169, 184,"/","white","#00006b")	  gui.text(50+169, 184,memory.readword(curpos3_off + atkeq_off),"white","#00006b")	  	  gui.text(22+169, 190,"Df:","white","#00006b")	  gui.text(34+169, 190,memory.readword(curpos3_off + defib_off),"red","#00006b")	  gui.text(46+169, 190,"/","white","#00006b")	  gui.text(50+169, 190,memory.readword(curpos3_off + defeq_off),"white","#00006b")	  	  gui.text(22+169, 196,"MD:","white","#00006b")	  gui.text(34+169, 196,memory.readword(curpos3_off + mdfib_off),"red","#00006b")	  gui.text(46+169, 196,"/","white","#00006b")	  gui.text(50+169, 196,memory.readword(curpos3_off + mdfeq_off),"white","#00006b")	  	  gui.text(22+169, 202,"St:","white","#00006b")	  gui.text(34+169, 202,memory.readbyte(curpos3_off + strib_off),"red","#00006b")	  gui.text(46+169, 202,"/","white","#00006b")	  gui.text(50+169, 202,memory.readbyte(curpos3_off + streq_off),"white","#00006b")	  gui.text(62+168, 202,"/","white","#00006b")	  gui.text(66+168, 202,memory.readbyte(curpos3_off + strch_off),"grey","#00006b")	  	  gui.text(22+169, 208,"Mn:","white","#00006b")	  gui.text(34+169, 208,memory.readbyte(curpos3_off + mtlib_off),"red","#00006b")	  gui.text(46+169, 208,"/","white","#00006b")	  gui.text(50+169, 208,memory.readbyte(curpos3_off + mtleq_off),"white","#00006b")	  gui.text(62+168, 208,"/","white","#00006b")	  gui.text(66+168, 208,memory.readbyte(curpos3_off + mtlch_off),"grey","#00006b")	  	  gui.text(22+169, 214,"Ag:","white","#00006b")	  gui.text(34+169, 214,memory.readbyte(curpos3_off + agiib_off),"red","#00006b")	  gui.text(46+169, 214,"/","white","#00006b")	  gui.text(50+169, 214,memory.readbyte(curpos3_off + agieq_off),"white","#00006b")	  gui.text(62+168, 214,"/","white","#00006b")	  gui.text(66+168, 214,memory.readbyte(curpos3_off + agich_off),"grey","#00006b")	  	  --gui.text(22+169, 220,"Dx:","white","#00006b")	  --gui.text(34+169, 220,memory.readbyte(curpos3_off + dexib_off),"red","#00006b")	  --gui.text(46+169, 220,"/","white","#00006b")	  --gui.text(50+169, 220,memory.readbyte(curpos3_off + dexeq_off),"white","#00006b")	  --gui.text(62+168, 220,"/","white","#00006b")	  --gui.text(66+168, 220,memory.readbyte(curpos3_off + dexch_off),"grey","#00006b")	  	  	end		-- if position 5 (rightmost) isn't blank, draw some stats    if curpos5_off ~= 0 then		gui.text(40+225,162,curpos5name,"white","#00006b")		  --gui.text(22+225, 172,"Lv:","white","#00006b")	  --gui.text(34+225, 172,memory.readword(curpos5_off + level_off),"white","#00006b")	  	  --gui.text(22+225, 178,"Ex:","white","#00006b")	  --gui.text(34+225, 178,memory.readlong(curpos5_off + exp_off),"white","#00006b")	  	  gui.text(22+225, 172,"HP:","white","#00006b")	  gui.text(34+225, 172,memory.readword(curpos5_off + hpcur_off),"red","#00006b")	  gui.text(46+225, 172,"/","white","#00006b")	  gui.text(50+225, 172,memory.readword(curpos5_off + hpmax_off),"white","#00006b")	  	  -- This section attempts show what the character is doing on their turn,	  -- like the action icon used in the game.	  -- Unfortunately this doesn't work well for macros.	  if memory.readbyte(pos5act_off) == 0 then	  gui.text(66+225, 172,"At","red","black")	  end	  if memory.readbyte(pos5act_off) == 1 then	  gui.text(66+225, 172,"Tc","red","black")	  end	  if memory.readbyte(pos5act_off) == 2 then	  gui.text(66+225, 172,"Sk","red","black")	  end	  if memory.readbyte(pos5act_off) == 3 then	  gui.text(66+225, 172,"It","red","black")	  end	  if memory.readbyte(pos5act_off) == 4 then	  gui.text(66+225, 172,"Df","red","black")	  end	  	  gui.text(22+225, 178,"TP:","white","#00006b")	  gui.text(34+225, 178,memory.readword(curpos5_off + tpcur_off),"red","#00006b")	  gui.text(46+225, 178,"/","white","#00006b")	  gui.text(50+225, 178,memory.readword(curpos5_off + tpmax_off),"white","#00006b")	  	  gui.text(22+225, 184,"At:","white","#00006b")	  gui.text(34+225, 184,memory.readword(curpos5_off + atkib_off),"red","#00006b")	  gui.text(46+225, 184,"/","white","#00006b")	  gui.text(50+225, 184,memory.readword(curpos5_off + atkeq_off),"white","#00006b")	  	  gui.text(22+225, 190,"Df:","white","#00006b")	  gui.text(34+225, 190,memory.readword(curpos5_off + defib_off),"red","#00006b")	  gui.text(46+225, 190,"/","white","#00006b")	  gui.text(50+225, 190,memory.readword(curpos5_off + defeq_off),"white","#00006b")	  	  gui.text(22+225, 196,"MD:","white","#00006b")	  gui.text(34+225, 196,memory.readword(curpos5_off + mdfib_off),"red","#00006b")	  gui.text(46+225, 196,"/","white","#00006b")	  gui.text(50+225, 196,memory.readword(curpos5_off + mdfeq_off),"white","#00006b")	  	  gui.text(22+225, 202,"St:","white","#00006b")	  gui.text(34+225, 202,memory.readbyte(curpos5_off + strib_off),"red","#00006b")	  gui.text(46+225, 202,"/","white","#00006b")	  gui.text(50+225, 202,memory.readbyte(curpos5_off + streq_off),"white","#00006b")	  gui.text(62+225, 202,"/","white","#00006b")	  gui.text(66+225, 202,memory.readbyte(curpos5_off + strch_off),"grey","#00006b")	  	  gui.text(22+225, 208,"Mn:","white","#00006b")	  gui.text(34+225, 208,memory.readbyte(curpos5_off + mtlib_off),"red","#00006b")	  gui.text(46+225, 208,"/","white","#00006b")	  gui.text(50+225, 208,memory.readbyte(curpos5_off + mtleq_off),"white","#00006b")	  gui.text(62+225, 208,"/","white","#00006b")	  gui.text(66+225, 208,memory.readbyte(curpos5_off + mtlch_off),"grey","#00006b")	  	  gui.text(22+225, 214,"Ag:","white","#00006b")	  gui.text(34+225, 214,memory.readbyte(curpos5_off + agiib_off),"red","#00006b")	  gui.text(46+225, 214,"/","white","#00006b")	  gui.text(50+225, 214,memory.readbyte(curpos5_off + agieq_off),"white","#00006b")	  gui.text(62+225, 214,"/","white","#00006b")	  gui.text(66+225, 214,memory.readbyte(curpos5_off + agich_off),"grey","#00006b")	  	  --gui.text(22+225, 220,"Dx:","white","#00006b")	  --gui.text(34+225, 220,memory.readbyte(curpos5_off + dexib_off),"red","#00006b")	  --gui.text(46+225, 220,"/","white","#00006b")	  --gui.text(50+225, 220,memory.readbyte(curpos5_off + dexeq_off),"white","#00006b")	  --gui.text(62+225, 220,"/","white","#00006b")	  --gui.text(66+225, 220,memory.readbyte(curpos5_off + dexch_off),"grey","#00006b")	  	  	end	end