LoultGetId2

try to take over the world!

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         LoultGetId2
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://loult.family/*
// @grant        none
// ==/UserScript==

function getCookie(name) {
  var value = "; " + document.cookie;
  var parts = value.split("; " + name + "=");
  if (parts.length == 2) return parts.pop().split(";").shift();
}



var CheminComplet = document.location.href;
var NomDuFichier     = CheminComplet.substring(CheminComplet.lastIndexOf( "/" )+1 );
var FirstMessage = true ; 

 socket = new WebSocket('wss://loult.family/socket/'+NomDuFichier);
 



 socket.onmessage = function(e){
   var server_message = e.data;

if (typeof event.data === "string") {
var jsonObject = JSON.parse(e.data) ; 
    
    
if(FirstMessage){      // si premier message du socket 
    
var length = jsonObject.users.length ;      // taille du tableau des utilisateurs  et nombre pokemon connecté 
for (var i = 0 ; i<length; i++) {
    
if( jsonObject.users[i].params.you === true) {
    
    
    console.log( "nom :" +  jsonObject.users[i].params.name  +" "+  jsonObject.users[i].params.adjective  );
    console.log( "cookie :" + getCookie("id") );
    document.cookie = "id"+ '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 
}
    
    
FirstMessage=false ;  // sortir du if 
}
    

 }

    


}
 
                                }