Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commands.push(new Command("full",function(text){
- sendMessage(text.substr(1).toFullWidth());
- },"Convert message to fullwidth"));
- String.prototype.toFullWidth=function() {
- var DO=1;
- var output="";
- for (var i=0;i<this.length;i++){
- var asc=this.charCodeAt(i);
- if (asc==96) {
- DO=!DO;
- } else if (!DO) {
- output+=this[i];
- } else if (asc==32) {
- output+="\u3000";
- } else if (asc>32&&asc<127) {
- output+=String.fromCharCode(asc+0xFEE0);
- } else {
- output+=this[i];
- }
- }
- return output;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement