Advertisement
Guest User

Primedice 3 Console Scripts

a guest
Dec 24th, 2014
1,553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // @Combination of PrimeDice 3 scripts Compiled by DaNksta
  2. // @Contains:
  3. // @PDDark Skin by Paradocks
  4. // @Faucet Timer (draggable and can show/hide with CTRL + ALT + Z)
  5. // @New BASE bet button - Sets your bet amount to whatever you want. Set this by clicking on the dice icon.
  6. // @REFRESH BALANCE (bets 0.00000000) by clicking on the B next to your balance.
  7.  
  8.  
  9. // @Add A new button near MAX, 1/2, and 2x buttons. Set its value by clicking the two dice logo above them.
  10. var basebet = 0.00000001;
  11. basebet = basebet.toFixed(8);
  12. $('.icon--dice').click(function() {
  13.     basebet = prompt("What would you like your basebet to be?", "0.00000000");
  14. });
  15. $('<button id="basebet" class="btn btn--submit grid__item one-third" >Base</button>').insertAfter('div button:nth(3)');
  16. $('#basebet').click(function() {
  17.     $('.hero__main input:first').val(basebet).change();
  18. });
  19. $('.icon--balance').attr('data-ember-action', '');
  20. $('.icon--balance').click(function() {
  21.     $('.hero__main input:first').val(0).change();
  22.     setTimeout(function() {
  23.         $('#spinner').click();
  24.     }, 500);
  25. });
  26.  
  27.  
  28. // ==UserScript==
  29. // @name         PD3 Dark
  30. // @version      0.1
  31. // @description  enter something useful
  32. // @author       paradocks
  33. // ==/UserScript==
  34.  
  35. var css = '',
  36.  
  37. // Change the URL below in quotes for a custom background image.
  38. backgroundurl = 'http://cdn.wonderfulengineering.com/wp-content/uploads/2014/01/HD-backgrounds-3.jpg';
  39.  
  40. // CSS
  41. css += '<style>';
  42. css += 'header, .tabs, .slideout__content__inside, .chat__you *, .btn, .hero__main, .rollrow-dark, .rollbox--prominent, .chat__input-holder{background-color:#121212 !important;color:#ccc !important;}';
  43. css += 'time{color:#ccc !important;}';
  44. css += 'div.tabs > div > div.live-data-header > div{background-color:#111111;border-top:1px solid #777; border-bottom:1px solid #777;}';
  45. css += '.btn,.btn--secondary.btn--active,.btn--secondary.btn--selector, .btn--submit:last-child{border:1px solid #777 !important;background-color:#242130 !important;color:#ccc!important;}';
  46. css += '.btn:hover,.btn--secondary.btn--active:hover,.btn--secondary.btn--selector:hover{border:1px solid #777 !important;background-color:#322E47 !important;color:#ccc!important;}';
  47. css += '.hero{margin-bottom:0px;background:url("'+ backgroundurl + '") no-repeat 50% 50%;}';
  48. css += '.slideout *{color:#ccc;}';
  49. css += '.tabs{padding-top:20px;border-top:1px solid #777 !important;}';
  50. css += 'header{border: 1px solid #777 !important;border-left:none !important;border-right:none !important;}';
  51. css += '.rollrow-thin, .rollrow-dark .chat__input-holder {background-color:#212121;}';
  52. css += '.input{background-color:#323232 !important;color:#ccc;}';
  53. css += '.action-open-slideout{background-color:#121212 !important;}';
  54. css += 'span.admin{color:red !important}';
  55.  
  56. // Uncomment (remove // from two lines below) to Remove Site Header & Max Bet Button
  57. // css += '.theme-switch, .header-main, .hero  button:nth-child(3) {display:none;}';
  58. // css += '.slideout, body{padding-top:0px !important; }';
  59.  
  60. css += '</style>';
  61. $(css).appendTo('head');
  62. // PD3Dark End
  63. /*
  64. //      PD3 Faucet Timer
  65. //      Created by Serlite
  66. //
  67. //      (Hide using Ctrl + Alt + Z)
  68. */
  69.  
  70. var sinceLastClaim = 0;
  71. var $fTimer = null;
  72. var $fTimerWrapper = null;
  73. var fIntervalRef = null;
  74. var fTimerHider = {17: false, 18: false, 90:false};
  75.  
  76. initializeTimer();
  77.  
  78. // Creates GUI and begins timer countdown
  79. function initializeTimer(){
  80.  
  81.         if (!window.jQuery.ui){
  82.                 $("body").append("<script src='//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.js'></script>");
  83.         }
  84.  
  85.         // Delay to allow jQuery UI to load
  86.         setTimeout(function(){
  87.                 $("body").append("<div class='faucet-timer' style='background:#FFF; border:2px solid #b4b9cd; position:fixed; z-index:9999; top:100px; left:200px; color:#6d738c; padding:15px; font-size:1em'><p style='margin-bottom:10px;'>Since last claim:</p><p><span class='time-counter' style='font-weight:bold;'>00:00</span></p></div>");
  88.  
  89.                 // Caching reference
  90.                 $fTimer = $(".faucet-timer .time-counter");
  91.                 $fTimerWrapper = $(".faucet-timer");
  92.                 $fTimerWrapper.draggable();
  93.  
  94.                 fIntervalRef = setInterval(updateFaucetTime, 1000);
  95.  
  96.                 // Reset timer if claim button is pressed
  97.                 $(document).on("click", "button.btn.btn--primary.btn--huge.btn--block", function(){
  98.                         if ($(this).text() == "Claim"){
  99.                                 sinceLastClaim = 0;
  100.                                 writeFaucetTime(formattedFaucetTime());
  101.                                 setTimerCol();
  102.  
  103.                                 // Reset interval ensure precision
  104.                                 clearInterval(fIntervalRef);
  105.                                 fIntervalRef = setInterval(updateFaucetTime, 1000);
  106.                         }
  107.                 });
  108.  
  109.                 // Register key down in combo
  110.                 $(document).keydown(function(e){
  111.                         if (e.keyCode in fTimerHider){
  112.                                 fTimerHider[e.keyCode] = true;
  113.  
  114.                                 // Ctrl + Alt + Z, toggle visible
  115.                                 if (fTimerHider[17] && fTimerHider[18] && fTimerHider[90]){
  116.                                         $fTimerWrapper.toggle();
  117.                                 }
  118.                         }
  119.                 });
  120.  
  121.                 // Register key up in combo
  122.                 $(document).keyup(function(e){
  123.                         if (e.keyCode in fTimerHider){
  124.                                 fTimerHider[e.keyCode] = false;
  125.                         }
  126.                 });
  127.  
  128.         }, 800);
  129. }
  130.  
  131. // Increment timer value
  132. function updateFaucetTime(){
  133.         sinceLastClaim++;
  134.         writeFaucetTime(formattedFaucetTime());
  135.         setTimerCol();
  136. }
  137.  
  138. // Format time into more readable string
  139. function formattedFaucetTime(){
  140.         var minutes = Math.floor(sinceLastClaim/60).toString();
  141.         var seconds = (sinceLastClaim%60).toString();
  142.  
  143.         // Adding leading zeroes
  144.         if (minutes.length == 1){
  145.                 minutes = "0" + minutes;
  146.         }
  147.         if (seconds.length == 1){
  148.                 seconds = "0" + seconds;
  149.         }
  150.  
  151.         return (minutes + ":" + seconds);
  152. }
  153.  
  154. // Change timer text
  155. function writeFaucetTime(faucetTime){
  156.         $fTimer.text(faucetTime);
  157. }
  158.  
  159. // Change colour according to time
  160. function setTimerCol(){
  161.         if (sinceLastClaim >= 180){
  162.                 $fTimer.css("color","#5fb365");
  163.         }
  164.         else{
  165.                 $fTimer.css("color","#6d738c");
  166.         }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement