MrSableye

Untitled

Aug 27th, 2022
1,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let startSwitching = (room) => {
  2.   if (!window.switchingRooms) window.switchingRooms = {};
  3.   let increment = 2;
  4.   window.switchingRooms[room] = setInterval(() => {
  5.     app.send(`/choose switch ${increment}`, room);
  6.     increment++;
  7.     if (increment > 6) increment = 2;
  8.   }, 1000);
  9. };
  10.  
  11. let stopSwitching = (room) => {
  12.   let switchingRoom = window.switchingRooms[room];
  13.   if (switchingRoom) clearInterval(switchingRoom);
  14. };
Advertisement
Add Comment
Please, Sign In to add comment