Tracking kills?

General discussion about the Genesis Web Client located at https://www.genesismud.org/play/

Moderator: Eowul

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.
Post Reply
bashere
Beginner
Posts: 10
Joined: 12 Oct 2017 19:31

Tracking kills?

Post by bashere » 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.?

bashere
Beginner
Posts: 10
Joined: 12 Oct 2017 19:31

Re: Tracking kills?

Post by bashere » 22 Nov 2017 00:11

Google Analytics tagging might work.. Just searching ideas atm.

User avatar
cotillion
Site Admin
Posts: 350
Joined: 04 Mar 2010 01:14

Re: Tracking kills?

Post by cotillion » 22 Nov 2017 13:36

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');
}

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/