User:Jultrun121/chathacksounds.js

function Preparse(input) { //Parse slash commands. if(input.charAt(0) == '/') { var com = input.split(' '); com[0] = com[0].substring(1, com[0].length); var ref = '.' + com[0].toLowerCase; if(window.commands[com[0].toLowerCase] == undefined) {return;} while(typeof eval('window.commands' + ref) != 'function') { if(typeof eval('window.commands' + ref) == 'string') { ref = ref.substring(0, ref.lastIndexOf('.')) + '.' + eval('window.commands' + ref).toLowerCase; continue; }				if(typeof eval('window.commands' + ref) == 'object') { if(!com[1]) { if(typeof eval('window.commands' + ref).default == 'function') {eval('window.commands' + ref).default.call(this, '', chat);} return; }					if(eval('window.commands' + ref)[com[1].toLowerCase]) {ref += '.' + com[1].toLowerCase;} else if(eval('window.commands' + ref).default) { ref += '.default'; if(typeof eval('window.commands' + ref) == 'function') {break;} }					else {return;} com = com.slice(1, com.length); continue; }			}			com = com.slice(1, com.length); return eval('window.commands' + ref).call(this, com.join(' '), input); }		else {return true;} }

window.commands = { 'sims': function(com, text) { document.getElementById('sound').innerHTML = ' '; },                'yo': function(com, text) { //Emote if(com) {$('#Write [name="message"]').val('* ' + wgUserName + ' ' + com);} else {$('#Write [name="message"]').val('* ' + wgUserName);} return true; },

'ayuda': function(com, text) { if(com) { var ref = com.replace(/ /g, '.'); var str = ''; var subcoms = []; var subdirs = []; while(typeof eval('window.commands.' + ref) == 'string') {ref.substring(0, ref.lastIndexOf('.')) + '.' + eval('window.commands' + ref).toLowerCase;} var command = eval('window.commands.' + ref); if(i18n['help-' + ref]) {str += i18n['help'].replace(/\$1/g, ref.replace(/\./g, ' ')).replace(/\$2/g, i18n['help-' + ref].replace(/\$1/g, i18n['example']).replace(/\$1/g, i18n['exampleuser']));} if(typeof command == 'object') { for(var i in command) { if(typeof command[i] == 'function') {subcoms.push(i);} if(typeof command[i] == 'object') {subdirs.push(i);} }				}				if(subcoms.length > 0) {str += '\n' + i18n['subcoms'] + ': ' + subcoms.join(', ');} if(subdirs.length > 0) {str += '\n' + i18n['subdirs'] + ': ' + subdirs.join(', ');} str = str.removeTrailing('\n'); if(str != '') {this.inlineAlert(str);} else {this.inlineAlert(i18n['nohelp'].replace(/\$1/g, command));} }			else { var str = []; for(var i in window.commands) { if(typeof window.commands[i] == 'function' || typeof window.commands[i] == 'object') {str.push(i);} }				this.inlineAlert(i18n['commands'].replace(/\$1/g, str.join(', '))); }		}	};

// chat traducion español beta importScriptURI('http://c.wikia.com/index.php?title=User:Jultrun121/chathacks.js/i18n.js&action=raw&ctype=text/javascript');