Greasy Fork

Grepolis Claim / Loot Alarm

Gives an alarm after X seconds you chose to

目前为 2016-04-06 提交的版本。查看 最新版本

// ==UserScript==
// @name         Grepolis Claim / Loot Alarm
// @namespace    http://smafe.com
// @version      0.1
// @description  Gives an alarm after X seconds you chose to 
// @author       Smafe Web Solutions
// @match        https://no23.grepolis.com/game/*
// ==/UserScript==

$( document ).ready( function() {
    
    var running = false;
    
    myAudio = new Audio( 'http://zed.wearelogik.com/grepolis-claimed.mp3' );
    myAudio.addEventListener( 'ended', function() {
        this.currentTime = 0;
        this.play();
    }, false );
    
    $( 'body' ).on( 'click', '#fto_claim_button', function() {
        
        var time = $( '#time_options_wrapper .fto_time_checkbox.active' ).attr( 'data-option' );
        
        if( running ) {
            myAudio.pause();
            running = false;
        }
        
        setTimeout( function() {
            running = true;
            myAudio.play();
        }, 10000 );
        
    } );
    
});