OWoT user indicator

leaks your ip (98.6%)

  1. // ==UserScript==
  2. // @name OWoT user indicator
  3. // @namespace https://greasyfork.org/scripts/458537-owot-online-and-offline
  4. // @version 10.4
  5. // @description leaks your ip (98.6%)
  6. // @author e_g.
  7. // @match https://ourworldoftext.com/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. let warn = true;
  13. let people = [];
  14. let timeout;
  15.  
  16. //Part made by KKosty4ka
  17. var chat_upper = document.getElementById("chat_upper");
  18. chat_upper.appendChild(document.createElement("br"));
  19. var typing_display = chat_upper.appendChild(document.createElement("span"));
  20. typing_display.style.display = "flex";
  21. typing_display.style.justifyContent = "center";
  22. typing_display.style.alignItems = "center";
  23. //Part made by KKosty4ka
  24.  
  25. menu.addCheckboxOption('Online Offline warning', function(){
  26. warn = true;
  27. }, function(){
  28. warn = false;
  29. }, true);
  30.  
  31. w.broadcastReceive(true);
  32. w.on('cmd', function(e){
  33. if(!e.username || !warn) return;
  34. if(e.data.startsWith('online')){
  35. clientChatResponse(e.username + " is online!");
  36. }
  37. else if(e.data.startsWith('offline')){
  38. clientChatResponse(e.username + " is now offline.");
  39. }
  40. else if(e.data.startsWith('back')){
  41. clientChatResponse(e.username + " is back.");
  42. }
  43. else if(e.data.startsWith('afk')){
  44. clientChatResponse(e.username + " is AFK. (Idle)");
  45. }
  46. else if(e.data.startsWith('typing')){
  47. if(!people.includes(e.username)) people.push(e.username);
  48. typing_display.innerText = people.join(" and ") + " " + (people.length > 1 ? "are" : "is") + " typing...";
  49. }
  50. else if(e.data.startsWith('untyping')){
  51. people = people.filter((x, i)=>i != people.indexOf(e.username))
  52. typing_display.innerText = people.length ? people.join(" and ") + " " + (people.length > 1 ? "are" : "is") + " typing..." : "Currently, no one is typing";
  53. };
  54. });
  55.  
  56. setTimeout(function(){
  57. w.broadcastCommand('online', true);
  58. }, 1000);
  59.  
  60. window.addEventListener('beforeunload', function(){
  61. w.broadcastCommand('offline', true)
  62. });
  63.  
  64. window.onblur = function(){w.broadcastCommand('afk', true)};
  65.  
  66. window.onfocus = function(){w.broadcastCommand('back', true)};
  67.  
  68. elm.chatbar.oninput = function(e){
  69. if(timeout) clearTimeout(timeout);
  70. if(!elm.chatbar.value.length) w.broadcastCommand("untyping", true);
  71. if(!!elm.chatbar.value.length && !people.includes(state.userModel.username)) w.broadcastCommand('typing', true);
  72. timeout = setTimeout(function(){
  73. w.broadcastCommand("untyping", true);
  74. }, 5000);
  75. };