Advertisement
Slowstone72

MPP Announcer

Dec 20th, 2024
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 2.03 KB | Software | 0 0
  1. /* Ancient code published for archival purposes. May or may not work or be relevant.
  2. Feel free to do whatever you want with this, if anything.
  3. Archive from 2017-10-07 - contents may be older. */
  4.  
  5. MPP.chat.send('Announcer.exe has been launched.')  
  6. MPP.chat.send('This script will count how many people leave and join, it will also welcome people to the room.')                                              
  7. MPP.chat.send('Currect location info: ' + location + ' - ' + location.pathname + ' - ' + location.hostname )  
  8. MPP.chat.send('It is now: ' + Date() + '.')                                            
  9.  
  10.  
  11. counter1 = 0
  12. counter2 = 0                                                                                                                        
  13. setTimeout(function(){ counter1 = 0; }, 7000);
  14. setTimeout(function(){ counter2 = 0 ; }, 7000);
  15.  
  16. MPP.client.on('participant added', (pp) => {
  17.   MPP.chat.send('Welcome to room (' + MPP.client.channel._id + '), ' + pp.name + '.') })                                                                                      
  18. MPP.client.on('participant removed', (pp) => {
  19.   MPP.chat.send(pp.name + ' has left the room.') })                                                                                                               MPP.client.on('participant added', (pp) => {counter1 = counter1 + 1 })                                                                                      
  20. MPP.client.on('participant removed', (pp) => {counter2 = counter2 + 1})          
  21.  
  22.                                                                                                      
  23. setInterval(MPP.chat.send, 1000 * 60 * 15000, 'Since this script has been active: ' + counter1 + ' people have joined and ' + counter2 + ' people have left.');                                                                                                                                                  
  24.                                        
  25.                                                                                  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement