Advertisement
MasterFloat

Untitled

Sep 8th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. runtour: function(arg, user, room) {
  2. if(!user.hasRank(room, '+')) return false;
  3. if (Number(arg) > 15) return this.say(room, '__You can\'t make a tournament start in more then 15 minutes.__');
  4.  
  5. if (!arg) {
  6. this.timeStart = clearTimeout(this.timeStart);
  7. this.timeRemind = clearTimeout(this.timeRemind);
  8. this.timeAutodq = clearTimeout(this.timeAutodq);
  9. this.timeRunautodq = clearTimeout(this.timeRunautodq);
  10. this.timeWall = clearTimeout(this.timeWall);
  11.  
  12. this.say(room, '/tour start');
  13. this.say(room, '/tour autodq 2');
  14. this.say(room, '/tour runautodq');
  15. this.say(room, '/wall Good luck and Have fun!');
  16.  
  17. this.remind2 = setTimeout(function (room, remind2) {
  18. this.say(room, remind2);
  19. }.bind(this), 120 * 1000, room, '/tour remind');
  20.  
  21. return false;
  22. }
  23. if (arg) {
  24. if (arg === 'off') {
  25. if (!this.timeStart) return this.say(room, 'No tour autostart was set.');
  26. this.timeStart = clearTimeout(this.timeStart);
  27. this.timeRemind = clearTimeout(this.timeRemind);
  28. this.timeAutodq = clearTimeout(this.timeAutodq);
  29. this.timeRunautodq = clearTimeout(this.timeRunautodq);
  30. this.timeWall = clearTimeout(this.timeWall);
  31. return this.say(room, 'The tournament\'s autostart was canceled.');
  32. }
  33. if (!this.timeStart && arg !== 'off') {
  34. if (!/(1|2|3|4|5|6|7|8|9|0)/i.test(arg)) return this.say(room, "Usage: ``-runtour`` it will start, activate the timer and remind the user of the on-going tournament. ``-runtour [minutes]`` Same but after a set amount of time. ``-runtour off`` cancels the ``-runtour [minutes] that you\'ve set if you\'ve set any. (**Must be Voice**)");
  35. this.say(room, 'The tournament will be starting in **' + arg + ' minute(s)**!');
  36.  
  37. this.timeStart = setTimeout(function (room, timeStart) {
  38. this.say(room, timeStart);
  39. }.bind(this), Number(arg) * 60000, room, '/tour start');
  40.  
  41. this.timeAutodq = setTimeout(function (room, timeAutodq) {
  42. this.say(room, timeAutodq);
  43. }.bind(this), Number(arg) * 60000 + 1000, room, '/tour autodq 2');
  44.  
  45. this.timeRunautodq = setTimeout(function (room, timeRunautodq) {
  46. this.say(room, timeRunautodq);
  47. }.bind(this), Number(arg) * 60000 + 1500, room, '/tour runautodq');
  48.  
  49. this.timeWall = setTimeout(function (room, timeWall) {
  50. this.say(room, timeWall);
  51. }.bind(this), Number(arg) * 60000 + 2000, room, '/wall Good luck and Have fun!');
  52.  
  53. return false;
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement