Advertisement
r1zsa

jquery

May 1st, 2022 (edited)
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. var tf = 0;
  2.  
  3. setInterval(function () {
  4. var unlock_map_end=0;
  5. var sorok_szama = 0, fragek_szama = 0, text = "", neirjki = 0; var top_frag = 0; var msg, msg2 = [];
  6. var ranks_temp = [], frags_temp = [], names_temp = [], rank_perm = [], frags_perm = [], name_perm = [];
  7. var names_temp = $("#players tbody tr td:first-of-type()");
  8. var frags_temp = $("table#players tbody tr td:nth-of-type(2)");
  9.  
  10. tf = $("table#players tbody tr:first-of-type td:nth-of-type(2)").text(); tp = $("table#players tbody tr:first-of-type td:nth-of-type(1)").text();
  11.  
  12.  
  13. if(tf > top_frag) {
  14. var datum = new Date($.now()).toLocaleString();
  15. top_frag = tf;
  16.  
  17. names_temp.each(function (index) {
  18. msg += $(this).text();
  19.  
  20. });
  21. frags_temp.each(function (index) {
  22. frags_perm[index] = $(this).text();
  23. msg += $(this).text();
  24.  
  25. });
  26.  
  27. msg2 = "<" + datum.toLocaleString() + "> ";
  28. names_temp.each(function (index) {
  29. msg2 += + " " + (index)+1 + ". " + $(this).text() + " " + frags_perm[index] + "K\t";
  30. });
  31. console.log(msg2);
  32. unlock_map_end = 0;
  33.  
  34. }
  35. else {
  36. if(tf > 0) {
  37. // New map
  38.  
  39. if (unlock_map_end==0) {
  40. var datum = new Date($.now()).toLocaleString();
  41. msg = datum;
  42.  
  43. names_temp.each(function (index) { msg += $(this).text(); });
  44. frags_temp.each(function (index) { frags_perm[index] = $(this).text(); msg += $(this).text();
  45. });
  46. msg2 = "<" + datum.toLocaleString() + "> New map # Scoreboard # ";
  47. names_temp.each(function (index) {
  48. msg2 += + " " + (index)+1 + ". " + $(this).text() + " " + frags_perm[index] + "K\t";
  49. })
  50. console.log(msg2);
  51. unlock_map_end = 1;
  52. }
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. }
  60. else {
  61. }
  62. }
  63.  
  64. },4000);
  65.  
  66.  
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement