Re: Math
Posted: 26 May 2017 07:50
Okay, took a bit for an amateur, but here's what I got.
My idea is, alias or trigger, input in coppers. Like, <estimate 3500>
How's this look?
Would be cooler, if I could get it to do exactly what the bank does, i.e. estimate 30(c), 27(s), 90(g), 200 to come out with a full minimize. So it's easier to know exactly how much money you have.
My idea is, alias or trigger, input in coppers. Like, <estimate 3500>
How's this look?
Code: Select all
var copp = regexp
var min = 12;
var silv = Math.floor(copp/min);
var srem = Math.floor(%copp/min);
var copp = Math.floor(copp+srem);
var gold = Math.floor(silv/min);
var grem = min%silv;
var silv = Math.floor(silv+grem);
var plat = Math.floor(gold/min);
var prem = min%gold;
var gold = Math.floor(gold+prem);
gwc.output.append(plat + " plats.");
gwc.output.append(gold + " gold.");
gwc.output.append(silv + " silvers.");
gwc.output.append(copp + " coppers.");