SHARE
TWEET

Untitled

a guest Sep 11th, 2019 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var badcodes = [];
  2. var pointsredeemed = [];
  3. var points = 0;
  4. var temppoints;
  5. var totalpointsredeemed = 0;
  6. var emailpointsredeemed = 0;
  7. var creatorpointsredeemed = 0;
  8. var vaultpointsredeemed = 0;
  9. var emailpoints;
  10. var creatorpoints;
  11. var vaultpoints;
  12.  
  13. var apibase = 'https://2kgames.crowdtwist.com/code-redemption-campaign/redeem?cid=';
  14.  
  15. async function httppost(codeinfo) {
  16. var response = await fetch(apibase + codeinfo.cid, {
  17.      method: 'POST',
  18.      mode: 'cors',
  19.      body: JSON.stringify({
  20.          code: codeinfo.code
  21.      }),
  22.      headers: {
  23.          'Content-type' : 'application/json'
  24.      }
  25. })
  26.  
  27. let result = await response.json();
  28.  
  29. if (result.points) {
  30.     pointsredeemed.push(result.points);
  31.     temppoints = result.points;
  32.     return temppoints;
  33. } else {
  34.     badcodes.push(codeinfo.code);
  35.     return null;
  36. }
  37.  
  38.  
  39. return null;
  40. }
  41. var vaultcid = 5261;
  42. var emailcid = 5264;
  43. var creatorcid = 5263;
  44. var boostcid = 5721;
  45.  
  46.  
  47. var EMAILS = [
  48.     "BL3REVEAL",
  49.     "BL3WELCOME",
  50.     "LOOTLOOTLOOT",
  51.     "FIGHT4SANCTUARY",
  52.     "BL3ATE3",
  53.     "2kLove",
  54.     "HEYSUGAR",
  55.     "SOHAPPYTOGETHER",
  56.     "CLAPTASTIC",
  57.     "MYMAIN",
  58.     "ONTHEHUNT",
  59.     "FRESHBOOTY",
  60.     "POWERUPEMAIL",
  61.     "Dasherz",
  62.     "LESSTHANTHREE",
  63.     "BUILDURSQUAD",
  64.     "OVERCLOCKED",
  65.     "FORTNITEXMAYHEM",
  66.     "ABCEASYAS123",
  67.     "DUCTTAPEMOD",
  68.     "MADSKILLZ",
  69.     "ITSHERE",
  70.     "JABBER",
  71.     "Unblinkingeye",
  72.     "ALMOSTTHERE"
  73. ]
  74.  
  75. var CREATORS = [
  76.     "PROFESSORBROMANVIP",
  77.     "KINGGOTHALIONVIP",
  78.     "PietSmietVIP",
  79.     "JoltzDude139VIP",
  80.     "JvtvVIP",
  81.     "AdmiralbahrooVIP",
  82.     "Ki11erSixVIP",
  83.     "MitsuShowVIP",
  84.     "TessachkaVIP",
  85.     "LaraLoftVIP",
  86.     "MitsuShowE3",
  87.     "TessachkaE3",
  88.     "EdEMonsterE3",
  89.     "Joltzdude139E3",
  90.     "Ki11ersixE3",
  91.     "KingGothalionE3",
  92.     "ProfessorBromanE3",
  93.     "AdmiralBahrooE3",
  94.     "dammit2hellE3",
  95.     "NAYSYE3",
  96.     "LUCKYBONEZE3",
  97.     "GRIMMBONEZE3",
  98.     "CohhVIP",
  99.     "Cure4Kids",
  100.     "GREGORONKH",
  101.     "BONJWA-BL3LAUNCH",
  102.     "LARALOFT-BL3LAUNCH",
  103.     "PIETSMIET-BL3LAUNCH",
  104.     "EARLYACCESS"
  105. ]
  106.  
  107. var VAULTS = [
  108.     "WUBWUBWUB",
  109.     "JOYPUKE",
  110.     "LOADINGBAR",
  111.     "IGNVIP",
  112.     "Borderlands3vip",
  113.     "TWITCHVIP",
  114.     "GAMESPOTVIP",
  115.     "FACEBOOKVIP",
  116.     "SHACKNEWSVIP",
  117.     "GAMEVIP",
  118.     "WEGOTUBOO",
  119.     "LOWCOSTCOSPLAYE3",
  120.     "BORDERLANDSCOSPLAYE3",
  121.     "ILOVEBAGUETTE",
  122.     "BL3FREVENTVIP",
  123.     "WHATCHUWANT",
  124.     "MUSHYSNUGGLEBITES",
  125.     "OOPS",
  126.     "BORDERLENS",
  127.     "Skagbait",
  128.     "VIP-GUNWALL",
  129.     "VIP-GIFTSHOP",
  130.     "VIP-REDCHEST",
  131.     "VIP-COV",
  132.     "VIP-MOXXI",
  133.     "VIP-ENVART",
  134.     "VIP-CALYPSO",
  135.     "VIP-CHARCONCEPT",
  136.     "VIP-BOXCONCEPT",
  137.     "VIP-PHOTOBOOTH",
  138.     "BL3MUSEUMCOSPLAY",
  139.     "3DJUEGOSVIP",
  140.     "HALVERHAHN",
  141.     "BRINGMEABUCKET",
  142.     "MAYHEMPRIDE",
  143.     "PWR2PLYRS",
  144.     "THESEPRETZELSSUCK",
  145.     "TINKABOUTIT",
  146.     "LOOTSPLOSION",
  147.     "BONERFART",
  148.     "LETSMAKESOMEMAYHEM",
  149.     "MAYHEM",
  150.     "CRUMPOCALYPSE",
  151.     "Childrenofthevault",
  152.     "WACHSK4G",
  153.     "JABBERKUMP3L",
  154.     "D1G1KLON",
  155.     "RA1LGUN",
  156.     "5piderantcenturio",
  157.     "Phasenkl4mmerung",
  158.     "1ronbear",
  159.     "Sntnl",
  160.     "Phasenproj3ktion",
  161.     "Ph4senschlag",
  162.     "1CODE",
  163.     "GODSDONTNEGOTIATE",
  164.     "Ehrenmann",
  165.     "TWOWEEKS",
  166.     "VIP-PAXINIT",
  167.     "VIP-PAXALAX",
  168.     "VIP-SUPERPAX",
  169.     "VIP-EATINGPAX",
  170.     "JVMVIP",
  171.     "VIP-LOOTPAX",
  172.     "VIP-PAXSCAVENGER",
  173.     "PAXSCAVENGER",
  174.     "VIP-PAXATYA",
  175.     "VIP-PAXATTACK",
  176.     "VIP-TAKEITTOTHEPAX",
  177.     "VIP-PAXTASTIC",
  178.     "SMARTOYSVIP",
  179.     "MEDIAMARKTVIP",
  180.     "Bolvip",
  181.     "GAMEMANIAVIP",
  182.     "ALLYOURGAMESVIP",
  183.     "NEDGAMEVIP",
  184.     "YOURGAMEZONEVIP",
  185.     "VIP-DEATHANDPAXES",
  186.     "VIP-SMACKTHATPAX",
  187.     "VIP-KEEPINGITPAX",
  188.     "INTERTOYSVIP",
  189.     "PLAYERONEVIP",
  190.     "VIP-ANOTHERPAXPUN",
  191.     "vip-paxagainstthewall",
  192.     "SEVENDAYS",
  193.     "AIRLEMAGVIP",
  194.     "Dreamlandvip"
  195. ]
  196.  
  197.  
  198. async function emailmap() {
  199.     emailpoints = await Promise.all(EMAILS.map(async function(email) {
  200.         var type = {
  201.             code : email,
  202.             cid : emailcid
  203.         };
  204.         temppoints = await httppost(type);
  205.         emailpointsredeemed = emailpointsredeemed + temppoints;
  206.         return emailpointsredeemed;
  207. }))};
  208.  
  209. async function creatorsmap() {
  210.     creatorspoints = await Promise.all(CREATORS.map(async function(creator) {
  211.     var type = {
  212.         code : creator,
  213.         cid : creatorcid
  214.     };
  215.     temppoints = await httppost(type);
  216.     creatorpointsredeemed = creatorpointsredeemed + temppoints;
  217.     return creatorpointsredeemed;
  218. }))};
  219.  
  220. async function vaultmap() {
  221.     vaultpoints = await Promise.all(VAULTS.map(async function(vault) {
  222.     var type = {
  223.         code : vault,
  224.         cid : vaultcid
  225.     };
  226.     temppoints = await httppost(type);
  227.     vaultpointsredeemed = vaultpointsredeemed + temppoints;
  228.     return vaultpointsredeemed;
  229. }))}
  230.  
  231. async function gatherpoints() {
  232.     var [totalemailpoints, totalcreatorpoints, totalvaultpoints] = await Promise.all([emailmap(), creatorsmap(), vaultmap()]);
  233.     var totalpoints = emailpointsredeemed + creatorpointsredeemed + vaultpointsredeemed;
  234.     console.log("Total Points: ", totalpoints);
  235.     alert("Total Points Redeemed: " + totalpoints)
  236. }
  237.  
  238.  
  239. async function main() {
  240.     gatherpoints();
  241. }
  242.  
  243. main();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top