Don't look at this, it's just a bookmark.
My chat is never alone ;)
Lol
// ==UserScript== // @name Blahtherapy // @version 1 // @description blahtherapy bot client // @author mhchen // @match https://blahtherapy.com/chat-hub/ // @grant none // ==/UserScript== function start(){ startChat('group_a'); let role = "Venter"; socket.on('ip', function(a) { let ipForQC = ""; if(group == "group_b"){ role = "Listener"; } $.get("https://api.ipdata.co/"+a[0]+"?api-key=test", function (response) { ipForQC = "New "+role+" from: "+response.city+" "+response.region+" "+response.country_name; $.ajax({ type: "POST", url: "https://questioncove.com/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data:{"chat_body":ipForQC,"room_id":"5dc46ab62b1fe9fe05b2c400"} }); if(response.country_name == "India" || response.city == "Ashburn"){ socket.$events.reload(); $.ajax({ type: "POST", url: "https://questioncove.com/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data:{"chat_body":"Bot/Indian Detected. Disconnecting.","room_id":"5dc46ab62b1fe9fe05b2c400"} }); } }, "jsonp"); }); socket.on('userdisconnected', function(grace) { $.ajax({ type: "POST", url: "https://questioncove.com/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data:{"chat_body":role+" disconnected","room_id":"5dc46ab62b1fe9fe05b2c400"} }); socket.$events.reload(); }); $('#sess_form textarea').bind('keypress', function(e) { if(e.keyCode==13){ let message = $(".msgtext")[$(".msgtext").length-3].innerText; message = "Me: "+message; $.ajax({ type: "POST", url: "https://questioncove.com/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data:{"chat_body":message,"room_id":"5dc46ab62b1fe9fe05b2c400"} }); } }); socket.on('updatechat', function(source_id, data) { console.log(data); if(data.substring(0,1) == ""){ if(data.substring(1)=="disconnect"){ socket.$events.reload(); data = "You disconnected"; } else { data = "Me: " + data; } } else { data = role+": "+data; } $.ajax({ type: "POST", url: "https://questioncove.com/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data:{"chat_body":data,"room_id":"5dc46ab62b1fe9fe05b2c400"} }); }); } /* Get rid of javascript popups */ window.alert = function() {}; window.confirm = function() {}; setTimeout(start,1000); var jq = document.createElement('script'); jq.src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); var blah = document.createElement('script'); blah.src = "https://blahtherapy.app:3000/socket.io/socket.io.js"; document.getElementsByTagName('head')[0].appendChild(blah); function start(){ var socket = io.connect('https://blahtherapy.app:3000', { 'sync disconnect on unload': true, 'flash policy port': 10844, query: 'session=9201nrus7oemvj9n3bi64ki6e1' }); let a = document.getElementsByTagName('pre')[0]; let gdeinwardRoomId = "5dc46d93466b76256f796c00"; let mhchenRoomId = "5dc46ab62b1fe9fe05b2c400"; function getInput() { //messages from my room if (a.innerText.includes(mhchenRoomId)) { let b = a.innerText.substring(a.innerText.indexOf(mhchenRoomId) - 30, a.innerText.indexOf(mhchenRoomId) + 700); let c = b.substring(b.indexOf('p class=\\"body\\"') + 17, b.indexOf('<span class=\\"created-at\\"') - 5) if(c.substring(0,1)=="!"){ c = "" + c.substring(1); console.log(c); socket.emit("sendchat",c); } else if(c.substring(0,17) == "New Listener from"){ socket.emit('do_reconnect_chat'); } else if(c.substring(0,15) == "New Venter from"){ socket.emit('do_reconnect_chat'); $.ajax({ type: "POST", url: "https://questioncove.com/ajax_request/group_chat/send_chat.php", xhrFields: { withCredentials: true }, data:{"chat_body":"!Hi how may I help you?","room_id":"5dc46ab62b1fe9fe05b2c400"} }); } } a.innerText = ""; } setInterval(getInput,1010); } setTimeout(start,2000);
Join our real-time social learning platform and learn together with your friends!