NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name LoL Dragon/Baron Timer // @version 0.2 // @description When watching your game on riftwalk.gg it shows you the respawn time of Dragon/Baron. // @match http://www.riftwalk.gg/game/*/* // @copyright 2014+, Okon3 (https://github.com/okon3) // @updateURL https://openuserjs.org/install/okon3/LoL_DragonBaron_Timer.user.js // @oujs:author okon3 // ==/UserScript== var scrollTimer; var tempoD; var minutiD; var secondiD; var tempoB; var minutiB; var secondiB; $( document ).ready(function() { $('body').append('<div id="lolTimers"><p>Dragon: <span id="dragonTimer">00:00</span></p>Baron: <span id="baronTimer">00:00</span></p>'); $('#lolTimers').css({ 'position':'fixed', 'bottom':'50px', 'left':'50px', 'border-radius':'6px', 'border':'1px solid #000', 'padding':'5px', 'background': 'rgba(255, 255, 255, 0.8)' }); checkTimers(); scrollTimer = setInterval(function(){checkTimers()}, 5000); }); function checkTimers(){ var array = $('html').find('.event-log>div'); for(i = 0; i < array.length; i++){ if(array[i].innerText.search("Dragon") > -1){ tempoD = array[i].innerText.slice(1,array[i].innerText.search("]")); minutiD = tempoD.slice(0,tempoD.search(":")); secondiD = tempoD.slice(tempoD.search(":")+1,tempoD.length); minutiD = Number(minutiD) + 6; tempoD = minutiD + ":"+secondiD; } if(array[i].innerText.search("Baron") > -1){ tempoB = array[i].innerText.slice(1,array[i].innerText.search("]")); minutiB = tempoB.slice(0,tempoB.search(":")); secondiB = tempoB.slice(tempoB.search(":")+1,tempoB.length); minutiB = Number(minutiB) + 7; tempoB = minutiB + ":"+secondiB; } } if(typeof tempoD != 'undefined') $('#dragonTimer').html(tempoD); if(typeof tempoB != 'undefined') $('#baronTimer').html(tempoB); }