Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- runtour: function(arg, user, room) {
- if(!user.hasRank(room, '+')) return false;
- if (Number(arg) > 15) return this.say(room, '__You can\'t make a tournament start in more then 15 minutes.__');
- if (!arg) {
- this.timeStart = clearTimeout(this.timeStart);
- this.timeRemind = clearTimeout(this.timeRemind);
- this.timeAutodq = clearTimeout(this.timeAutodq);
- this.timeRunautodq = clearTimeout(this.timeRunautodq);
- this.timeWall = clearTimeout(this.timeWall);
- this.say(room, '/tour start');
- this.say(room, '/tour autodq 2');
- this.say(room, '/tour runautodq');
- this.say(room, '/wall Good luck and Have fun!');
- this.remind2 = setTimeout(function (room, remind2) {
- this.say(room, remind2);
- }.bind(this), 120 * 1000, room, '/tour remind');
- return false;
- }
- if (arg) {
- if (arg === 'off') {
- if (!this.timeStart) return this.say(room, 'No tour autostart was set.');
- this.timeStart = clearTimeout(this.timeStart);
- this.timeRemind = clearTimeout(this.timeRemind);
- this.timeAutodq = clearTimeout(this.timeAutodq);
- this.timeRunautodq = clearTimeout(this.timeRunautodq);
- this.timeWall = clearTimeout(this.timeWall);
- return this.say(room, 'The tournament\'s autostart was canceled.');
- }
- if (!this.timeStart && arg !== 'off') {
- 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**)");
- this.say(room, 'The tournament will be starting in **' + arg + ' minute(s)**!');
- this.timeStart = setTimeout(function (room, timeStart) {
- this.say(room, timeStart);
- }.bind(this), Number(arg) * 60000, room, '/tour start');
- this.timeAutodq = setTimeout(function (room, timeAutodq) {
- this.say(room, timeAutodq);
- }.bind(this), Number(arg) * 60000 + 1000, room, '/tour autodq 2');
- this.timeRunautodq = setTimeout(function (room, timeRunautodq) {
- this.say(room, timeRunautodq);
- }.bind(this), Number(arg) * 60000 + 1500, room, '/tour runautodq');
- this.timeWall = setTimeout(function (room, timeWall) {
- this.say(room, timeWall);
- }.bind(this), Number(arg) * 60000 + 2000, room, '/wall Good luck and Have fun!');
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement