Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Slot Machine AutoSpin
  3. // @namespace emp
  4. // @include http://www.empornium.me/bonus.php?action=slot
  5. // @version 1
  6. // @grant none
  7. // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
  8. // ==/UserScript==
  9. // Tested on: Firefox 32.0.3, GreaseMonkey 2.2
  10. this.$ = this.jQuery = jQuery.noConflict(true);
  11.  
  12. $(document).ready(function() {
  13.  
  14. var credits_min = 1550000;
  15.  
  16. var minimum_win = 10000;
  17.  
  18. Change_Bet(); // Click the Bet once to change from 10 => 100
  19. $("input[type=checkbox]#playsound").prop("checked",false); // Turn sound off
  20.  
  21. // Insert the AutoSpin control + warning message
  22. $('<span id="autospin_warn" style="color:red; font-weight:bold; margin-right:1em">No warranty expressed or implied, use at your own risk</span><label title="Pauses on wins, stops if credits below '+credits_min+'" for="autospid">AutoSpin</label> <input type="checkbox" id="autospin" name="autospin" value="1" style="margin-right:1em">').insertBefore( $("label[for=forcesound]").parent() ) ;
  23.  
  24. function respin() {
  25. var curr_credits = Number($("span#winnings").text().replace(',',''));
  26.  
  27. if ((curr_credits < credits_min) || isNaN(curr_credits)) {
  28. // Disable autospin if balance below credits_min credits or unable to calculate balance (NaN)
  29. $("input[type=checkbox]#autospin").prop("checked",false);
  30. $("span#autospin_warn").text("Autospin disabled, credits below " + credits_min).css('color','blue');
  31. } else if ($('input[type=checkbox]#autospin').prop("checked")) {
  32. // Only pull the lever again if there hasn't been a win
  33. if ($("h3#result").text().length === 0) {
  34. $("span#autospin_warn").text("").css('color','blue');
  35. setTimeout(Pull_Lever, 1500); // Wait 1.5 seconds and go again
  36. } else {
  37. $("span#autospin_warn").text("Paused because you won").css('color','blue');
  38. }
  39. }
  40. }
  41.  
  42. $("span#winnings").bind('DOMNodeInserted',function(){
  43. // After the credits are updated wait 500ms for the h3#result "*Win* ???" to be set
  44. setTimeout(respin, 500);
  45. });
  46.  
  47. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement