Automated Omegle Script

Script for omegle with automated features.

Stan na 23-01-2016. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Automated Omegle Script
// @namespace   lazi3b0y
// @include     http://*.omegle.com/*
// @version     2.4.1
// @grant       GM_addStyle
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @description Script for omegle with automated features.
// allow pasting
// ==/UserScript==
this.$ = this.jQuery = jQuery.noConflict(true);

GM_addStyle(
  "td.chatmsgcell { width: 50%; }" +
  "#omegle-greetings-text-in-chat { width: 100%; background: #FFF none repeat scroll 0% 0%; font-family: sans-serif; border: 0px none; padding: 0px; margin: 0px; height: 4.5em; font-size: 1em; overflow: auto; border-radius: 0px; resize: none; }" +
  "#omegle-greetings-text-start { position: absolute; top: 105px; left: 5px; width: 245px; height: 475px; resize: none; }" +
  ".greetingsmsgcell { width: 50%; }" +
  ".greetingsmsgwrapper { background: #FFF none repeat scroll 0% 0%; border: 1px solid #CCC; height: 4.5em; padding: 0.25em; }" +
  ".script-checkbox-wrapper { position: absolute; line-height: 12px; padding: 2px;  }" +
  ".auto-disconnect-checkbox-wrapper { position: absolute; line-height: 12px; padding: 2px;  }" +
  ".activate-script-label { position: absolute; display: inline-block; font-size: 11px; }" +
  ".activate-auto-disconnect-label { position: absolute; display: inline-block; font-size: 11px; }" +
  ".auto-disconnect-timer { position: absolute; display: inline-block; font-size: 11px; top: 75px; right: 25px; }" +
  ".hide { display: none; }" +
"");

var timeout = 600; // Timeout value * 100 milliseconds. 600 = 1 minute.
var disconnectTimer = 0;
var chatContent = 0;
var greetingsText;
var greeted = false;
var aborts=[
  'You have disconnected.',
  'Stranger has disconnected',
  'Technical error: Server was unreachable for too long and your connection was lost. Sorry. :( Omegle understands if you hate it now, but Omegle still loves you.',
];

$('body').append('<textarea id="omegle-greetings-text-start" placeholder="Automated Hi goes here..." />');
$('body').append('<div class="script-checkbox-wrapper" style="top: 70px; left: 1px;"><input id="auto-omegle-enabled" type="checkbox" checked /></div><div class="activate-script-label" style="top: 75px; left: 22px;">Activate auto script</div>');
$('body').append('<div class="auto-disconnect-checkbox-wrapper" style="top: 85px; left: 1px;"><input id="reconnect-omegle-enabled" type="checkbox" checked /></div><div class="activate-auto-disconnect-label" style="top: 90px; left: 22px;">Activate auto disconnect</div>');
$('body').append('<div class="auto-disconnect-timer hide"></div>');
$('#omegle-enabled').prop('checked', false);

function disconnect() {
  $('button.disconnectbtn').click();
  if ($( "body:containsIN('You're now chatting with a random stranger. Say hi!')" ).text()) {
    $('button.disconnectbtn').click();
  }
  greeted = false;
  chatContent = 0;
  disconnectTimer = 0;
}
  
setInterval(function() {
  var scriptCheckBoxWrapper = $('.script-checkbox-wrapper');
  var scriptCheckBoxLabel = $('.activate-script-label');
  var autoDisconnectCheckBoxWrapper = $('.auto-disconnect-checkbox-wrapper');
  var autoDisconnectCheckBoxLabel = $('.activate-auto-disconnect-label');
  var scriptCheckBox = $('#auto-omegle-enabled');
  var autoDisconnectCheckBox = $('#reconnect-omegle-enabled');
  var autoDisconnectTimerDiv = $('.auto-disconnect-timer');
  var timeRemaining = Math.round((timeout - disconnectTimer) / 10);
  
  var bodyContainsStartPage = $( 'body:containsIN("Omegle (oh·meg·ull)")' ).text();
  
  
  if (bodyContainsStartPage && startPageGreetingsTextArea.length === 0 && !$(".newchatbtnwrapper").length) {
    inChatGreetingsTextArea.remove();
    scriptCheckBoxWrapper.css({ 'top': '70px', 'left': '1px' });
    scriptCheckBoxLabel.css({ 'top': '75px', 'left': '22px' });
    autoDisconnectCheckBoxWrapper.css({ 'top': '85px', 'left': '1px' });
    autoDisconnectCheckBoxLabel.css({ 'top': '90px', 'left': '22px' });
    $('body').append('<textarea id="omegle-greetings-text-start" placeholder="Automated Hi goes here..." />');
    $('#omegle-greetings-text-start').val(greetingsText);
    autoDisconnectTimerDiv.addClass('hide');
    return;
  } else if (!bodyContainsStartPage && inChatGreetingsTextArea.length === 0){
    startPageGreetingsTextArea.remove();
    scriptCheckBoxWrapper.css({ 'top': '70px', 'left': '10px' });
    scriptCheckBoxLabel.css({ 'top': '75px', 'left': '32px' });
    autoDisconnectCheckBoxWrapper.css({ 'top': '70px', 'left': '153px' });
    autoDisconnectCheckBoxLabel.css({ 'top': '75px', 'left': '175px' });
    $('td.chatmsgcell').after('<td class="greetingsmsgcell"><div class="greetingsmsgwrapper"><textarea id="omegle-greetings-text-in-chat" placeholder="Automated Hi goes here..." /></div></td>');
    $('#omegle-greetings-text-in-chat').val(greetingsText);
    autoDisconnectTimerDiv.removeClass('hide');
  }
  
  autoDisconnectTimerDiv.text(function() {
    if (autoDisconnectCheckBox[0].checked) {
      return 'Auto disconnecting from Stranger in ' + timeRemaining + 's';
    } else {
      return 'Auto disconnect is disabled';
    }
  });
  
  if ($('#omegle-greetings-text-start').length > 0) {
    greetingsText = startPageGreetingsTextArea.val();
  } else if ($('#omegle-greetings-text-in-chat').length > 0) {
    greetingsText = inChatGreetingsTextArea.val();
  }

  if (!scriptCheckBox[0].checked || $( 'body:containsIN("Connecting to server")' ).text() || bodyContainsStartPage) {
    return;
  }
  
  if (disconnectTimer === timeout && autoDisconnectCheckBox[0].checked) {
    disconnect();
    return;
  }
  
  $(aborts).each(function() {
    if ($( 'body:containsIN("' + this + '")' ).text()){
      disconnect();
      return;
    }
  });
  
  if (greeted === false && $( "body:containsIN('You're now chatting with a random stranger. Say hi!')" ).text() ) {
    greeted = true;
    $('textarea.chatmsg ').val(greetingsText);
    $('button.sendbtn').click();
  }
  
  if (!chatContent || chatContent != $('.logbox > div').children().length || !autoDisconnectCheckBox[0].checked) {
    chatContent = $('.logbox > div').children().length;
    disconnectTimer = 0;
  }
  else if (autoDisconnectCheckBox[0].checked) {
    disconnectTimer += 1; 
  }

}, 100);

$.extend($.expr[":"], {
  "containsIN": function(elem, i, match, array) {
   return (elem.textContent || elem.innerText || "").toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
  }
});