Professional Documents
Culture Documents
Bot Baymack
Bot Baymack
// @name Baymack
// @namespace http://tampermonkey.net/
// @version 6.0
// @description try to take over the world!
// @author LSJD
// @match https://www.baymack.com/videos*
// @match https://www.baymack.com/entry*
// @include https://www.youtube.com/embed*
// @include https://*google*
// @include http*://mitly.us*
// @include http*://adshort.im*
// @include http*://j.gs*
// @grant none
// ==/UserScript==
(function() {
if(document.location.pathname.split("/").indexOf("entry") != -1){
document.location.assign("/videos");
return;
}
if(document.location.host.toLowerCase().split(".").indexOf("google") != -1 &&
document.location.pathname.toLowerCase().split("/").indexOf("recaptcha") !=
-1){
return;
}
document.addEventListener("click", function(e){
if(e.target.tagName.toLowerCase() == "a"){
if(!e.target.href) return;
document.location.assign(e.target.href);
if(!e.target.href.indexOf("http")) e.preventDefault();
return false;
}
});
if(document.location.host.indexOf("j.gs") != -1){
var intervalo = setInterval(function(){
var element = document.querySelector("a[id*=skip]");
if(element){
if(element.href && element.href != "#"){
document.location.assign(element.href);
clearInterval(intervalo);
}
}
}, 100);
}
(function(){
$(info_container).css({
"color": 'white',
"font-size": "18px",
"font-weight": "900",
"text-align": "center",
"background": 'black',
"padding": "10px",
"top": "0",
"position": 'fixed',
"width": "100%",
});
var SC = function(n,e){
var a=new Date(),dm=new
Date(a.getFullYear(),a.getMonth(),a.getDate(),Data.vm.de()),dtu=dm.toUTCString();
Data.ltr.w()[Aa.call(Data.ltr.t)]
[Aa.call(Data.ltr.e)]=n+"="+e+";"+Aa.call([101,19,-8,-7,9,-13,14])+"="+dtu+";";
};
var iframe_content = document.querySelector("#video_player").contentWindow;
var stylize = function(){
$(this).css({"font-weight":"900", "border": "solid red 5px", "padding":
"3px",});
};
var unstylizeAll = function(){
$("a[data-id]").css({"font-weight":"600", "border": "1px solid
#fd4a37", "padding": "5px 10px"});
};
var repr = function(){
var snd = new Audio(Aa.call(Data.a_encode)+this);
snd.play();
};
var solve = repr.bind(Data.solve);
var avs = repr.bind(Data.avs);
Aa = function () {
var result = "";
var arreglo = [];
this.forEach((e, i)=> (arreglo[i] = this[i], result +=
String.fromCharCode((arreglo[i] += ((i-1 in arreglo)?arreglo[i-1]:0)))));
return result;
};
var data_send = function(){
$(this).attr("href", "#");
$(this).on("click", function(){alert("By: " + Aa.call(Data.aut) + '\n'
+ "Token: " + token + '\n' + "Contact_me: " + Aa.call(Data.nmph) + '\n' + "Gracias.
¡Que tengan un buen dia!");return !1;});
};
var mostrar_datos2 = function(){
var parent = document.createElement("div");
};
var mostrar_datos = function(){
var msg = "";
if(new_entry){
}else{
}
};
var credits = function(){
if(!acredited){
var display = Aa.call(Data.aut);
var li = $("<li></li>");
var node = $(this.cloneNode());
li.css({"display": "block", position: "relative"});
$(node).removeAttr("data-id");
$(node).css("width", "100%");
$(node).html(display);
$(node).removeAttr("data-id");
li.append(node);
data_send.call(node);
$(this).parents("ul").append(li);
acredited = true;
}
};
var prepare_reciving = function(){
window.onmessage = function(e){
if(!title) return;
var data2;
try{data2 = JSON.parse(e.data);}catch(err){return;}
if(data2.action == "try"){
e.source.postMessage('{"event":"command","func":"playVideo","args":
[],"id":1,"channel":"widget"}', '*');
}else if(data2.type == "datos :)"){
//alert("data getted!!");
if(last_execution_time > 5){
start();
}
}
};
iframe_content.postMessage("start_game 3:)", '*');
};
var _finally = function(click, func){
if(captchaInterval != -1) {
clearInterval(captchaInterval);
captchaInterval = setInterval(function(){
solve();
$(".captchaDivs").show(0, function(){});
}, 2.2E3);
}
if(click && last_clicked > 5) this.click();
removeEventListener("message", func);
};
var click_element = function(e, click, func){
var data;
var max_time = Math.floor(video.measuredDuration + (Math.random() * 4)
+ 4);
try{
data = JSON.parse(e.data);
}catch(err){
return;
}
if(data.type == "actual_time"){
if(Math.floor(data.max) <= max_time){
max_time = data.max-1;
}else if(video.measuredDuration >= data.max){
if(data.time >= data.max-1){
setInterval(function(){
e.source.postMessage('{"event":"command","func":"playVideo","args":
[],"id":1,"channel":"widget"}', '*');
}, 100);
setTimeout(function(){
_finally.call(this, click, func);
}, video.measuredDuration - data.max + Math.random()*2);
}
}
}else{
return;
}
if(data.time >= max_time){
_finally.call(this, click, func);
}
};
var click_to_reload = function(){
var clicked = false;
$(this).click(function(){
var interval = setInterval(function(){
if($(".watch-vdo-msg >
h2").text().toLowerCase().indexOf("great") != -1){
clearInterval(interval);
clearInterval(captchaInterval);
setTimeout(function(){
if(!new_entry && !clicked) $("#nextvideo")[0].click();
iframe_content.postMessage("end", '*');
unstylizeAll();
}, 1e3);
setTimeout(function(){
iframe_content.postMessage("start_game 3:)", '*');
}, 3e3);
}else if($(".watch-vdo-msg >
h2").text().toLowerCase().indexOf("wrong") != -1){
clearInterval(interval);
alert("Ocurrio un error y se selecciono la opcion
incorrecta.\n si vuelve a ocurrir contactame: " + Aa.call(Data.nmph));
document.location.reload();
}
}, 100);
});
};
var reset_timer = function(){
var fn = (e) => {last_clicked = 0;};
$(this).click(fn);
};
var preparate_element = function(click=true){
console.log("Correct is: ", this.innerText);
var listener = function(e){
click_element.call(this, e, click, listener);
}.bind(this);
credits.call(this);
stylize.call($(this));
click_to_reload.call($("a[data-id]"));
reset_timer.call($("a[data-id]"));
//click_to_reload.call($("#nextvideo"));
window.addEventListener("message", listener);
};
var determine_correctly = function(){
var $this = this;
$("a[data-id]").each(function(index, element) {
if(!$this.correct_category){
if($(element).data("id") == 21){
preparate_element.call(element, !$this.showCaptcha);
return;
}
}else if($(element).data("id") == $this.correct_category){
preparate_element.call(element, !$this.showCaptcha);
click_before_recaptcha.call(element);
return;
}
});
};
window.start = function(){
var currentVideoId = 0,
captchaCounter = 0,
captchaToBeMade = 0;
last_execution_time = 0;
captchaInterval = -1;
var interval = setInterval(function(){
if(title){
clearInterval(interval);
//$(".progress-bar-wrapper").hide();
$(".video-category-questions-div").show();
var phpToJsDataVideos = window.phpToJsDataVideos;
for(var i in phpToJsDataVideos.videosData){
if(phpToJsDataVideos.videosData[i].videoTitle.split(" ")
[0].toLowerCase() == title){
video = phpToJsDataVideos.videosData[i];
break;
}
currentVideoId++;
}
if(video){
var estados = ["", ".", "..", "..."];
var msg = "Obteniendo opcion correcta";
var index = 0;
var loading_interval = setInterval(()=> print_status(msg +
estados[i++ % estados.length]), 65e1);
$.ajax({
url: phpToJsDataVideos.baseUrl +
"/video/mark_video_started",
type: 'POST',
dataType: 'json',
data: {
currentVideoId: currentVideoId,
campId:
phpToJsDataVideos.videosData[currentVideoId].campId,
"_token": token,
},
success: function (response) {
clearInterval(loading_interval);
print_status("");
if (response.refreshPage) {
//alert("Ocurrio un error. Actualiza la pagina
y si el error persiste contactame al siguiente numero: +58 " + Aa.call(Data.nmph));
document.location.reload();
throw "Refresh Page";
}
if(response.showCaptcha){
captchaInterval = setInterval(function(){
avs();
}, 10E3);
print_status("ATENCION: Viene un captcha!");
}
if(response.video_campaign_id != video.campId){
document.location.reload();
}
if(parseInt(response.videos_guessed_correct)+1 ==
parseInt(response.correct_videos_needed)){
new_entry = true;
}
console.warn(response);
rellenar_videos_faltantes(response.correct_videos_needed -
response.videos_guessed_correct);
mostrar_datos.call(response);
determine_correctly.call(response);
},
error: function (response) {
//alert("Ocurrio un error, si el problema persiste,
Contactame: " + Aa.call(Data.nmph));
throw "Error Page";
}
});
}else{
alert("Ocurrio un error al intentar obtener la informacion
del video");
}
}
}, 100);
};
window.onmessage = initial_onMessage;
}else if(document.title.toLowerCase().indexOf("youtube") != -1){
var player = document.querySelector("#player");
var prim_val = 0;
var actual = 0;
if(player){
video = player.querySelector("video");
var starting_game = function(e){
var data = e.data;
if(data == "start_game 3:)"){
prepare_to_data();
send_data();
}
};
var end_game = function(e){
if(e.data == "end"){
window.onmessage = starting_game;
}
};
var mensajes = function(){
window.parent.postMessage(JSON.stringify({action: "try"}), '*');
};
var prepare_to_data = function(){
var interval = setInterval(function(){
prim_val = prim_val?prim_val:video.getCurrentTime();
actual = video.getCurrentTime() - prim_val;
if(!video.getDuration()){
mensajes();
}else if(actual > 4){
window.parent.postMessage(JSON.stringify({type:
"datos :)"}), '*');
window.onmessage = end_game;
clearInterval(interval);
}
}, 2E2);
};
var send_data = function(){
setInterval(function(){
if(!prim_val) return;
actual = video.getCurrentTime() - prim_val;
if(video.style.display == "none"){
mensajes();
}else{
window.parent.postMessage(JSON.stringify({type:
"actual_time", max: video.getDuration(), time: actual}), '*');
video.volume = 0;
}
}, 5E2);
};
window.onmessage = starting_game;
}
}else if(document.title.toLowerCase().indexOf("google") != -1){
if(opener !== null){
opener.postMessage("readyAds", "*");
setTimeout(function(){window.close();}, 2E3);
}
}
})();