Monchoman45

Hax

Sep 12th, 2011
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Note to self - create a UI for modification without a console, minify for execution from javascript: url
  2.  
  3. function repeatMissions(mission, mins, quant) {
  4.     var list = document.getElementById('missions_table').getElementsByTagName('img');
  5.     for(var i in list) {
  6.         if(list[i].className == 'item_image' && list[i].alt.replace(/_/g, ' ').toLowerCase() == mission.toLowerCase()) {
  7.             var id = list[i].src.substring(list[i].src.lastIndexOf('?') + 1, list[i].src.length);
  8.             break;
  9.         }
  10.     }
  11.     if(!id) {throw new ReferenceError('Unable to extract id for given mission');}
  12.     if(!quant || quant == 1) {document.getElementById('select_fleet_link_' + id).getElementsByTagName('a')[0].onclick();}
  13.     else {document.getElementById('batch_selector_' + id).getElementsByTagName('a')[quant].onclick();}
  14.     setTimeout('repeatMissions(' + id + ',' + mins + ((quant) ? ',' + quant : '') + ')', (mins * 60 * 1000) + Math.random(3000, 12500) - 5000);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment