Advertisement
Guest User

Omegle

a guest
Apr 1st, 2020
702
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. // @name Omegle E-Whore Bot V0.1
  2. // @version 0.1
  3. // @description Sends 1 message then disconnects.
  4. // @author Advisory
  5. // @match https://www.omegle.com/*
  6.  
  7. (function() {
  8. 'use strict';
  9. var options = {
  10. greetingMessage : "Hello, I'm 21 F from Indiana and my names Emily. You can add my Kik at Elafferty143",
  11. disconnectOnIdle : {
  12. enabled: true,
  13. timeout: 20 * 1000,
  14. timeoutId : null
  15. }
  16. },
  17. BreakException = {},
  18. targetNode = document.querySelector('body'),
  19. observerConfig = { attributes: false, childList: true, subtree: true },
  20. tId = null,
  21. previousListLength = 0,
  22. getRndIntBetween = function(min, max) {
  23. return Math.floor(Math.random() * (max - min + 1)) + min;
  24. },
  25. callback = function(mutationsList, observer) {
  26. try {
  27. mutationsList.forEach(function (mutation) {
  28. var entry = {
  29. mutation: mutation,
  30. el: mutation.target,
  31. value: mutation.target.textContent,
  32. oldValue: mutation.oldValue
  33. };
  34. if (entry.el.classList.contains("statuslog")) {
  35. if (targetNode.classList.contains("inconversation")) {
  36. var btnSubmit = document.querySelector(".sendbtn");
  37. var textarea = document.querySelector(".chatmsg");
  38. textarea.innerText = options.greetingMessage;
  39. tId === null && (tId = window.setTimeout(function() {
  40. btnSubmit != null && btnSubmit.click();
  41. }, getRndIntBetween(0.8*1000, 1.2*1000)) );
  42. }
  43. }
  44. if (entry.el.firstChild && entry.el.firstChild.classList) {
  45. tId = null;
  46. if (entry.el.firstChild.classList.contains("logitem")) {
  47. var logs = document.querySelectorAll('.logitem');
  48. if (logs.length > previousListLength) {
  49. console.log(logs[ logs.length - 1 ].innerText);
  50. if (options.disconnectOnIdle.enabled) {
  51. clearTimeout(options.disconnectOnIdle.timeoutId);
  52. options.disconnectOnIdle.timeoutId = null;
  53. }
  54. if (options.disconnectOnIdle.enabled &&
  55. options.disconnectOnIdle.timeoutId === null) {
  56. options.disconnectOnIdle.timeoutId = window.setTimeout(function() {
  57. console.log("*** ESCO ***");
  58. document.querySelector(".disconnectbtn").click();
  59. document.querySelector(".disconnectbtn").click();
  60. }, options.disconnectOnIdle.timeout);
  61. }
  62. }
  63. if (document.querySelector(".newbtn .disconnectbtn")) {
  64. previousListLength = 0;
  65. window.setTimeout(function() {
  66. document.querySelector(".newbtn .disconnectbtn")
  67. && document.querySelector(".newbtn .disconnectbtn").click();
  68. }, getRndIntBetween(1.2 * 1000, 1.8 * 1000));
  69. }
  70. }
  71. }
  72. });
  73. } catch(e) {
  74. if (e !== BreakException) throw e;
  75. }
  76. };
  77.  
  78. var observer = new MutationObserver(callback);
  79. observer.observe(targetNode, observerConfig);
  80.  
  81. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement