Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mytype: 'typing',
- type: 'typing',
- typing: function(arg, user, room) {
- if (!user.hasRank(room.id, '+')) return this.say(room, 'user');
- if (!arg) {
- var target = {
- 'id': user.id,
- 'name': user.name
- }
- }
- else {
- var target = {
- 'id': toId(arg),
- 'name': arg,
- }
- }
- var types = {
- 0: {
- type: 'Ice',
- color: '2822DA'
- },
- 1: {
- type: 'Water',
- color: '2822DA'
- },
- 2: {
- type: 'Fire',
- color: 'BF6224'
- },
- 3: {
- type: 'Grass',
- color: '4A8B4F'
- },
- 4: {
- type: 'Normal',
- color: '6C6C6C'
- },
- 5: {
- type: 'Fighting',
- color: '865A44'
- },
- 6: {
- type: 'Psychic',
- color: '8E1164'
- },
- 7: {
- type: 'Ghost',
- color: '695170'
- },
- 8: {
- type: 'Dark',
- color: '000'
- },
- 9: {
- type: 'Electric',
- color: '9F9F25'
- },
- 10: {
- type: 'Ground',
- color: '90903E'
- },
- 11: {
- type: 'Rock',
- color: '897246'
- },
- 12: {
- type: 'Steel',
- color: '5B6265'
- },
- 13: {
- type: 'Fairy',
- color: 'C95596'
- },
- 14: {
- type: 'Flying',
- color: '6F7AA1'
- },
- 15: {
- type: 'Poison',
- color: '591F7A'
- },
- 16: {
- type: 'Bug',
- color: '5F6F32'
- },
- 17: {
- type: 'Dragon',
- color: '473981'
- },
- };
- var exceptions = {
- 'masterfloat': [1],
- };
- if (exceptions[target.id]) {
- return this.say(room, '!htmlbox ' + target.name + ' is a <font style="font-weight: bold; color: #' + types[exceptions[target.id][0]].color + '"> ' + (exceptions[target.id][1] ? 'and <font style="font-weight: bold; color: #' + types[exceptions[target.id][1]].color + '">' + types[exceptions[target.id][1]].type + 'type' : types[exceptions[target.id][0]].type + '</font> type'))
- }
- var dualtype = true;
- function returnType(target, variation) {
- var chars = 'qwertyuiopasdfghjklzxcvbnm1234567890';
- var total = 0;
- for (var i = 0; i < target.length; i++) {
- total += chars.indexOf(target[i]);
- }
- return (total+variation) % 18;
- }
- //using 2 different numbers to generate random numbers;
- var type1 = types[returnType(target.id, 13)];
- var type2 = types[returnType(target.id, 37)];
- if (type1.type === type2.type) {
- dualtype = false;
- }
- this.say(room, '!htmlbox ' + target.name + ' is a <font style="font-weight: bold; color: #' + type1.color + '">' + type1.type + '</font> ' + (dualtype ? 'and <font style="font-weight: bold; color: #' + type2.color + '">' + type2.type + '</font> type.' : 'type.'));
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement