Math

Need some help with your MUD client? Forgot your password? Get help here.
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.
Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Math

Post by Kwevin » 25 May 2017 07:48

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?
Alea iacta est. Serius regredi est.

Thalric
Rising Hero
Posts: 343
Joined: 14 Jun 2016 16:34

Re: Math

Post by Thalric » 25 May 2017 09:36

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.

User avatar
Melarec
Rising Hero
Posts: 318
Joined: 29 Feb 2016 19:51
Location: Everywhere
Contact:

Re: Math

Post by Melarec » 25 May 2017 09:57

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.

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Math

Post by Tarax the Terrible » 25 May 2017 10:12

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
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Re: Math

Post by Kwevin » 25 May 2017 15:06

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
Alea iacta est. Serius regredi est.

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

Re: Math

Post by Tarax the Terrible » 25 May 2017 16:42

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
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Re: Math

Post by Kwevin » 25 May 2017 21:44

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?
Alea iacta est. Serius regredi est.

Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Re: Math

Post by Kwevin » 25 May 2017 22:01

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:

(.*)\.$
Last edited by Kwevin on 25 May 2017 22:02, edited 1 time in total.
Alea iacta est. Serius regredi est.

User avatar
Melarec
Rising Hero
Posts: 318
Joined: 29 Feb 2016 19:51
Location: Everywhere
Contact:

Re: Math

Post by Melarec » 25 May 2017 22:02

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)

Kwevin
Veteran
Posts: 207
Joined: 21 Mar 2016 09:17

Re: Math

Post by Kwevin » 25 May 2017 22:22

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?
Alea iacta est. Serius regredi est.

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