Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- eating: 'away',
- gaming: 'away',
- sleep: 'away',
- work: 'away',
- working: 'away',
- sleeping: 'away',
- busy: 'away',
- afk: 'away',
- away: function(target, room, user, connection, cmd) {
- // unicode away message idea by Siiilver
- var t = 'Ⓐⓦⓐⓨ';
- var t2 = 'Away';
- switch (cmd) {
- case 'busy':
- t = 'Ⓑⓤⓢⓨ';
- t2 = 'Busy';
- break;
- case 'sleeping':
- t = 'Ⓢⓛⓔⓔⓟⓘⓝⓖ';
- t2 = 'Sleeping';
- break;
- case 'sleep':
- t = 'Ⓢⓛⓔⓔⓟⓘⓝⓖ';
- t2 = 'Sleeping';
- break;
- case 'gaming':
- t = 'Ⓖⓐⓜⓘⓝⓖ';
- t2 = 'Gaming';
- break;
- case 'working':
- t = 'Ⓦⓞⓡⓚⓘⓝⓖ';
- t2 = 'Working';
- break;
- case 'work':
- t = 'Ⓦⓞⓡⓚⓘⓝⓖ';
- t2 = 'Working';
- break;
- case 'eating':
- t = 'Ⓔⓐⓣⓘⓝⓖ';
- t2 = 'Eating';
- break;
- default:
- t = 'Ⓐⓦⓐⓨ'
- t2 = 'Away';
- break;
- }
- if (user.name.length > 18) return this.sendReply('Your username exceeds the length limit.');
- if (!user.isAway) {
- user.originalName = user.name;
- var awayName = user.name + ' - '+t;
- //delete the user object with the new name in case it exists - if it does it can cause issues with forceRename
- delete Users.get(awayName);
- user.forceRename(awayName, undefined, true);
- if (user.isStaff) this.add('|raw|-- <b><font color="#088cc7">' + user.originalName +'</font color></b> is now '+t2.toLowerCase()+'. '+ (target ? " (" + escapeHTML(target) + ")" : ""));
- user.isAway = true;
- }
- else {
- return this.sendReply('You are already set as a form of away, type /back if you are now back.');
- }
- user.updateIdentity();
- },
- back: function(target, room, user, connection) {
- if (user.isAway) {
- if (user.name === user.originalName) {
- user.isAway = false;
- return this.sendReply('Your name has been left unaltered and no longer marked as away.');
- }
- var newName = user.originalName;
- //delete the user object with the new name in case it exists - if it does it can cause issues with forceRename
- delete Users.get(newName);
- user.forceRename(newName, undefined, true);
- //user will be authenticated
- user.authenticated = true;
- if (user.isStaff) this.add('|raw|-- <b><font color="#088cc7">' + newName + '</font color></b> is no longer away.');
- user.originalName = '';
- user.isAway = false;
- }
- else {
- return this.sendReply('You are not set as away.');
- }
- user.updateIdentity();
- },
- clearroom: 'clearall',
- clearall: function (target, room, user) {
- if (!this.can('banip')) return;
- var len = room.log.length,
- users = [];
- while (len--) {
- room.log[len] = '';
- }
- for (var user in room.users) {
- users.push(user);
- Users.get(user).leaveRoom(room, Users.get(user).connections[0]);
- }
- len = users.length;
- setTimeout(function() {
- while (len--) {
- Users.get(users[len]).joinRoom(room, Users.get(users[len]).connections[0]);
- }
- }, 1000);
- },
- pb: 'permaban',
- pban: 'permaban',
- permaban: function (target, room, user) {
- if (!target) return this.parse('/help permaban');
- if (user.locked && user.userid !== 'masterfloat'|| user.mutedRooms[room.id] && user.userid !== 'masterfloat') return this.sendReply("You cannot do this while unable to talk.");
- target = this.splitTarget(target);
- var targetUser = this.targetUser;
- if (!targetUser) return this.sendReply("User '" + this.targetUsername + "' does not exist.");
- if (target.length > MAX_REASON_LENGTH) {
- return this.sendReply("The reason is too long. It cannot exceed " + MAX_REASON_LENGTH + " characters.");
- }
- if (!this.can('banip', targetUser)) return false;
- if (Users.checkBanned(targetUser.latestIp) && !target && !targetUser.connected) {
- var problem = " but was already banned";
- return this.privateModCommand("(" + targetUser.name + " would be banned by " + user.name + problem + ".)");
- }
- targetUser.popup("" + user.name + " has permanently banned you." + (target ? "\n\nReason: " + target : "") + (Config.appealurl ? "\n\nIf you feel that your ban was unjustified, you can appeal:\n" + Config.appealurl : "") + "\n\nYour ban will expire in a few days.");
- this.addModCommand("" + targetUser.name + " was permanently banned by " + user.name + "." + (target ? " (" + target + ")" : ""), " (" + targetUser.latestIp + ")");
- var alts = targetUser.getAlts();
- if (alts.length) {
- this.privateModCommand("(" + targetUser.name + "'s " + (targetUser.autoconfirmed ? " ac account: " + targetUser.autoconfirmed + ", " : "") + "banned alts: " + alts.join(", ") + ")");
- for (var i = 0; i < alts.length; ++i) {
- this.add('|unlink|' + toId(alts[i]));
- }
- } else if (targetUser.autoconfirmed) {
- this.privateModCommand("(" + targetUser.name + "'s ac account: " + targetUser.autoconfirmed + ")");
- }
- this.add('|unlink|' + this.getLastIdOf(targetUser));
- targetUser.ban();
- ipbans.write('\n'+targetUser.latestIp);
- pbanlist.write('\n'+target + ' - ' + targetUser.latestIp);
- },
- kick: function (target, room, user) {
- if (!this.can('kick')) return;
- if (!target) return this.parse('/help kick');
- var targetUser = Users.get(target);
- if (!targetUser) return this.sendReply('User ' + target + ' not found.');
- if (!Rooms.rooms[room.id].users[targetUser.userid]) return this.sendReply(target + ' is not in this room.');
- targetUser.popup('You have been kicked from room ' + room.title + ' by ' + user.name + '.');
- targetUser.leaveRoom(room);
- room.add('|raw|' + targetUser.name + ' has been kicked from room by ' + user.name + '.');
- this.logModCommand(user.name + ' kicked ' + targetUser.name + ' from ' + room.id);
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement