Created
October 31, 2013 00:53
-
-
Save jarekb84/7242839 to your computer and use it in GitHub Desktop.
Revisions
-
jarekb84 created this gist
Oct 31, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ (function(){ //For todays date; Date.prototype.today = function(){ return this.getFullYear() + "/" + (((this.getMonth()+1) < 10)?"0":"") + (this.getMonth()+1) +"/"+ ((this.getDate() < 10)?"0":"") + this.getDate() }; //For the time now Date.prototype.timeNow = function(){ return ((this.getHours() < 10)?"0":"") + this.getHours() +":"+ ((this.getMinutes() < 10)?"0":"") + this.getMinutes() +":"+ ((this.getSeconds() < 10)?"0":"") + this.getSeconds(); }; var junkItems = [ ['itemtype100','Tiny Ruby'], ['itemtype101','Small Ruby'], ['itemtype102','Big Ruby'], ['itemtype110','Tiny Diamond'], ['itemtype111','Small Diamond'], ['itemtype112','Big Diamond'], ['itemtype120','Tiny Amethyst'], ['itemtype121','Small Amethyst'], //['itemtype122','Big Amethyst'], ['itemtype130','Tiny Sapphire'], ['itemtype131','Small Sapphire'], ['itemtype132','Big Sapphire'], ['itemtype140','Tiny Starstone'], ['itemtype141','Small Starstone'], ['itemtype142','Big Starstone'] ] function sellJunk(){ junkItems.every(function(item) { var stash = document.getElementsByClassName('content box ui-sortable')[0], found = stash.getElementsByClassName(item[0])[0]; if (found) { var sellAction = found.getElementsByClassName('sell')[0]; sellAction.click(); var soldTime = new Date(); console.log(item[1] + " sold " + soldTime.today() + " @ " + soldTime.timeNow() ); return false; } return true; }); } var sellJunkInterval = setInterval(sellJunk, 1000); }());