<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
    <title>Re: Re: Re: Untitled - pb.stoleyour.com</title>
    <description>Re: Re: Re: Untitled - pb.stoleyour.com</description>
    <atom:link href="http://pb.stoleyour.com/view/rss/3098cf36" rel="self" type="application/rss+xml" />
    <link>http://pb.stoleyour.com/</link>
    <language>en</language>
<item>
    <title>Re: Re: Re: Re: Untitled</title>
    <link>http://pb.stoleyour.com/view/8410cc79</link>
    <pubDate>Fri, 26 Jul 2013 19:12:14 -0400</pubDate>
    <dc:creator>Ungracious Prairie Dog</dc:creator>
    <guid isPermaLink="false">http://pb.stoleyour.com/view/8410cc79</guid>
    <description><![CDATA[package require http package require json bind pub - !gw2 pub:gw2Stats namespace eval gw2Utils { set tsvPath &quot;tsvgw2/&quot; proc parsePairs { tsvName } { set f [open [file nativename $gw2Utils::tsvPath$tsvName]&#8230;]]></description>
    <content:encoded><![CDATA[<div class="tcl" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">package</span> require <span style="color: #008000;">http</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #008000;">package</span> require json</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">bind pub - <span style="color: #66cc66;">!</span>gw2 pub:gw2Stats</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">namespace</span> <span style="color: #ff7700;font-weight:bold;">eval</span> gw2Utils <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> tsvPath <span style="color: #483d8b;">&quot;tsvgw2/&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">proc</span> parsePairs <span style="color: black;">&#123;</span> tsvName <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> f <span style="color: black;">&#91;</span><span style="color: #008000;">open</span> <span style="color: black;">&#91;</span><span style="color: #008000;">file</span> nativename <span style="color: #ff3333;">$gw2Utils</span>::<span style="color: black;">tsvPath</span><span style="color: #ff3333;">$tsvName</span><span style="color: black;">&#93;</span> r<span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#123;</span> <span style="color: black;">&#91;</span><span style="color: #008000;">eof</span> <span style="color: #ff3333;">$f</span><span style="color: black;">&#93;</span> == <span style="color: #ff4500;">0</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> splitLine <span style="color: black;">&#91;</span><span style="color: #008000;">split</span> <span style="color: black;">&#91;</span><span style="color: #008000;">gets</span> <span style="color: #ff3333;">$f</span><span style="color: black;">&#93;</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> pairMap<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$splitLine</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$splitLine</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#91;</span>array get pairMap<span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">proc</span> insertCommas <span style="color: black;">&#123;</span> num <span style="color: black;">&#123;</span>sep ,<span style="color: black;">&#125;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#123;</span> <span style="color: black;">&#91;</span><span style="color: #008000;">regsub</span> <span style="color: black;">&#123;</span>^<span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>-+<span style="color: black;">&#93;</span><span style="color: #66cc66;">?</span>\d+<span style="color: black;">&#41;</span><span style="color: black;">&#40;</span>\d\d\d<span style="color: black;">&#41;</span><span style="color: black;">&#125;</span> <span style="color: #ff3333;">$num</span> <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>1$sep<span style="color: #000099; font-weight: bold;">\\</span>2&quot;</span> num<span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff3333;">$num</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; array <span style="color: #ff7700;font-weight:bold;">set</span> serverID <span style="color: black;">&#91;</span>parsePairs <span style="color: #483d8b;">&quot;gw2servers.tsv&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;font-weight:bold;">proc</span> pub:gw2Stats <span style="color: black;">&#123;</span> nick uhost handle channel arg <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> urlMatch <span style="color: #483d8b;">&quot;http://gw2stats.net/api/matches.json&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> urlRank <span style="color: #483d8b;">&quot;http://gw2stats.net/api/ratings.json&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> jsonMatch <span style="color: black;">&#91;</span><span style="color: #008000;">http</span>::<span style="color: black;">data</span> <span style="color: black;">&#91;</span><span style="color: #008000;">http</span>::<span style="color: black;">geturl</span> <span style="color: #ff3333;">$urlMatch</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> jsonRank <span style="color: black;">&#91;</span><span style="color: #008000;">http</span>::<span style="color: black;">data</span> <span style="color: black;">&#91;</span><span style="color: #008000;">http</span>::<span style="color: black;">geturl</span> <span style="color: #ff3333;">$urlRank</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> apiMatch <span style="color: black;">&#91;</span>json::<span style="color: black;">json2dict</span> <span style="color: #ff3333;">$jsonMatch</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> apiRank <span style="color: black;">&#91;</span>json::<span style="color: black;">json2dict</span> <span style="color: #ff3333;">$jsonRank</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> argList <span style="color: black;">&#91;</span><span style="color: #008000;">regexp</span> -inline -all -- <span style="color: black;">&#123;</span>\S+<span style="color: black;">&#125;</span> <span style="color: #ff3333;">$arg</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> command <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> trim <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> tolower <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$argList</span> <span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #ff3333;">$command</span> == <span style="color: #483d8b;">&quot;match&quot;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> region <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> trim <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> tolower <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$argList</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> group <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> trim <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> tolower <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$argList</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #66cc66;">!</span><span style="color: black;">&#91;</span>dict exists <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$apiMatch</span> <span style="color: #483d8b;">&quot;region&quot;</span><span style="color: black;">&#93;</span> <span style="color: #ff3333;">$region</span><span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putserv <span style="color: #483d8b;">&quot;PRIVMSG $channel :$nick: Invalid region '$region'!&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: black;">&#91;</span><span style="color: #ff7700;font-weight:bold;">catch</span> <span style="color: black;">&#123;</span><span style="color: #ff7700;font-weight:bold;">set</span> worlds <span style="color: black;">&#91;</span>dict get <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: black;">&#91;</span>dict get <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$apiMatch</span> <span style="color: #483d8b;">&quot;region&quot;</span><span style="color: black;">&#93;</span> <span style="color: #ff3333;">$region</span><span style="color: black;">&#93;</span> <span style="color: black;">&#91;</span><span style="color: #ff7700;font-weight:bold;">expr</span> <span style="color: black;">&#123;</span> <span style="color: #ff3333;">$group</span> - <span style="color: #ff4500;">1</span> <span style="color: black;">&#125;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span> <span style="color: #483d8b;">&quot;worlds&quot;</span><span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> e<span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putserv <span style="color: #483d8b;">&quot;PRIVMSG $channel :$nick: Invalid group '$group'!&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> output <span style="color: #483d8b;">&quot;&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">foreach</span> world <span style="color: #ff3333;">$worlds</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$world</span> <span style="color: #483d8b;">&quot;name&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> score <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$world</span> <span style="color: #483d8b;">&quot;score&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> output <span style="color: #483d8b;">&quot;$output$name: $score, &quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> output <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> range <span style="color: #ff3333;">$output</span> <span style="color: #ff4500;">0</span> end-<span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putserv <span style="color: #483d8b;">&quot;PRIVMSG $channel :$nick: $output&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #ff3333;">$command</span> == <span style="color: #483d8b;">&quot;rank&quot;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> region <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> trim <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> tolower <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$argList</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> server <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> trim <span style="color: black;">&#91;</span><span style="color: #008000;">string</span> tolower <span style="color: black;">&#91;</span><span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$argList</span> <span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#123;</span> <span style="color: #66cc66;">!</span><span style="color: black;">&#91;</span>dict exists <span style="color: #ff3333;">$apiRank</span> <span style="color: #ff3333;">$region</span><span style="color: black;">&#93;</span> <span style="color: black;">&#125;</span> <span style="color: black;">&#123;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putserv <span style="color: #483d8b;">&quot;PRIVMSG $channel :$nick: Invalid region '$region'!&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> stats <span style="color: black;">&#91;</span>dict get <span style="color: black;">&#91;</span>dict get <span style="color: black;">&#91;</span>dict get <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$apiRank</span> <span style="color: #ff3333;">$region</span><span style="color: black;">&#93;</span> <span style="color: #483d8b;">&quot;ratings&quot;</span> <span style="color: black;">&#93;</span> <span style="color: #483d8b;">&quot;1019&quot;</span> <span style="color: black;">&#93;</span> <span style="color: #483d8b;">&quot;data&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> rank <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$stats</span> <span style="color: #483d8b;">&quot;current_rank&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">set</span> rating <span style="color: black;">&#91;</span>dict get <span style="color: #ff3333;">$stats</span> <span style="color: #483d8b;">&quot;current_rating&quot;</span><span style="color: black;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; </div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; putserv <span style="color: #483d8b;">&quot;PRIVMSG $channel :$nick: $rank $rating&quot;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: black;">&#125;</span></div></li>
</ol></div>]]></content:encoded>
</item>
</channel>
</rss>
