9 Rings Formulas, Get your estimate for how long and price cost

1 pages Page 1
l
laguna_sunrise
Ascalonian Squire
#1
The Tool is here:
http://www.angelfire.com/wizard/devolievola/index.html

Coded by Marty Silverblade, I made the formulas.

Where X is your Goal and Y is your current Lucky points.

Total Tickets:
((X-Y)/(85/9*19))*(5/9*19)
Total Cost:
((X-Y)/(85/9*19))*(5/9*19)*15
Total Days:
(((X-Y)/(85/9*19))*187)/86400

I wanted to make a quick webpage with enter your goal and current lucky and a calculate button.
Marty Silverblade
Marty Silverblade
Administrator
#2
Not sure exactly what you mean by "I couldn't figure out how". The actual development of such a calculator can be done with a quick bit of html+javascript. Can you code at all? If you want to have it on the internet you'll need to find a server to host it on, though if you're happy with an offline version (like Chthon's very useful damage calculator), you need to provide the code here and/or upload the html file to a file sharing website for people to download.
l
laguna_sunrise
Ascalonian Squire
#3
I mean I searched the internet for how to do it and couldn't find a way to put this into a webpage. I do have it in a google spreadsheet and the formula works, but that is as far as my knowledge goes.
Marty Silverblade
Marty Silverblade
Administrator
#4
So you're not familiar with internet technologies then? I decided to just write the thing given how short it'll be. ~90% done. Of course, if you don't have a server to upload it on there isn't a ton of difference between a spreadsheet and a html page.
l
laguna_sunrise
Ascalonian Squire
#5
I can do basic html. I didn't know how to make a form like this though. With the spreadsheet I wouldn't know how to share the online version without giving someone the ability to delete the code.

I have a site I could load it to. I think it would work.
Marty Silverblade
Marty Silverblade
Administrator
#6
Code:
<html>
	<head>
		<script type="text/javascript">
			function round2DP(num)
			{
				return (Math.round(num * 100) / 100);
			}
			
			function calcTickets(x, y)
			{
				return Math.round(((x-y)/(85/9*19))*(5/9*19));
			}
			
			function calcCost(x, y)
			{
				return Math.round(((x-y)/(85/9*19))*(5/9*19)*15);
			}
			
			function calcDays(x, y)
			{
				return round2DP((((x-y)/(85/9*19))*187)/86400);
			}
			
			function run()
			{
				var X = Number(document.getElementById("goal").value);
				var Y = Number(document.getElementById("current").value);
				
				document.getElementById("tickets").innerHTML = calcTickets(X, Y);
				document.getElementById("cost").innerHTML = calcCost(X, Y);
				document.getElementById("days").innerHTML = calcDays(X, Y);
			}
		</script>
		<title>Nine Rings Lucky Calculator</title>
	</head>
	<body>
		<h2>Nine Rings Lucky Calculator</h2>
		<h3>Input</h3>
		<form>
			<p>Goal:</p>
			<input type="text" id="goal" />
			<p>Current Points:</p>
			<input type="text" id="current" /><br /><br />
			<button type="button" id="calculateButton" onclick="run()">Calculate</button><br /><br />
		</form>
		
		<h3>Results<h3>
		<table border="1">
			<tr>
				<td>Tickets</td>
				<td id="tickets"></td>
			</tr>
			<tr>
				<td>Cost</td>
				<td id="cost"></td>
			</tr>
			<tr>
				<td>Days</td>
				<td id="days"></td>
			</tr>
		</table>
	</body>
</html>
Copy paste that into notepad and save it as "ninerings.html" (or whatever, as long as it ends with .html). Then open with your internet browser of choice. Is this the kind of thing you had in mind?

-Didn't make much of an effort to make it look good. Also didn't worry too much about properly following good coding practises and the like, but it's pretty good. Also didn't check the formulas. I don't consider this to be a final version.
-Borrowed little bits of code and the design from Chthon so credit to him.

----

I haven't used Google spreadsheets so I can't say whether that'd be a better solution.
Marty Silverblade
Marty Silverblade
Administrator
#8
Appears to be working as intended, though as I mentioned above I didn't test the formulas. Is there anything in particular you think should be done/want done from here? Not sure why you're asking me whether it's ok.
l
laguna_sunrise
Ascalonian Squire
#9
I want to make this an available tool. Should it be posted on this page? I ask if it is okay because I didn't know if offsite linking was allowed.
Marty Silverblade
Marty Silverblade
Administrator
#10
There is no issue with having a link to external websites provided their content doesn't breach Guru policy (e.g, no R18+ content, no advertising spam). It's not possible to embed the HTML directly into the forum as that has been disabled for security reasons.
l
laguna_sunrise
Ascalonian Squire
#11
Thanks Marty. The total cost formula can be tested against the Lucky/Unlucky or the 9 rings page as 2,205,882 gold to max title.