Battle Helper

Forumwarz.com - Shows battle information in titlebar.

  1. // ==UserScript==
  2. // @version 1.0
  3. // @name Battle Helper
  4. // @author DG-Root
  5. // @description Forumwarz.com - Shows battle information in titlebar.
  6. // @include http://forumwarz.com/forums/battle
  7.  
  8. // @include http://*.forumwarz.com/forums/battle
  9.  
  10. // @namespace https://greasyfork.org/users/121268
  11. // ==/UserScript==
  12. /*
  13. History:
  14. 05.06.2010 - v1.0 - First version uploaded to userscripts.org
  15. */
  16. window.strForum = document.title.split('Forumwarz - ')[1];
  17. window.numPwnageLeft = 0;
  18. window.numPwnageDone = 0;
  19. window.numPwnageMax = 0;
  20.  
  21. window.updateBattleInfo = function(){
  22. // Get data from the document.
  23. // > Get thread pwnage.
  24. if(document.getElementById('enemy_property_bar_pwnage_values')!=null){
  25. tempArray = document.getElementById('enemy_property_bar_pwnage_values').innerHTML.split(' / ');
  26. numPwnageMax = (+tempArray[1]);
  27. numPwnageDone = (+tempArray[0]);
  28. numPwnageLeft = numPwnageMax-numPwnageDone;
  29. }
  30.  
  31. // Set the titlebar to show information.
  32. document.title = numPwnageLeft+ "p";
  33. // Re-run the script in a second.
  34. setTimeout(updateINCITinfo, 1000);
  35. }
  36.  
  37. updateBattleInfo();