Guest User

PAR.js

a guest
Jun 18th, 2016
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. registerPlugin({
  2. name: 'Pause-Resume',
  3. version: '1.0',
  4. description: 'This script will allow you to pause and resume the song the bot is playing',
  5. author: 'Tw1zarD',
  6. vars: {}
  7. }, function(sinusbot, config) {
  8. var muted = false;
  9. var pos = 0;
  10. sinusbot.setMute(false);
  11. sinusbot.on('chat', function(ev) {
  12. if(ev.msg == ".continue ")
  13. muted = false;
  14. sinusbot.log('Continues Song');
  15. if (config.mode == 0) {
  16. sinusbot.setMute(false);
  17. } else {
  18. sinusbot.play();
  19. log('Seeking to ' + pos);
  20. sinusbot.seek(pos);
  21. }
  22. return;
  23. }
  24. if(ev.msg == ".pause ")
  25. muted = true;
  26. sinusbot.log('Pausing Music');
  27. if (config.mode == 0) {
  28. sinusbot.setMute(true);
  29. } else {
  30. pos = getPos();
  31. sinusbot.log('Pos is ' + pos);
  32. sinusbot.stop();
  33. }
  34. }
  35. });
  36. });
Advertisement
Add Comment
Please, Sign In to add comment