PDA

View Full Version : charpane.php override :: add turn-count



StDoodle
10-11-2008, 12:28 AM
This is a very simple relay override script I thought I'd put up just in case anyone else wants it. All it does is add a line below "Adv.:" with "TC:" and your total turn-count for the run.

I'm interested in starting to log my ascensions, but feel that doing so manually will help to promote more awareness of what I'm doing, and I wanted a quick visual on my current turn-count to log by.

raorn
10-11-2008, 02:29 PM
You could also add semi-rare counters. Here's my quick-and-dirty counter extraction code:



record counter {
int turns;
string name;
string image;
};

counter [int] get_counters()
{
string [int] counters = get_property("relayCounters").split_string(":");
counter [int] ret;
int i = 0;

while (i < counters.count() / 3) {
ret[i].turns = counters[i*3].to_int();
ret[i].name = counters[i*3+1];
ret[i].image = counters[i*3+2];
i = i + 1;
}

return ret;
}

void main()
{
counter [int] cnt = get_counters();

if (cnt.count() > 0)
foreach c in cnt {
print("<" + cnt[c].image + "> " + cnt[c].name + " (" + (cnt[c].turns - turns_played()) + ")");
}
}

// vim: set ft=javascript ts=4: