Gaia Booty Grab Auto Re-Sizer

Re-sizes the aquarium to reduce lag thus allowing higher scores.

  1. // ==UserScript==
  2. // @name Gaia Booty Grab Auto Re-Sizer
  3. // @description Re-sizes the aquarium to reduce lag thus allowing higher scores.
  4. // @include http://www.gaiaonline.com/tank/*?*
  5. // @include http://www.gaiaonline.com/aquariumViewer/FishTankViewer.html?*
  6. // @version 0.0.1.20140525024109
  7. // @namespace https://greasyfork.org/users/2178
  8. // ==/UserScript==
  9.  
  10. //settings
  11. var StartSize = 150; //sets how tall it is to start with (in pixels).
  12. var is = 25; //sets the buttons increase and decrease sizes in pixles.
  13. //function
  14. function resize(fx){
  15. var FishTank = document.getElementById('FishTank');
  16. var TnkHt = document.getElementById('TnkHt');
  17. var height = Number(FishTank.style.height.replace('px',''));
  18. var NewHeight = height+fx*is;
  19. if (NewHeight<0){NewHeight=0;}
  20. FishTank.style.height=NewHeight+'px';
  21. TnkHt.value=NewHeight;
  22. }
  23. if(document.body.offsetWidth>200){//avoid market preview
  24. //the following line makes the comment captcha stuff less blinding if you dont like it you can delete it.
  25. GM_addStyle('html{background-color:black;}#add_comment,#comment_box{text-align:center;}#recaptcha_image{opacity:.65}#recaptcha_response_field,#comment_body{background-color:gray !important;color:white}');
  26.  
  27. var FishTank = document.getElementById('FishTank');
  28. if(FishTank){
  29. //set default styles
  30. FishTank.width='100%';
  31. FishTank.style.height=StartSize+'px';
  32. FishTank.removeAttribute('height');
  33.  
  34. //set notification if flash can't find mouse
  35. FishTank.setAttribute('onmouseover','document.getElementById("alert").textContent=""');
  36. FishTank.setAttribute('onmouseout','document.getElementById("alert").textContent="Flash can\'t find mouse!!!"');
  37.  
  38. //insert input fields
  39. var NewDiv = document.createElement('div');
  40. NewDiv.setAttribute('style','font-size:15px;width:100%;height:23px');
  41. NewDiv.innerHTML='<span style="font-size:12px;float:left;margin-right:68px;"><input id="plus" value="+'+is+' pixles" onmouseover="this.focus()" type="button"/><input id="minus" value="-'+is+' pixles" onmouseover="this.focus()" type="button"/></span><span style="color: white;float:right;">Aquarium height is <input id="TnkHt" onmouseover="this.select();this.focus();" title="Press \'Enter\' to apply changes." onkeypress="if (event.which==13)document.getElementById(\'FishTank\').style.height=this.value+\'px\'" style="width:30px;position:relative;top:1px;" value="'+StartSize+'" type="text"> <span>pixels.</span></span><center><span id="alert" style="color: red;">Flash can\'t find mouse!!!</span></center>';
  42. FishTank.parentNode.insertBefore(NewDiv,FishTank);
  43.  
  44. //add event listener
  45. document.getElementById("plus").addEventListener('click', function(){ resize(1); }, false);
  46. document.getElementById("minus").addEventListener('click', function(){ resize(-1); }, false);
  47. }
  48. else{
  49. var input=document.createElement('input');
  50. input.value="Submit Captcha";
  51. input.type="submit";
  52. document.getElementById('tank_captcha').appendChild(input);
  53. }
  54. }