Page 1 of 3

Math

Posted: 25 May 2017 07:48
by Kwevin
I can already imagine the responses I'm gonna get. "Do it yourself, not that hard!" Well, I get tired of swapping apps on my phone. Anyways, my dilemma is:

Surely there's a way to make a money calculating trigger, right? I have calculator apps, but every time I exit chrome to go to my calculator, I have to re-log. Ugh. Can I make a trigger to do this? Something like, "I have this many coppers, what does that boil down to" would even be helpful. But, could you put in a series of numbers and have that reduced? I'm thinking this for comparison purposes. It must be possible, right? How would you do it?

Re: Math

Posted: 25 May 2017 09:36
by Thalric
Why do you want to calculate it?
Is it for withdrawing the perfect amount of coins for that next skill?

I always just withdrew as many coins as I could carry and trained all the skills I could with it.
If I didn't need all the coins, I would return to the back and deposit the rest.

If you don't like copper, find yourself a bank with a low rate of fee and minimize them all.
That way you will probably be able to carry all your coins at once.

Re: Math

Posted: 25 May 2017 09:57
by Melarec
Very basic. Save this in a text editor as .html then open in a browser.
Bookmark it for ease of access.

Code: Select all

<!DOCTYPE html>
<html>
<title>money converter</title>
<body>

<h2>Money Converter</h2>
<p>Type a value in the Coins field to convert the value to platinum:</p>

<p>
  <label>Coppers</label>
  <input id="inputCoppers" type="number" placeholder="Copper Coins" oninput="cCoinConverter(this.value)" onchange="cCoinConverter(this.value)">
</p>
<p>Platinum Coins: <span id="cOutputPlats"></span></p>
<p>
  <label>Silvers</label>
  <input id="inputSilvers" type="number" placeholder="Silver Coins" oninput="sCoinConverter(this.value)" onchange="sCoinConverter(this.value)">
</p>
<p>Platinum Coins: <span id="sOutputPlats"></span></p>
<p>
  <label>Golds</label>
  <input id="inputGolds" type="number" placeholder="Gold Coins" oninput="gCoinConverter(this.value)" onchange="gCoinConverter(this.value)">
</p>
<p>Platinum Coins: <span id="gOutputPlats"></span></p>

<script>
function cCoinConverter(valNum) {
  document.getElementById("cOutputPlats").innerHTML=valNum/12/12/12;
}
function sCoinConverter(valNum) {
  document.getElementById("sOutputPlats").innerHTML=valNum/12/12;
}
function gCoinConverter(valNum) {
  document.getElementById("gOutputPlats").innerHTML=valNum/12;
}
</script>
</body>
</html>
Very basic. No flashy CSS.
Though I could do something nicer, with time.
And add more functions.

EDIT: *facepalm* This won't work on your phone. Sorry. I misread your post at first. Oh well.

Re: Math

Posted: 25 May 2017 10:12
by Tarax the Terrible
When u are high up in the rich mens club you get the command <rc bankbook>
Tells you in plats how much money you have in the bank.
So I have a script to just use that and track how much I earn in a log in.

So its there just not for poor ppl. :P

Re: Math

Posted: 25 May 2017 15:06
by Kwevin
Oh, it's definitely there. The bank has it. That value line. I would like something like that, not for banks or withdrawing, but because it's nice to know how much money you actually have in coppers. You have 3000 coppers, don't know it, and minimize that, you lose kinda a lot. I know there are ways of doing it, but maybe I'm just lazy lol

Re: Math

Posted: 25 May 2017 16:42
by Tarax the Terrible
If u make a start yourself we will help you on the finer points. Start by googling JavaScript math functions.

You can make a alias like
Calccopper 123 1234 12356 200000
Where the numbers r ur totals in the bank

Then the result will show on screen ur wealth in coppers

Re: Math

Posted: 25 May 2017 21:44
by Kwevin
Okay, right off the bat, I have an idea here. To calc coppers, it would be count/12. Then, take that, and divide it by 12 again. If it's less than one, scrap it. If more, repeat, up to twice. Am I on the right track?

Re: Math

Posted: 25 May 2017 22:01
by Kwevin
I discover that in order to do anything, I would need regex, and being able to use a wildcard in the pattern as a variable. What can I use for this purpose? Is it this:

(.*)\.$

Re: Math

Posted: 25 May 2017 22:02
by Melarec
Kwevin wrote:Okay, right off the bat, I have an idea here. To calc coppers, it would be count/12. Then, take that, and divide it by 12 again. If it's less than one, scrap it. If more, repeat, up to twice. Am I on the right track?
If you want to see how much Gold your Coppers are worth, yes. For Plats, divide once more.
A Silver is 12 Copper (Divide copper coins once by 12)
A Gold is 144 Copper (Divide copper coins twice by 12)
A Plat is 1728 Copper (Divide copper coins thrice by 12)

Re: Math

Posted: 25 May 2017 22:22
by Kwevin
Hmm... Something like:

>ccalc var1
var1/12
If arg1<1, display var1+ " coppers, 0 silvers."
Else if arg1=var2
var2/12
If arg2<1, display var2 + " silvers " + remainder + " coppers."
Else if ans=var3

And so on. Is my thinking close?