Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js')
  2. const db = require('quick.db')
  3. const botconfig = require("./botconfig.json");
  4. const ColorEmbed = botconfig.color;
  5. const Tittle = botconfig.tittle;
  6.  
  7.  
  8. exports.run =  (bot, message, args) => {
  9.     let user = message.mentions.users.first() || message.author;
  10.     let msg = message.content.toUpperCase();
  11.    
  12.     let gems = db.fetch(`gems_${user.id}`)
  13.     if (gems === null) gems = 0;
  14.  
  15.     let xp = db.fetch(`xp_${user.id}`)
  16.     if (xp === null) xp = 0;
  17.    
  18.     let iM = db.fetch(`iM_${user.id}`)
  19.     if (iM === null) iM = 1;
  20.  
  21.  
  22.     let lastest = db.fetch(`latest_${user.id}`)
  23.     if (lastest === null) lastest = 1;
  24.  
  25.     if (!args[0]) {
  26.     if (gems < 5) {
  27.         message.channel.send(`${user} You don't have enought gems to scout! You at least 5 gems :x: `)
  28.    } else {
  29.  
  30.        let l = Math.floor (Math.random() * 100 - 1) + 1
  31.  
  32.        //UR = 1% (100)
  33.        if (l >= 100 || l == 99) {
  34.        let UR = ["2087", "64", "65", "66", "68", "73", "79", "82", "88", "94", "95", "96", "101", "105", "118", "126", "127", "134", "138", "139", "145", "155", "165", "172", "180", "187", "196", "203", "204", "214", "222", "250", "257", "265", "272", "280", "296", "315", "322", "330", "346", "358", "367", "370", "371", "372", "378", "397", "402", "408", "415", "419", "426", "442", "450", "456", "463", "464", "476", "483", "484", "507", "514", "531", "538", "549", "556", "559", "565", "581", "584", "590", "600", "608", "634", "637", "643", "650", "659", "666", "675", "692", "701", "708", "720", "726", "733", "744", "761", "772", "782", "799", "815", "833", "843", "852", "853", "854", "855", "862", "871", "872", "873", "874", "881", "889", "890", "891", "892", "900", "909", "955", "956", "957", "965", "974", "980", "985", "997", "1002", "1007", "1018", "1025", "1030", "1041", "1046", "1053", "1055", "1066", "1073", "1078", "1082", "1100", "1110", "1105", "1121", "1127", "1132", "1144", "1149", "1154", "1165", "1172", "1177", "1188", "1193", "1198", "1209", "1215", "1220", "1224", "1232", "1237", "1251", "1262", "1268", "1273", "1284", "1289", "1294", "1318", "1314", "1319", "1320", "1323", "1328", "1339", "1349", "1350", "1351", "1353", "1358", "1369", "1373", "1374", "1375", "1380", "1385", "1401", "1402", "1403", "1411", "1415", "1416", "1417", "1419", "1424", "1425", "1445", "1449", "1450", "1451", "1454", "1459", "1465", "1471", "1478", "1479", "1480", "1482", "1483", "1489", "1502", "1503", "1504", "1512", "1537", "1538", "1539", "1542", "1547", "1548", "1552", "1553", "1554", "1564", "1574", "1575", "1576", "1578", "1582", "1590", "1591", "1592", "1599", "1608", "1611", "1615", "1635", "1642", "1646", "1652", "1658", "1659", "1660", "1661", "1677", "1682", "1693", "1703", "1708", "1710", "1711", "1712", "1716", "1717", "1729", "1747", "1752", "1755", "1760", "1763", "1768", "1769", "1775", "1779", "1784", "1785", "1786", "1787", "1788", "1789", "1790", "1791", "1792", "1808", "1822", "1823", "1824", "1827", "1831", "1836", "1837", "1838", "1845", "1855", "1860", "1861", "1862", "1864", "1877", "1878", "1879", "1899", "1904", "1907", "1911", "1931", "1932", "1938", "1939", "1940", "1944", "1951", "1952", "1953", "1987", "1988", "1989", "1997", "1998", "1999", "2000", "2005", "2006", "2007", "2021", "2022", "2054", "2055", "2059", "2060", "2064", "2075", "2080", "2081", "2082"]
  35.        db.set(`iM_${user.id}`, UR[Math.floor(Math.random() * UR.length)])
  36.        db.add(`ur_${user.id}`, 1)
  37.        console.log(`${user.username} has scout an UR!`)
  38.        }
  39.  
  40.        //SSR = 15%
  41.        if (l <= 15 && l >= 0) {
  42.        let SSR = ["2086", "937", "938", "939", "940", "941", "942", "943", "944", "945", "946", "947", "948", "949", "950", "951", "952", "953", "954", "973", "984", "991", "996", "1006", "1012", "1017", "1029", "1035", "1040", "1052", "1060", "1065", "1077", "1085", "1099", "1109", "1115", "1120", "1131", "1138", "1143", "1153", "1159", "1164", "1176", "1182", "1187", "1197", "1203", "1208", "1219", "1226", "1231", "1250", "1256", "1261", "1272", "1278", "1283", "1293", "1299", "1313", "1327", "1333", "1338", "1357", "1363", "1368", "1384", "1387", "1388", "1389", "1390", "1391", "1392", "1393", "1394", "1395", "1405", "1410", "1423", "1430", "1444", "1458", "1464", "1470", "1488", "1490", "1491", "1492", "1493", "1494", "1495", "1496", "1497", "1498", "1506", "1511", "1546", "1558", "1563", "1568", "1581", "1588", "1589", "1594", "1598", "1603", "1606", "1607", "1614", "1618", "1619", "1620", "1621", "1622", "1623", "1624", "1625", "1626", "1627", "1628", "1630", "1634", "1636", "1639", "1640", "1645", "1650", "1651", "1654", "1657", "1664", "1665", "1681", "1688", "1692", "1694", "1695", "1696", "1697", "1698", "1699", "1700", "1701", "1702", "1706", "1707", "1715", "1721", "1724", "1728", "1733", "1734", "1735", "1736", "1737", "1738", "1739", "1740", "1741", "1742", "1743", "1751", "1758", "1759", "1762", "1767", "1772", "1773", "1778", "1782", "1783", "1803", "1807", "1811", "1812", "1830", "1834", "1835", "1840", "1844", "1858", "1859", "1876", "1883", "1884", "1885", "1886", "1887", "1888", "1889", "1890", "1891", "1892", "1894", "1898", "1902", "1926", "1910", "1930", "1943", "1956", "1960", "1985", "1986", "1995", "2003", "2004", "2009", "2015", "2019", "2020", "2028", "2032", "2033", "2041", "2045", "2049", "2050", "2063", "2067", "2068", "2070", "2074"]
  43.        db.set(`iM_${user.id}`, SSR[Math.floor(Math.random() * SSR.length)])
  44.        db.add(`ssr_${user.id}`, 1)
  45.        console.log(`${user.username} has scout an SSR!`)
  46.        }
  47.  
  48.        //SR = 24%
  49.        if (l <= 39  && l >= 16) {
  50.        let SR = ["2085", "2084", "55", "56", "57", "58", "59", "60", "61", "62", "63", "71", "72", "75", "77", "78", "81", "86", "87", "90", "92", "93", "99", "100", "103", "104", "107", "122", "123", "124", "125", "129", "121", "132", "133", "136", "141", "142", "143", "144", "150", "152", "153", "154", "157", "161", "162", "163", "164", "167", "169", "170", "171", "174", "176", "177", "178", "179", "182", "184", "185", "186", "189", "190", "192", "193", "194", "195", "198", "200", "201", "202", "206", "207", "210", "211", "212", "213", "216", "217", "219", "220", "221", "224", "226", "227", "228", "229", "230", "231", "232", "234", "245", "246", "247", "248", "252", "254", "255", "256", "259", "261", "262", "263", "264", "267", "269", "270", "271", "274", "276", "277", "278", "279", "282", "293", "294", "295", "308", "311", "312", "313", "314", "317", "319", "3210", "321", "324", "326", "327", "328", "329", "332", "343", "344", "345", "349", "350", "354", "355", "356", "357", "360", "364", "365", "366", "369", "374", "375", "376", "377", "383", "384", "392", "394", "395", "396", "399", "400", "401", "404", "405", "406", "407", "410", "412", "413", "414", "417", "422", "423", "424", "425", "428", "439", "440", "441", "444", "447", "448", "452", "453", "454", "455", "458", "460", "461", "462", "469", "472", "493", "474", "475", "478", "480", "481", "482", "487", "489", "490", "503", "504", "505", "506", "509", "511", "512", "513", "516", "518", "519", "521", "522", "523", "524", "525", "527", "528", "529", "530", "533", "535", "536", "537", "542", "545", "546", "547", "548", "551", "553", "554", "555", "558", "561", "562", "563", "564", "567", "578", "579", "580", "583", "586", "587", "588", "589", "595", "598", "599", "602", "604", "605", "606", "607", "619", "620", "621", "622", "623", "624", "625", "626", "627", "628", "631", "632", "633", "636", "639", "640", "641", "642", "645", "647", "648", "649", "652", "655", "656", "657", "658", "661", "663", "664", "665", "669", "671", "672", "673", "674", "677", "688", "689", "690", "695", "697", "698", "699", "700", "703", "705", "706", "707", "711", "722", "723", "724", "725", "728", "730", "731", "732", "737", "740", "741", "742", "743", "746", "758", "759", "760", "764", "768", "769", "770", "771", "774", "778", "776", "780", "784", "795", "796", "797", "798", "810", "812", "813", "814", "817", "821", "824", "827", "829", "835", "840", "841", "842", "845", "848", "849", "850", "851", "857", "859", "860", "861", "865", "867", "868", "869", "870", "876", "878", "880", "883", "885", "886", "888", "887", "894", "895", "897", "898", "899", "902", "903", "905", "906", "907", "908", "928", "929", "930", "931", "932", "933", "934", "935", "936", "959", "960", "962", "963", "964", "967", "968", "970", "971", "972", "976", "977", "978", "979", "982", "983", "988", "989", "990", "993", "994", "995", "999", "1000", "1001", "1004", "1005", "1009", "1010", "1011", "1014", "1015", "1016", "1020", "1021", "1023", "1024", "1027", "1028", "1032", "1033", "1034", "1037", "1038", "1039", "1043", "1044", "1045", "1050", "1051", "1057", "1058", "1059", "1062", "1063", "1064", "1068", "1069", "1071", "1072", "1075", "1076", "1080", "1081", "1084", "1096", "1097", "1098", "1102", "1103", "1104", "1107", "1108", "1112", "1113", "1114", "1117", "1118", "1119", "1123", "1124", "1125", "1126", "1129", "1130", "1134", "1135", "1137", "1140", "1141", "1142", "1146", "1147", "1148", "1151", "1152", "1156", "1157", "1158", "1161", "1162", "1163", "1168", "1169", "1170", "1171", "1174", "1175", "1179", "1180", "1181", "1184", "1185", "1186", "1190", "1191", "11192", "1195", "1196", "1200", "1201", "1202", "1205", "1206", "1207", "1213", "1214", "1217", "1218", "1222", "1223", "1225", "1228", "1229", "1230", "1234", "1235", "1236", "1248", "1249", "1253", "1254", "1255", "1258", "1259", "1260", "1264", "1265", "1266", "1267", "1270", "1271", "1275", "1276", "1277", "1280", "1281", "1282", "1286", "1287", "1288", "1291", "1292", "1297", "1298", "1310", "1311", "1312", "1316", "1317", "1321", "1322", "1325", "1326", "1330", "1331", "1332", "1335", "1336", "1337", "1340", "1341", "1347", "1348", "1352", "1355", "1356", "1360", "1361", "1362", "1365", "1366", "1367", "1371", "1372", "1377", "1378", "1379", "1382", "1383", "1399", "1400", "1404", "1407", "1408", "1409", "1413", "1414", "1418", "1421", "1422", "1429", "1441", "1442", "1443", "1447", "1448", "1452", "1453", "1456", "1457", "1461", "1462", "1463", "1467", "1468", "1469", "1472", "1473", "1474", "1476", "1477", "1481", "1486", "1487", "1500", "1501", "1505", "1508", "1509", "1510", "1513", "1514", "1515", "1540", "1541", "1544", "1545", "1550", "1551", "1555", "1556", "1557", "1560", "1561", "1562", "1565", "1566", "1567", "1569", "1570", "1571", "1572", "1573", "1577", "1579", "1580", "1583", "1584", "1585", "1586", "1587", "1593", "1595", "1596", "1597", "1600", "1601", "1602", "1604", "1605", "1609", "1612", "1613", "1616", "1617", "1629", "1631", "1632", "1633", "1637", "1638", "1641", "1643", "1644", "1648", "1649", "1653", "1655", "1656", "1662", "1663", "1675", "1676", "1678", "1679", "1680", "1687", "1689", "1690", "1691", "1704", "1705", "1709", "1713", "1714", "1718", "1719", "1723", "1725", "1726", "1727", "1731", "1732", "1745", "1746", "1749", "1750", "1756", "1761", "1764", "1765", "1770", "1771", "1776", "1777", "1780", "1781", "1802", "1804", "1805", "1806", "1809", "1810", "1813", "1814", "1815", "1816", "1817", "1818", "1819", "1820", "1821", "1826", "1828", "1829", "1832", "1833", "1842", "1843", "1846", "1847", "1848", "1849", "1850", "1851", "1852", "1853", "1854", "1856", "1857", "1863", "1865", "1866", "1867", "1868", "1869", "1870", "1871", "1872", "1873", "1875", "1880", "1881", "1895", "1896", "1897", "1900", "1901", "1909", "1912", "1913", "1914", "1915", "1916", "1917", "1918", "1920", "1921", "1922", "1928", "1929", "1933", "1934", "1937", "1941", "1942", "1947", "1948", "1955", "1957", "1958", "1959", "1983", "1984", "1990", "1991", "1993", "1994", "2001", "2002", "2008", "2010", "2011", "2012", "2013", "2014", "2017", "2018", "2024", "2026", "2027", "2030", "2031", "2037", "2038", "2039", "2040", "2042", "2043", "2044", "2047", "2048", "2056", "2057", "2061", "2062", "2065", "2066", "2069", "2071", "2072", "2073", "2077", "2078", "2079"]
  51.        db.set(`iM_${user.id}`, SR[Math.floor(Math.random() * SR.length)])
  52.        db.add(`sr_${user.id}`, 1)
  53.        console.log(`${user.username} has scout an SR!`)
  54.  
  55.        }
  56.  
  57.        //R = 29%
  58.        if (l <= 68 && l >= 40) {
  59.        let R = ["28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "83", "146", "147", "148", "225", "284", "285", "256", "257", "288", "289", "290", "291", "292", "298", "299", "300", "301", "302", "303", "304", "305", "306", "334", "335", "336", "337", "338", "339", "340", "341", "342", "379", "380", "381", "421", "430", "431", "432", "433", "434", "435", "436", "437", "438", "494", "495", "496", "497", "498", "499", "500", "501", "502", "540", "569", "570", "571", "572", "573", "574", "575", "576", "577", "610", "611", "612", "613", "614", "615", "616", "617", "618", "668", "679", "680", "681", "682", "683", "684", "685", "686", "687", "749", "750", "751", "752", "753", "754", "755", "756", "757", "786", "787", "788", "789", "790", "791", "792", "793", "794", "801", "802", "803", "804", "805", "806", "807", "808", "809", "837", "838", "839", "864", "310", "311", "912", "913", "914", "915", "916", "917", "918", "919", "920", "922", "923", "924", "925", "926", "927", "987", "1008", "1022", "1047", "1054", "1087", "1088", "1089", "1090", "1091", "1092", "1093", "1094", "1095", "1239", "1240", "1241", "1242", "1243", "1244", "1245", "1246", "1274", "1301", "1302", "1303", "1304", "1305", "1306", "1307", "1308", "1309", "1432", "1433", "1434", "1435", "1436", "1437", "1438", "1439", "1440", "1516", "1517", "1518", "1519", "1520", "1521", "1522", "1523", "1524", "1525", "1526", "1527", "1528", "1529", "1530", "1531", "1532", "1533", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1970", "1970", "1972", "1973", "1974", "1975", "1976", "1977", "1978", "1979"]
  60.        db.set(`iM_${user.id}`, R[Math.floor(Math.random() * R.length)])
  61.        db.add(`rc_${user.id}`, 1)
  62.        console.log(`${user.username} has scout an R!`)
  63.  
  64.        }
  65.  
  66.        if (l <= 98 && l >= 69) {
  67.        let N = ["2082", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "69", "702", "76", "84", "85", "91", "97", "98", "102", "120", "106", "121", "128", "130", "135", "140", "149", "151", "156", "160", "166", "168", "173", "175", "181", "183", "188", "191", "197", "199", "209", "215", "218", "223", "244", "251", "253", "258", "260", "266", "268", "273", "275", "281", "283", "297", "310", "316", "318", "323", "325", "331", "333", "348", "353", "359", "363", "368", "373", "391", "393", "398", "403", "409", "411", "416", "420", "427", "429", "443", "451", "457", "459", "466","471", "477", "479", "485", "493", "508", "510", "515", "526", "532", "534", "539", "544", "550", "552", "557", "560", "566", "568", "582", "585", "591", "596", "601", "603", "609", "630", "635", "638", "644", "646", "651", "654", "660", "662", "667", "670", "676", "678", "693", "696", "702", "704", "709", "721", "727", "729", "734", "739", "745", "748", "762", "767", "773", "775", "783", "785", "8002", "811", "816", "819", "832", "836", "844", "847", "856", "858", "863", "866", "875", "877", "8282", "884", "893", "896", "901", "904", "958", "961", "966", "969", "975", "981", "986", "992", "998", "1003", "1008", "1013", "1019", "1026", "1031", "1036", "1042", "1049", "1056", "1061", "1067", "1074", "1079", "1086", "1101", "1106", "1111", "1116", "1122", "1128", "1133", "1139", "1445", "1150", "1155", "1160", "1166", "1173", "1178", "1183", "1189", "1194", "1199", "1204", "1216", "1221", "1227", "1233", "1238", "1252", "1257", "1263", "1269", "1274", "1279", "1285", "1290", "1295", "1300", "1315", "1334", "1346", "1354", "1359", "1364", "1370", "1381", "1398", "1406", "1412", "1420", "1431", "1446", "1455", "1460", "1466", "1475", "1485", "1499", "1507", "1519", "1559", "1980", "1981", "1982", "2076"]
  68.        db.set(`iM_${user.id}`, N[Math.floor(Math.random() * N.length)])
  69.        db.add(`n_${user.id}`, 1)
  70.        console.log(`${user.username} has scout an N!`)
  71.        }
  72.  
  73.        //Trừ gems trong tài khoản :3
  74.        db.subtract(`gems_${user.id}`, 5)
  75.        //Thêm exp :3
  76.        db.add(`xp_${user.id}`, 10)
  77.  
  78.        db.set(`latest_${user.id}`, iM)
  79.  
  80.        let embed = new Discord.RichEmbed()
  81.        .setAuthor('Scout', message.author.displayAvatarURL)
  82.        .setTitle("You has scout the **#" + iM + "** card!")
  83.        .setColor(ColorEmbed)
  84.        .setImage(`http://kachagain.com/llsif/cards/${iM}.png`);
  85.        message.channel.send(embed)
  86.        message.react('🎉')
  87.  
  88.        console.log(`${user.username} has scout new card: ${iM} with l is ${l}`)
  89.    }
  90.    }
  91.    if (args[0] === "stat" || args[0] === "STAT") {
  92.            let ur = db.fetch(`ur_${user.id}`)
  93.            if (ur === null) ur = 0
  94.  
  95.            let sr = db.fetch(`sr_${user.id}`)
  96.            if (sr === null) sr = 0
  97.  
  98.            let ssr = db.fetch(`ssr_${user.id}`)
  99.            if (ssr === null) ssr = 0
  100.  
  101.            let rc = db.fetch(`rc_${user.id}`)
  102.            if (rc === null) rc = 0
  103.  
  104.            let n = db.fetch(`n_${user.id}`)
  105.            if (n === null) n = 0
  106.  
  107.  
  108.        message.channel.send(`${user}, here is your stat: \n UR  : ${ur} \n SSR : ${ssr} \n SR  : ${sr} \n R   : ${rc} \n N   : ${n}` )
  109.    }
  110.  
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement