Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2016
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. // works incorrectly if you refresh
  2. overflow = $(".robin-user-list-overflow-indicator");
  3. if (typeof(overflow === 'undefined')) {
  4. addU = 0;
  5. }
  6. else {
  7. addU = - - $(".robin-user-list-overflow-indicator").html().split(" ")[1] - 1;
  8. }
  9. users = $('#robinUserList').children().length + addU;
  10. coef = (users / Math.min(201, users));
  11. str = "";
  12. a = [];
  13. b = $(".robin-message--from");
  14. endsIn = - - $(".robin-message--message")[1].innerHTML.split(" ")[5];
  15. if (!(endsIn < 0) && !(endsIn > 0)) { // if is NaN
  16. endsIn = 31
  17. }
  18. timeSinceStart = (Date.now() - Date.parse($(".robin-message--timestamp").attr("datetime")));
  19. tillEnd = 1000 * 60 * (endsIn) - timeSinceStart;
  20. mps = Math.floor((b.length / timeSinceStart) * 100000) / 100;
  21.  
  22. for (var i = 0; i < b.length; ++i) {
  23. str = b[i].innerHTML;
  24. if (a.indexOf(str) === -1) {
  25. a.push(str);
  26. }
  27. }
  28. $(".text-counter-input").val('Stats 1.5:' +
  29. ' USERS: ' + users +
  30. ' LURKERS: ' + (users - a.length + 2) +
  31. ' | G:' + Math.floor($('#robinUserList > .robin--vote-class--increase').length * coef) +
  32. ' | S:' + Math.floor($('#robinUserList > .robin--vote-class--continue').length * coef) +
  33. ' | A:' + Math.floor($('#robinUserList > .robin--vote-class--abandon').length * coef) +
  34. ' | N: ' + Math.floor($('#robinUserList > .robin--vote-class--novote').length * coef) +
  35. ' | M:' + $(".robin-message").length +
  36. " | mps: " + mps +
  37. " | mpmu: " + (Math.floor((mps / users) * 10000 * 60) / 10000) +
  38. " End in " + Math.floor((tillEnd / 60000) * 100) / 100 + " min "
  39. ).submit();
  40.  
  41. setTimeout(function() {$(".text-counter-input").val("Explanation: [G]row, [S]tay, [A]bandon, [N]ot particiapting. mps: total messages per second. mpmu: messages per minute per user.").submit()}, 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement