Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Slot Machine AutoSpin
- // @namespace emp
- // @include http://www.empornium.me/bonus.php?action=slot
- // @version 1
- // @grant none
- // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
- // ==/UserScript==
- // Tested on: Firefox 32.0.3, GreaseMonkey 2.2
- this.$ = this.jQuery = jQuery.noConflict(true);
- $(document).ready(function() {
- var credits_min = 1550000;
- var minimum_win = 10000;
- Change_Bet(); // Click the Bet once to change from 10 => 100
- $("input[type=checkbox]#playsound").prop("checked",false); // Turn sound off
- // Insert the AutoSpin control + warning message
- $('<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() ) ;
- function respin() {
- var curr_credits = Number($("span#winnings").text().replace(',',''));
- if ((curr_credits < credits_min) || isNaN(curr_credits)) {
- // Disable autospin if balance below credits_min credits or unable to calculate balance (NaN)
- $("input[type=checkbox]#autospin").prop("checked",false);
- $("span#autospin_warn").text("Autospin disabled, credits below " + credits_min).css('color','blue');
- } else if ($('input[type=checkbox]#autospin').prop("checked")) {
- // Only pull the lever again if there hasn't been a win
- if ($("h3#result").text().length === 0) {
- $("span#autospin_warn").text("").css('color','blue');
- setTimeout(Pull_Lever, 1500); // Wait 1.5 seconds and go again
- } else {
- $("span#autospin_warn").text("Paused because you won").css('color','blue');
- }
- }
- }
- $("span#winnings").bind('DOMNodeInserted',function(){
- // After the credits are updated wait 500ms for the h3#result "*Win* ???" to be set
- setTimeout(respin, 500);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement