Advertisement
Guest User

Whos Not Signed

a guest
Nov 17th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. //you need to have the alliance chat window open, saloon chat closed, and the fort screen open with recruitment screen up
  2.  
  3. var results = '';
  4. $('.row.battlestat.tw_red').children('.battle_nam').each(function(){results += $(this).html() + '<br>'});
  5. $('.tw2gui_scrollpane_clipper_contentpane','#battle_stat').html('<div>' + results + '</div>')
  6.  
  7.  
  8. //start of jarocode
  9. num_eles = document.querySelectorAll(".chat_contacts .client_name");
  10.  
  11. var team = [];
  12.  
  13. for (i = 0; i < num_eles.length; i++) {
  14. team.push(document.querySelectorAll(".chat_contacts .client_name")[i].innerText);
  15. }
  16. //end of jarocode
  17. var notSignedIn = [];
  18. var signedIn = [];
  19. //editted following line to select ".fort_battle_recruitlist_list" first
  20. $('.fort_battle_recruitlist_list .tw2gui_scrollpane_clipper_contentpane .player').each(function(){signedIn.push($(this).text())});
  21.  
  22. checkTeam();
  23.  
  24. function checkSignedIn(persontocheck){
  25. var found = false;
  26. for(var i = 0;i < signedIn.length;i++){
  27. if(signedIn[i].toLowerCase() == persontocheck.toLowerCase()){
  28. found = true;
  29. break;
  30. }
  31. }
  32. if(!found){
  33. notSignedIn.push(persontocheck);
  34. }
  35. }
  36.  
  37. function checkTeam(){
  38. for(var i = 0;i < team.length;i++){
  39. checkSignedIn(team[i])
  40. }
  41. /*
  42. var results = notSignedIn.length + ' players Not signed in\n\n';
  43. for(var i = 0;i < notSignedIn.length;i++){
  44. results += notSignedIn[i] + '\n';
  45. }
  46. alert(results)
  47. */
  48. prompt(notSignedIn.length + ' players Not signed in', notSignedIn.join('; '));
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement