Page 1 of 1

Tracking kills?

Posted: 21 Nov 2017 23:50
by bashere
Using webui or perhaps in-game means, is there a way to keep running stats on total kills, kills by race, species, etc.?

Re: Tracking kills?

Posted: 22 Nov 2017 00:11
by bashere
Google Analytics tagging might work.. Just searching ideas atm.

Re: Tracking kills?

Posted: 22 Nov 2017 13:36
by cotillion
It's fairly easy in the web client.
Here's a quick example that should work.

Create a regexp trigger
Pattern: ^You killed the (.*) ([a-z]+).$

Code: Select all

gwc.userdata.kills = gwc.userdata.kills || {};
var race = args['2'];

function increment(type) {
  gwc.userdata.kills[type] = (gwc.userdata.kills[type] || 0) + 1;
  return gwc.userdata.kills[type];
}

var total = increment('total');
if (total % 100 == 0) {
  gwc.output.append('You have killed ' + total + ' enemies', 'red');
}

total = increment(race);
if (total % 10 == 0) {
  gwc.output.append('You have killed ' + total + ' ' + race, 'red');
}