A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Re: Balance To Real Life Money Converter - Stikked
From Obese Crane, 6 Years ago, written in JavaScript.
This paste is a reply to Balance To Real Life Money Converter from TEKNO - view diff
Embed
  1. // ==UserScript==
  2. // @name         Balance to Real Life Money Converter
  3. // @version      7.0
  4. // @description  This script shows your how much would your Gamdom balance cost in real life.
  5. // @author       TEKNO and Johannes Joestar
  6. // @match        https://gamdom.com/*
  7. // @grant        none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11.     var currency;
  12.     var customRateVal = 1100;
  13.     var added = false;
  14.     var newBalance = 0;
  15.     var cur;
  16.  
  17.     if (window.top != window.self){
  18.         return;
  19.     }
  20.  
  21.     if(localStorage.getItem("currency") === null) {
  22.         localStorage.setItem("currency", prompt("Please enter your currency's international currency code."));
  23.     }
  24.     else {
  25.         currency = localStorage.getItem("currency");
  26.     }
  27.  
  28.     function getCurrency() {
  29.         var HttpClient = function() {
  30.             this.get = function(aUrl, aCallback) {
  31.                 var anHttpRequest = new XMLHttpRequest();
  32.                 anHttpRequest.onreadystatechange = function() {
  33.                     if (anHttpRequest.readyState == 4 && anHttpRequest.status == 200)
  34.                         aCallback(anHttpRequest.responseText);
  35.                 };
  36.                 anHttpRequest.open( "GET", aUrl, true );
  37.                 anHttpRequest.send( null );
  38.             };
  39.         };
  40.  
  41.         var client = new HttpClient();
  42.         client.get('https://free.currencyconverterapi.com/api/v5/convert?q=USD_'+currency+'&compact=y', function(response) {
  43.             var val = response.indexOf("\"val\"")+6;
  44.             var par = response.indexOf("}}");
  45.             cur = response.substring(
  46.                 response.lastIndexOf("\"val\"")+6,
  47.                 response.lastIndexOf("}}")
  48.             );
  49.             if (cur == "{}") {
  50.                 var wrongcur = prompt("The currency you have entered couldn't be found. Please enter your currency's international currency code.");
  51.                 if(wrongcur === "" || wrongcur === null || wrongcur === undefined) {
  52.                     alert("You can't set your new currency to blank. Please try again.");
  53.                     getCurrency();
  54.                 }
  55.                 else{
  56.                     localStorage.setItem("currency", wrongcur);
  57.                     currency = wrongcur;
  58.                     getCurrency();
  59.                 }
  60.             }
  61.             console.log("Current USD to "+currency+" = "+cur);
  62.             if(document.getElementById("main_money")) {
  63.                 balanceUpdate();
  64.             }
  65.         });
  66.     }
  67.  
  68.     function addDiv() {
  69.         if(document.cookie.includes("use_design=old")) {
  70.             if(document.getElementsByClassName("balance").length > 0) {
  71.                 clearTimeout(addDiv);
  72.                 var mainul = document.getElementsByClassName("nav navbar-nav navbar-right")[0];
  73.                 var mainli = document.createElement("li");
  74.                 var maina = document.createElement("a");
  75.                 var maindiv = document.createElement("div");
  76.                 var mainspan = document.createElement("span");
  77.                 var mainbalspan = document.createElement("span");
  78.                 mainli.setAttribute("class", "balance-bits");
  79.                 maina.setAttribute("title", "Change your currency.");
  80.                 maina.addEventListener("click", function() {
  81.                     var newcur = prompt("Please enter your new currency.");
  82.                     if(newcur === "" || newcur === null || newcur === undefined) {
  83.                         alert("You can't set your new currency to blank. Please try again.");
  84.                     }
  85.                     else{
  86.                         localStorage.setItem("currency", newcur);
  87.                         currency = newcur;
  88.                         getCurrency();
  89.                         setTimeout(function() { balanceUpdate(); }, 1000);
  90.                     }
  91.                 });
  92.                 maina.setAttribute("style", "padding-left: 5px;padding-right: 5px;");
  93.                 document.getElementsByClassName("balance-bits")[0].firstChild.setAttribute("style", "padding-left: 5px;padding-right: 5px;");
  94.                 document.getElementsByClassName("logout")[0].setAttribute("style", "padding-left: 5px;padding-right: 5px;");
  95.                 maindiv.setAttribute("class", "balanceDiv");
  96.                 mainspan.setAttribute("class", "balance");
  97.                 mainbalspan.setAttribute("id", "main_money");
  98.                 mainbalspan.setAttribute("style", "transition: background-color 1s ease-in-out, color, opacity;");
  99.                 mainspan.appendChild(mainbalspan);
  100.                 maindiv.appendChild(mainspan);
  101.                 maina.appendChild(maindiv);
  102.                 mainli.appendChild(maina);
  103.                 mainul.insertBefore(mainli, mainul.childNodes[2]);
  104.                 var mobileul = document.getElementsByClassName("navbar-header")[0];
  105.                 var mobilediv = document.createElement("div");
  106.                 var mobilespan = document.createElement("span");
  107.                 var mobilebalspan = document.createElement("span");
  108.                 mobilediv.setAttribute("class", "mob-balance-bits");
  109.                 mobilespan.setAttribute("class", "balance");
  110.                 mobilebalspan.setAttribute("id", "mobile_money");
  111.                 mobilebalspan.addEventListener("click", function() {
  112.                     var newcur = prompt("Please enter your new currency.");
  113.                     if(newcur === "" || newcur === null || newcur === undefined) {
  114.                         alert("You can't set your new currency to blank. Please try again.");
  115.                     }
  116.                     else{
  117.                         localStorage.setItem("currency", newcur);
  118.                         currency = newcur;
  119.                         getCurrency();
  120.                         setTimeout(function() { balanceUpdate(); }, 1000);
  121.                     }
  122.                 });
  123.                 mobilebalspan.setAttribute("style", "transition: background-color 1s ease-in-out, color, opacity;");
  124.                 mobilespan.appendChild(mobilebalspan);
  125.                 mobilediv.appendChild(mobilespan);
  126.                 mobileul.insertBefore(mobilediv, mobileul.childNodes[2]);
  127.                 var balance = document.getElementById("balance").lastChild.innerText;
  128.                 balance = balance.replace(/\s/g, '');
  129.                 if(customRateVal === 0) { newBalance = Math.round(Number(balance) / 1000 * cur * 100) / 100; }
  130.                 else { newBalance = Math.round(Number(balance) / customRateVal * cur * 100) / 100; }
  131.                 document.getElementById("main_money").innerText = "~"+newBalance+" "+currency;
  132.                 document.getElementById("mobile_money").innerText = "~"+newBalance+" "+currency;
  133.             }
  134.             else{
  135.                 setTimeout(addDiv, 500);
  136.             }
  137.         } else{
  138.             if(document.querySelector(".menu_item_deposit")) {
  139.                 clearTimeout(addDiv);
  140.                 var mainlist = document.querySelector(".menus");
  141.                 var bala = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.parentNode.cloneNode(true);
  142.                 bala.lastChild.innerText = "Change Currency";
  143.                 bala.firstChild.firstChild.remove();
  144.                 bala.firstChild.firstChild.firstChild.innerText = "~0 " + currency;
  145.                 bala.setAttribute("title", "Change your currency.");
  146.                 bala.addEventListener("click", function() {
  147.                     var newcur = prompt("Please enter your new currency.");
  148.                     if(newcur === "" || newcur === null || newcur === undefined) {
  149.                         alert("You can't set your new currency to blank. Please try again.");
  150.                     }
  151.                     else{
  152.                         localStorage.setItem("currency", newcur);
  153.                         currency = newcur;
  154.                         getCurrency();
  155.                         setTimeout(function() { balanceUpdate(); }, 1000);
  156.                     }
  157.                 });
  158.                 bala.firstChild.firstChild.firstChild.setAttribute("id", "main_money");
  159.                 bala.removeAttribute("href");
  160.                 mainlist.insertBefore(bala, document.querySelector(".icon-marketplace").parentNode);
  161.                 var mobilelist = document.querySelector(".menu_links");
  162.                 var mobilebala = document.querySelector(".mob_deposit").cloneNode(true);
  163.                 mobilebala.lastChild.innerText = "Change Currency";
  164.                 mobilebala.firstChild.firstChild.remove();
  165.                 mobilebala.firstChild.firstChild.firstChild.innerText = "~0 " + currency;
  166.                 mobilebala.setAttribute("title", "Change your currency.");
  167.                 mobilebala.addEventListener("click", function() {
  168.                     var newcur = prompt("Please enter your new currency.");
  169.                     if(newcur === "" || newcur === null || newcur === undefined) {
  170.                         alert("You can't set your new currency to blank. Please try again.");
  171.                     }
  172.                     else{
  173.                         localStorage.setItem("currency", newcur);
  174.                         currency = newcur;
  175.                         getCurrency();
  176.                         setTimeout(function() { balanceUpdate(); }, 1000);
  177.                     }
  178.                 });
  179.                 mobilebala.firstChild.firstChild.firstChild.setAttribute("id", "mobile_money");
  180.                 mobilebala.removeAttribute("href");
  181.                 mobilelist.insertBefore(mobilebala, mobilelist.querySelector(".menus"));
  182.                 var balance = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.lastChild.innerText;
  183.                 balance = balance.replace(/\s/g, '');
  184.                 if(customRateVal === 0) { newBalance = Math.round(Number(balance) / 1000 * cur * 100) / 100; }
  185.                 else { newBalance = Math.round(Number(balance) / customRateVal * cur * 100) / 100; }
  186.                 document.getElementById("main_money").innerText = "~"+newBalance+" "+currency;
  187.                 document.getElementById("mobile_money").innerText = "~"+newBalance+" "+currency;
  188.             }
  189.             else{
  190.                 setTimeout(addDiv, 500);
  191.             }
  192.         }
  193.     }
  194.  
  195.     function balanceUpdate() {
  196.         var mainmoney = document.getElementById("main_money");
  197.         var mobilemoney = document.getElementById("mobile_money");
  198.         if(document.cookie.includes("use_design=old")) {
  199.             var balance = document.getElementById("balance").lastChild.innerText;
  200.         } else{
  201.             var balance = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.lastChild.innerText;
  202.         }
  203.         balance = balance.replace(/\s/g, '');
  204.         if(customRateVal === 0) { newBalance = Math.round(Number(balance) / 1000 * cur * 100) / 100; }
  205.         else { newBalance = Math.round(Number(balance) / customRateVal * cur * 100) / 100; }
  206.         mainmoney.innerText = "~"+newBalance+" "+currency;
  207.         mobilemoney.innerText = "~"+newBalance+" "+currency;
  208.     }
  209.  
  210.     function balanceCheck() {
  211.         if(document.cookie.includes("use_design=old")) {
  212.             if(document.querySelectorAll('span.balance').length > 0) {
  213.                 clearTimeout(balanceCheck);
  214.                 function mutate(mutations) {
  215.                     mutations.forEach(function(mutation) {
  216.                         balanceUpdate();
  217.                     });
  218.                 }
  219.  
  220.                 var target = document.querySelectorAll('span.balance')[2].lastChild;
  221.                 var observer = new MutationObserver( mutate );
  222.                 var config = { characterData: true, attributes: true, childList: true, subtree: true };
  223.  
  224.                 observer.observe(target, config);
  225.             }
  226.             else {
  227.                 setTimeout(balanceCheck,500);
  228.             }
  229.         } else{
  230.             if(document.querySelector(".menu_item_deposit")) {
  231.                 clearTimeout(balanceCheck);
  232.                 function mutate(mutations) {
  233.                     mutations.forEach(function(mutation) {
  234.                         balanceUpdate();
  235.                     });
  236.                 }
  237.  
  238.                 var target = document.querySelector(".menus").querySelector(".icon-gammdom-symbol").parentNode.lastChild.firstChild;
  239.                 var observer = new MutationObserver( mutate );
  240.                 var config = { characterData: true, attributes: true, childList: true, subtree: true };
  241.  
  242.                 observer.observe(target, config);
  243.             }
  244.             else {
  245.                 setTimeout(balanceCheck,500);
  246.             }
  247.         }
  248.     }
  249.  
  250.     getCurrency();
  251.     addDiv();
  252.     balanceCheck();
  253. })();