Beer Event - Remaining Rewards
How do I make an beer event - remaining rewards?
What is a beer event - remaining rewards? How do you make a beer event - remaining rewards? This script and codes were developed by Steven on 05 October 2022, Wednesday.
Beer Event - Remaining Rewards - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Beer Event - Remaining Rewards</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> Override expected remaining tickets: <input type="number" id="inputTickets"><br>
<p id="output"></p> <script src='https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.17.0/moment.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Beer Event - Remaining Rewards - Script Codes CSS Codes
table { border-collapse: collapse; padding: 2px;
}
td { padding: 2px 5px;
}
Beer Event - Remaining Rewards - Script Codes JS Codes
console.clear();
let inputTickets = document.getElementById("inputTickets");
let output = document.getElementById("output");
let now = new moment();
let future = new moment("2016-12-07"); // Festival end date
let diff = (future - now) ? future-now : 0;
let timeToEnd = moment.duration(diff);
let minutesUntilEnd = timeToEnd.asMinutes();
let beers = minutesUntilEnd / 5;
let tickets = Math.floor(beers / 95)*5;
function doOutput() { output.innerHTML = ``; let string = `` string += `From now until the end of Beer Festival (Assuming midnight, 6th December)` string += `(${timeToEnd.asMinutes().toFixed(0)} minutes... ${timeToEnd.humanize()})<br>` string += `${Math.floor(beers)} beers. ${Math.floor(tickets)} tickets. (${Math.floor(beers % 95)} spare beers)<br>` let EP = (tickets*.7); string += `You can expect roughly ${(EP*30).toFixed(0)} Event Points. (Range ${Math.floor(EP*20)}-${Math.floor(EP*40)})<br>`; let RG = (tickets*.1); string += `You can expect roughly ${Math.floor(RG*6.5)} Red Gems. (Range ${Math.floor(RG*3)}-${Math.floor(RG*10)})<br>`; let RP = (tickets*.075); string += `You can expect roughly ${Math.floor(RP*4)} Raid Points. (Range ${Math.floor(RP*2)}-${Math.floor(RP*6)})<br>`; let RL = (tickets*.04); string += `You can expect roughly ${Math.floor(RL*3.5)} Raid Loots. (Range ${Math.floor(RL*2)}-${Math.floor(RL*7)})<br>`; let ET = (tickets*.045); string += `You can expect roughly ${Math.floor(ET*2.5)} Event Tickets. (Range ${Math.floor(ET*2)}-${Math.floor(ET*3)})<br>`; let AC = Math.floor(tickets*.01); string += `You can expect roughly ${Math.floor(AC)} Ancient Crystals.<br>`; string += `<br>Assuming 0.5% flat rate per crystal, individually:<br>Chance over ${tickets} tickets<br><br>`; string += `<table border="solid"><tr><td>Current<br>Crystals</td><td>Chance</td><td>Odds</td></tr>`; string += `<td><center>0</center></td><td>${ (1-Math.pow(0.975,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.975,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>1</center></td><td>${ (1-Math.pow(0.980,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.980,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>2</center></td><td>${ (1-Math.pow(0.985,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.985,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>3</center></td><td>${ (1-Math.pow(0.990,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.990,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>4</center></td><td>${ (1-Math.pow(0.995,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.995,tickets))*100) ).toFixed(0) }</td></tr>`; string += `</table>`; string += `<br><br>Assuming 1% flat rate per crystal, individually:<br>Chance over ${tickets} tickets<br><br>`; string += `<table border="solid"><tr><td>Current<br>Crystals</td><td>Chance</td><td>Odds</td></tr>` string += `<td><center>0</center></td><td>${ (1-Math.pow(0.950,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.950,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>1</center></td><td>${ (1-Math.pow(0.960,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.960,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>2</center></td><td>${ (1-Math.pow(0.970,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.970,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>3</center></td><td>${ (1-Math.pow(0.980,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.980,tickets))*100) ).toFixed(0) }</td></tr>`; string += `<td><center>4</center></td><td>${ (1-Math.pow(0.990,tickets) ).toFixed(5) }</td><td>1 in ${ ( 100 / ((1-Math.pow(0.990,tickets))*100) ).toFixed(0) }</td></tr>`; string += `</table>`; output.innerHTML = string;
}
inputTickets.addEventListener("input", function() { tickets = (Number(inputTickets.value) > 0) ? Number(inputTickets.value) : Math.floor(beers / 95)*5; doOutput();
})
doOutput();
Developer | Steven |
Username | volv |
Uploaded | October 05, 2022 |
Rating | 3 |
Size | 2,537 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Heavy Snake - Level Editor - Dev | 5,348 Kb |
Weather | 4,445 Kb |
Recursive Tree | 3,381 Kb |
JQuery Ajax | 1,690 Kb |
Midas Points | 19,443 Kb |
WK 15 Exercises | 9,460 Kb |
Squares Within Range | 2,853 Kb |
Closure Examples | 2,792 Kb |
Heavy Snake | 6,358 Kb |
Twitch Status | 4,190 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Angular-HAML | Cwacht | 2,022 Kb |
SVG Scalable Text | Said_FD | 1,451 Kb |
A Pen by Final Boss tommyb9 | FBtommyb9 | 55,354 Kb |
JQuery exercise | Brian-baum | 3,780 Kb |
A Pen by James Podles | Jpod | 2,656 Kb |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
Map Controls | Iliadraznin | 3,721 Kb |
Toggle Time | Petebot | 5,345 Kb |
Web Spiral - p5.js | TWAIN | 2,183 Kb |
Animated rainbow wave on canvas | Icodeforlove | 2,777 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!