All pastes #635521 Raw Edit

Anonymous

public text v1 · immutable
#635521 ·published 2007-07-27 04:11 UTC
rendered paste body
function stats($rs2player, $type, $co1, $co2)
{
    if ($rs2player == "$null")
    {
        return "U need to specify a RSN";
    }
    else
    {
        if ($type == "l")
        {
            $c1 = "\003";
            $c1 .= $co1;
            $c2 = "\003";
            $c2 .= $co2;
            $link = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=";
            $link .= $rs2player;
            $data = file_get_contents($link);
            preg_match_all('/">\n(.+)\n<\/a><\/td>\n<td align="right">(.+)<\/td>\n<td align="right">(.+)<\/td>\n<td align="right">(.+)<\/td>\n<\/tr>/i',
                $data, $matches);
            for ($x = 0; $x < count($matches[0]); $x++)
            {
                $skill = $matches[1][$x];
                $rank = $matches[2][$x];
                $level = $matches[3][$x];
                $exp = $matches[4][$x];
                $sline .= $c1 . $skill . " " . $c2 . $level . " ";
            }
            return $sline;
            unset($sline);
        }
        elseif ($type == "e")
        {
            $c1 = "\003";
            $c1 .= $co1;
            $c2 = "\003";
            $c2 .= $co2;
            $link = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=";
            $link .= $rs2player;
            $data = file_get_contents($link);
            preg_match_all('/">\n(.+)\n<\/a><\/td>\n<td align="right">(.+)<\/td>\n<td align="right">(.+)<\/td>\n<td align="right">(.+)<\/td>\n<\/tr>/i',
                $data, $matches);
            for ($x = 0; $x < count($matches[0]); $x++)
            {
                $skill = $matches[1][$x];
                $rank = $matches[2][$x];
                $level = $matches[3][$x];
                $exp = $matches[4][$x];
                $sline .= $c1 . $skill . " " . $c2 . $exp . " ";
            }
            return $sline;
            unset($sline);
        }
    }
}