From f9ac7aa549b29e049b74dbb4b15e247c59110a71 Mon Sep 17 00:00:00 2001 From: Aktanusa Date: Sat, 16 Aug 2014 16:48:29 -0400 Subject: [PATCH] Fixed userscript section on README --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a74d24a..2fd0600 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,14 @@ If you'd rather use the addon as a script via per example *Greasemonkey* or *Tam // @grant none // ==/UserScript== -(function () { - Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js'); -}()); +javascript:(function() { + var checkReady = setInterval(function() { + if (Game.ready != undefined && Game.ready) { + Game.LoadMod('http://aktanusa.github.io/CookieMonster/CookieMonster.js'); + clearInterval(checkReady); + } + }, 1000); +}()); ``` # Bugs and suggestions