Easy solution: Add 1 for kills, subtract 1 for deaths. No k/d ratio, but scores the same way.
Hard solution:
http://www.staredit.net/wiki/Counter_ArithmeticYou'll have to use division and subtraction a LOT. I'd recommend:
DC Kill -> actual kills
DC Kill 2 -> copy of kills to restore to
DC Death -> actual deaths
DC Death 2 -> copy of deaths to restore to
DC Copy -> needed for copying
First transfer everything into copies (basic, I shouldn't have to tell you how to do this if you're going to do it)
Subtract DC Kill and DC Death into DC Copy. Add 100 to DC Result.
Move DC Copy into DC Death.
I don't think you can "binarify" this part though. That means you'll probably need to copy these sets of triggers, say, 100 times for a 100/1 K/D ratio max.
If DC Death > DC Kill during this, or they both=0, you can stop.
Now, we need to find the tenths place.
Move DC Copy into DC Kill, with a multiple of 10 (ie 1 Copy= 10 Kill). Also add DC Copy back into DC Death.
Subtract DC Kill and DC Death into DC Copy. Add 10 to DC Result.
etc...
Now we need to find the hundredths place.
Move DC Copy into DC Kill, with a multiple of 10 (ie 1 Copy= 10 Kill). Also add DC Copy back into DC Death.
Subtract DC Kill and DC Death into DC Copy. Add 1 to DC Result.
Any remainder is insignificant, and we'll assume we round down. You can round to the nearest, but that's an extra trigger to an already bloated system.
Now you have 0 in DC Kill, Remainder in DC Death, another remainder in DC Copy, and the Ratio as a percentage in DC Result. If you want to display DC Result, display kills of unitid:228+DC Result.
Copy DC Kill 2 into DC Kill and DC Death 2 into DC Death.
Now walking through it, say you have 5 kills, 7 deaths. The fraction is .71.
DC Kill = 5
DC Death = 7
DC Kill 2 = 5
DC Death 2 = 7
Trigger set 1:
DC Kill = 0
DC Death = 2
DC Copy = 5
DC Death isn't 0, so don't add 100 and end trigger set 1.
Trigger set 2:
DC Kill = 50
DC Death = 7
->
DC Kill = 43
DC Death = 0
DC Copy = 7
DC Result = 10
...
DC Kill = 0
DC Death = 6
DC Copy = 1
DC Result = 70
DC Kill = 0 and DC Death doesn't, don't add 10 this time.
Trigger set 3:
DC Kill = 10
DC Death = 7
etc...
DC Kill = 0
DC Death = 4
DC Copy = 3
DC Result = 71.
If it sounds ridiculously difficult, well, it is. If you want to go out further, just copy trigger sets 2 and 3 into more decimal places, and add numbers accordingly to the result DC in each of the trigger sets (1000 in 1, 100 in 2, 10 in 3, 1 in 4). Note the most you need in Trigger sets after 1 is 10 copies.
"Parliamentary inquiry, Mr. Chairman - do we have to call the Gentleman a gentleman if he's not one?"