$colorgreen = $colordarkamber;
    $colorbackground = $colordarkamber;
}
if ($amberpct == 0) {
    $colorgreen = $colordarkred;
    $coloramber = $colordarkred;
    $colorbackground = $colordarkred;
}
$pctgrey = 100 - $greenwidth - $amberwidth - $redwidth;
rawoutput("<table style='border: solid 1px #000000' bgcolor='{$colorbackground}' cellpadding='0' cellspacing='0' width='100%' height='20'><tr><td width='{$redwidth}%' bgcolor='{$colorred}'></td><td width='{$amberwidth}%' bgcolor='{$coloramber}'></td><td width='{$greenwidth}%' bgcolor='{$colorgreen}'></td><td width='{$pctgrey}%'></td></tr></table>");
output("Total Stamina: %s / %s | Amber point: %s | Red point: %s", number_format($stamina), number_format($daystamina), number_format($amberpoint), number_format($redpoint));
output("`n`nHere is the nitty-gritty of your Stamina statistics.  The most important value is the total cost, over there on the right.  If there's anything in the Buff column, something's temporarily affecting the cost of performing that action (negative numbers are good!).  More details follow after the stats.`n`n");
rawoutput("<table width=100%><tr><td><b>Action</b></td><td><b>Experience</b></td><td><b>Natural Cost</b></td><td><b>Buff</b></td><td><b>Total</b></td></tr>");
$act = get_player_action_list();
foreach ($act as $key => $values) {
    $lvlinfo = stamina_level_up($key);
    $nextlvlexp = round($lvlinfo['nextlvlexp']);
    $nextlvlexpdisplay = number_format($nextlvlexp);
    $currentlvlexp = round($lvlinfo['currentlvlexp']);
    $currentlvlexpdisplay = number_format($currentlvlexp);
    $cost = $values['naturalcost'];
    $level = $values['lvl'];
    $exp = $values['exp'];
    $mincost = $values['mincost'];
    $costwithbuff = stamina_calculate_buffed_cost($key);
    $modifier = $costwithbuff - $cost;
    $bonus = "None";
    if ($modifier < 0) {
        $bonus = "`@" . number_format($modifier) . "`0";
    } elseif ($modifier > 0) {
        $bonus = "`\$" . number_format($modifier) . "`0";
function process_action($action, $userid = false)
{
    global $session, $actions_used;
    if ($userid === false) {
        $userid = $session['user']['acctid'];
    }
    $info_to_return = array("points_used" => 0, "exp_earned" => 0);
    $info_to_return['points_used'] = stamina_take_action_cost($action, $userid);
    $info_to_return['exp_earned'] = stamina_award_exp($action, $userid);
    stamina_advance_buffs($action, $userid);
    $info_to_return['lvlinfo'] = stamina_level_up($action, $userid);
    $actions_used[$action]['exp_earned'] += $info_to_return['exp_earned'];
    $actions_used[$action]['lvlinfo'] = $info_to_return['lvlinfo'];
    //We want to put a ladder of some sort in here, where the player can see the player above them in the HOF and the player below them as well.
    return $info_to_return;
}