Advertisement
sparkychild

Untitled

Aug 4th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     mytype: 'typing',
  2.     type: 'typing',
  3.     typing: function(arg, user, room) {
  4.         if (!user.hasRank(room.id, '+')) return this.say(room, 'user');
  5.         if (!arg) {
  6.             var target = {
  7.                 'id': user.id,
  8.                 'name': user.name
  9.             }
  10.         }
  11.         else {
  12.             var target = {
  13.                 'id': toId(arg),
  14.                 'name': arg,
  15.             }
  16.         }
  17.         var types = {
  18.             0: {
  19.                 type: 'Ice',
  20.                 color: '2822DA'
  21.             },
  22.             1: {
  23.                 type: 'Water',
  24.                 color: '2822DA'
  25.             },
  26.             2: {
  27.                 type: 'Fire',
  28.                 color: 'BF6224'
  29.             },
  30.             3: {
  31.                 type: 'Grass',
  32.                 color: '4A8B4F'
  33.             },
  34.             4: {
  35.                 type: 'Normal',
  36.                 color: '6C6C6C'
  37.             },
  38.             5: {
  39.                 type: 'Fighting',
  40.                 color: '865A44'
  41.             },
  42.             6: {
  43.                 type: 'Psychic',
  44.                 color: '8E1164'
  45.             },
  46.             7: {
  47.                 type: 'Ghost',
  48.                 color: '695170'
  49.             },
  50.             8: {
  51.                 type: 'Dark',
  52.                 color: '000'
  53.             },
  54.             9: {
  55.                 type: 'Electric',
  56.                 color: '9F9F25'
  57.             },
  58.             10: {
  59.                 type: 'Ground',
  60.                 color: '90903E'
  61.             },
  62.             11: {
  63.                 type: 'Rock',
  64.                 color: '897246'
  65.             },
  66.             12: {
  67.                 type: 'Steel',
  68.                 color: '5B6265'
  69.             },
  70.             13: {
  71.                 type: 'Fairy',
  72.                 color: 'C95596'
  73.             },
  74.             14: {
  75.                 type: 'Flying',
  76.                 color: '6F7AA1'
  77.             },
  78.             15: {
  79.                 type: 'Poison',
  80.                 color: '591F7A'
  81.             },
  82.             16: {
  83.                 type: 'Bug',
  84.                 color: '5F6F32'
  85.             },
  86.             17: {
  87.                 type: 'Dragon',
  88.                 color: '473981'
  89.             },
  90.         };
  91.         var exceptions = {
  92.             'masterfloat': [1],
  93.         };
  94.         if (exceptions[target.id]) {
  95.             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'))
  96.         }
  97.  
  98.         var dualtype = true;
  99.  
  100.  
  101.         function returnType(target, variation) {
  102.             var chars = 'qwertyuiopasdfghjklzxcvbnm1234567890';
  103.             var total = 0;
  104.             for (var i = 0; i < target.length; i++) {
  105.                 total += chars.indexOf(target[i]);
  106.             }
  107.             return (total+variation) % 18;
  108.         }
  109.         //using 2 different numbers to generate random numbers;
  110.         var type1 = types[returnType(target.id, 13)];
  111.         var type2 = types[returnType(target.id, 37)];
  112.         if (type1.type === type2.type) {
  113.             dualtype = false;
  114.         }
  115.         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.'));
  116.     },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement