Cavegame Join Notification

Notify when someone joins Cavegame with a blue box message

  1. // ==UserScript==
  2. // @name Cavegame Join Notification
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Notify when someone joins Cavegame with a blue box message
  6. // @author DevzGod
  7. // @match *://cavegame.io/*
  8. // @grant Heath
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to create a notification box
  16. function createNotification(message) {
  17. // Create the notification container
  18. const notification = document.createElement('div');
  19. notification.style.position = 'fixed';
  20. notification.style.bottom = '20px';
  21. notification.style.right = '20px';
  22. notification.style.backgroundColor = 'rgba(0, 0, 255, 0.8)'; // Blue color
  23. notification.style.color = 'white';
  24. notification.style.padding = '10px 20px';
  25. notification.style.borderRadius = '5px';
  26. notification.style.fontFamily = 'Arial, sans-serif';
  27. notification.style.zIndex = '9999';
  28. notification.style.boxShadow = '0 2px 10px rgba(0, 0, 0, 0.5)';
  29. notification.textContent = message;
  30.  
  31. // Append to the body
  32. document.body.appendChild(notification);
  33.  
  34. // Remove after 5 seconds
  35. setTimeout(() => {
  36. notification.remove();
  37. }, 5000);
  38. }
  39.  
  40. // Simulate a join event (you'll need to hook into the game's API or WebSocket for real events)
  41. function simulateJoinEvent(playerName) {
  42. createNotification(`${playerName} have Loged into CaveHAX by Dev`);
  43. }
  44.  
  45. // Example: Simulate someone joining after 2 seconds
  46. setTimeout(() => {
  47. simulateJoinEvent('You');
  48. }, 2000);
  49.  
  50. // Hook into the game's actual events if possible
  51. // For example, if the game has a WebSocket connection:
  52. /*
  53. const socket = new WebSocket('wss://example-game-socket');
  54. socket.addEventListener('message', (event) => {
  55. const data = JSON.parse(event.data);
  56. if (data.type === 'playerJoin') {
  57. createNotification(`${data.playerName} has joined the game!`);
  58. }
  59. });
  60. */
  61. })();