Hirsw0w

[CSGOEmpire] Auto rain claim

May 7th, 2020
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. /// CSGOEmpire Auto Rain Claim
  2. /// Version: 1.0
  3. /// Made by Hirsw0w (Twitter: @liranpes)
  4.  
  5. var metadata = JSON.parse(localStorage.getItem("metadata"));
  6.  
  7. var identify = {
  8. uid: metadata.user.id,
  9. model: metadata.user,
  10. authorizationToken: metadata.socket_token,
  11. signature: metadata.socket_signature
  12. }
  13.  
  14. var socket = null;
  15. createConnection();
  16.  
  17. function createConnection() {
  18. socket = new WebSocket("wss://roulette.csgoempire.com/s/?EIO=3&transport=websocket");
  19.  
  20. socket.onopen = (e) => {
  21. console.log("[CSGOEmpire] Connection established!");
  22. socket.send("40/chat,");
  23. socket.send(`42/chat,["identify", ${JSON.stringify(identify)}]`);
  24. }
  25.  
  26. socket.onmessage = (e) => {
  27. var message = e.data;
  28. if(message.indexOf(`"broadcast":"chatRain"}]`) != -1) {
  29. console.log("Rain has started!");
  30. socket.send(`42/chat,["chatRain claim"]`);
  31. }
  32.  
  33. if(message.indexOf(`"success":"You've successfully participated in the event!"}`) != -1)
  34. console.log("Claimed rain successfully!");
  35. }
  36.  
  37. socket.onclose = (e) => {
  38. console.log("[CSGOEmpire] Connection closed reconnecting in 5 seconds!");
  39. setTimeout(createConnection, 5000);
  40. }
  41. }
  42.  
  43. setInterval(function() {
  44. if(socket != null && socket.readyState == socket.OPEN)
  45. socket.send("2");
  46. }, 15 * 1000);
Add Comment
Please, Sign In to add comment