QUOTE(LangTuTaiHoa @ Apr 21 2012, 20:49)
Doesn't work in Chrome for some reason. (IMG:[
invalid]
style_emoticons/default/sad.gif) It just opens as text. (IMG:[
invalid]
style_emoticons/default/unsure.gif) I've made some checking... Maybe it'll help.
Windows Script Host:line: 10
symbol: 1
error: 'location' - no definition
code: 800A1391
Java Script Lint:1 // ==UserScript==
2 // @name Monster lab timer
3 // @namespace
http://hentaiverse.org 4 // @version 1.0
5 // @description Displays the last time each monster has been checked
6 // @match
http://hentaiverse.org/?s=Bazaar&ss=ml* 7 // @copyright 2012+, You
8 // ==/UserScript==
9
10 if(location.href.indexOf('http://hentaiverse.org/?s=Bazaar&ss=ml&slot=') != -1)
11 {
12 var i = parseInt(location.href.substring(44, location.href.length));
======================================================================
^
lint warning: parseInt missing radix parameter13 localStorage.setItem('monster' + i + 'checktime', Date.now());
14 }
15 else
16 {
17 var monsters = document.getElementsByClassName('ms msa');
18 for(var i = 0; i < monsters.length; ++i)
============
^
warning: redeclaration of var i19 {
20 if(localStorage.getItem('monster' + (i + 1) + 'checktime') != null)
==========================================================================
^
lint warning: comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)21 {
22 var div = document.createElement("div");
23 div.style.cssText = "position:absolute; left:450px; width: 200px; padding-top: 7px; padding-right: 0px; padding-bottom: 0px; padding-left: 20px;font-weight:bold;display:block; ";
24 var time = Math.round(((Date.now() - localStorage.getItem('monster' + (i + 1) + 'checktime')) / 1000));
25 var hour = Math.floor(time / 3600);
26 var minute = Math.floor((time - hour * 3600) / 60);
27 if(minute < 10)
28 minute = '0' + minute.toString();
================
^
lint warning: block statement without curly braces29 var second = (time - hour * 3600) - (minute * 60);
30 if(second < 10)
31 second = '0' + second.toString();
================
^
lint warning: block statement without curly braces32 var display = hour + ':' + minute + ':' + second;
33 //var display = ' ' + hour.toString() + ':' + minute < 10 ? '0' + minute.toString() : minute.toString() + ':' + second < 10 ? '0' + second.toString() : second.toString();
34 div.innerText = 'Time since last check: ' + display;
35 monsters[i].appendChild(div);
36 }
37 }
38 }
This post has been edited by Evil Scorpio: Apr 21 2012, 19:23