View unanswered posts | View active topics It is currently 20 Feb 2018 05:27

Forum rules


- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.



Reply to topic  [ 3 posts ] 
Tracking kills? 
Author Message
Greenhorne

Joined: 12 Oct 2017 19:31
Posts: 8
Using webui or perhaps in-game means, is there a way to keep running stats on total kills, kills by race, species, etc.?


21 Nov 2017 23:50
Profile
Greenhorne

Joined: 12 Oct 2017 19:31
Posts: 8
Google Analytics tagging might work.. Just searching ideas atm.


22 Nov 2017 00:11
Profile
Site Admin
User avatar

Joined: 04 Mar 2010 01:14
Posts: 273
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:
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');
}


22 Nov 2017 13:36
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.