Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Neggfest Tarot Odds Calculator
- // @namespace http://tampermonkey.net/
- // @version 0.2
- // @description bored
- // @author Rippy
- // @match http*://*.neopets.com/neggfest/?playtarot=1
- // @icon https://www.google.com/s2/favicons?sz=64&domain=neopets.com
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let cards;
- const cardNum = 22;
- const _resetGameBoard = resetGameBoard;
- const _startTarotGame = startTarotGame;
- $("#TarotGameButtons").append("<div id='tarotOdds'></div>");
- function calculateOdds() {
- const current = parseInt($("#TarotCard1Num").text());
- cards.splice(cards.indexOf(current), 1);
- const higher = cards.filter(e => e > current);
- console.log(cards);
- console.log(higher);
- $("#tarotOdds").text(`Higher: ${(higher.length/cards.length * 100).toFixed(3)}% | Lower: ${((cards.length - higher.length)/cards.length * 100).toFixed(3)}%`);
- }
- startTarotGame = () => {
- cards = [...Array(cardNum).keys()];
- _startTarotGame();
- };
- resetGameBoard = () => {
- cards = [...Array(cardNum).keys()];
- _resetGameBoard();
- };
- const observer = new MutationObserver(calculateOdds);
- observer.observe(document.querySelector("#TarotCard1Num"), {childList: true});
- })();
Advertisement
Add Comment
Please, Sign In to add comment