Bookie Calculator

Calculates your total winnnings and profit in the Torn bookie

  1. // ==UserScript==
  2. // @name Bookie Calculator
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.2
  5. // @description Calculates your total winnnings and profit in the Torn bookie
  6. // @author LordBusiness
  7. // @match https://www.torn.com/bookie.php
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // a minimal jQuery library for reacting to innerHTML changes
  12. (function($) {
  13. $.fn.change = function(cb, e) {
  14. e = e || { subtree:true, childList:true, characterData:true };
  15. $(this).each(function() {
  16. function callback(changes) { cb.call(node, changes, this); }
  17. var node = this;
  18. (new MutationObserver(callback)).observe(node, e);
  19. });
  20. };
  21. })(jQuery);
  22.  
  23. var betTimer = setInterval(function() {
  24. if($(".bookie-main-wrap").length > 0) {
  25. betCalc();
  26. }
  27. }, 3000);
  28.  
  29. function betCalc() {
  30. if(($(".betRes").length == 0) && ($(".confirm-bet").length > 0)) {
  31. $('.confirm-bet').change(function(changes, observer) {
  32. try {
  33. var betMoney = $(this).text();
  34. betMoney = /\$[0-9,]+/gm.exec(betMoney);
  35. var origBetMoney = parseInt(betMoney[0].replace(/[^0-9]/g, ''));
  36. console.log("Cons = " +betMoney);
  37. var betMultiplier = $(this).parent("ul.item").children("li.multiplier").first().text();
  38. betMultiplier = parseFloat(betMultiplier.replace(/[^0-9.]/gi, ''));
  39. betMoney = parseInt(origBetMoney * betMultiplier);
  40. if(isNaN(betMoney))
  41. throw 666;
  42. $("span.betRes").html(" Win: $" + betMoney.toLocaleString() + " Profit: $" + (betMoney - origBetMoney).toLocaleString());
  43. }
  44. catch(err) {
  45. console.log("Err:" + err);
  46. }
  47. });
  48. $(".info-msg").find(".msg").append('<span class="betRes"></span>');
  49. }
  50. }
  51.  
  52. console.log("Made by LordBusiness. Send me something if you like it ;)");

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址