Tracking kills?
Posted: 21 Nov 2017 23:50
Using webui or perhaps in-game means, is there a way to keep running stats on total kills, kills by race, species, etc.?
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');
}