Location: PHPKode > scripts > ff4aSave > ff4asave/ff4atest.php
<?php
require_once("FF4.php");
function maxOut(&$x) {
	$chdata=Array(
		"HP"=>9999, "HP max"=>9999, "MP"=>999,"MP max"=>999,"Strength"=>99, 
		"Agility"=>99, "Stamina"=>99, "Intellect"=>99, "Spirit"=>99,"XP"=>9999999
	);//  Create a generic template for the best stats
	for ($i=0; $i<13; $i++) {
		$x->Char($i);
		$x->Stats($chdata);
	} // and apply it to all 13 characters
	$Inv=Array("Gil"=>9999999);  //hook up the gil
	$Inv["On Hand"][0]=Array("ItemID"=>$x->Item("Megalixr"), "Count"=>99); // a couple of these will do you body good
	$Inv["On Hand"][1]=Array("ItemID"=>$x->Item("Phoenix Down"), "Count"=>99); // Ever wonder why they didn't use one on Aeris?  It's cos you CHEATED and TOOK them all.
	$Inv["On Hand"][2]=Array("ItemID"=>$x->Item("Lightbringer"), "Count"=>1);  //Baddest weapon for Cecil
	$Inv["On Hand"][3]=Array("ItemID"=>$x->Item("Mutsonokami"), "Count"=>2); //A pair of pretties for Edge
	$x->Inventory($Inv);  // and write the new inventory data to your save.
}
$x = new ff4Save();  // create an instance without loading
$x->debugLevel(2);  // set the debug level to 2
$x->Open($_ENV["HOME"]."/.vba/FF4ADVANCE.sav");  //Open a savegame that is, ostensibly, the one you're playing
$x->Save(0); // Select save bank number 2 (3/3 in the game)
maxOut($x); // Max out your save
$x->Store(); // And commit to your game
?>
Return current item: ff4aSave