Vertix Show Selected Camo

Shows the selected camo, and a preview of the camo.

  1. // ==UserScript==
  2. // @name Vertix Show Selected Camo
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Shows the selected camo, and a preview of the camo.
  6. // @author Supercap
  7. // @match http://vertix.io/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var realClassInfo = [];
  12. realClassInfo.push({
  13. realName: "Tony Cavalaro",
  14. prime: "SMG",
  15. second: "",
  16. url: "https://b.thumbs.redditmedia.com/3SB6OOt62UmKqsJfaD2NOmV15y6qdEec5hyUXlXIU0s.png"
  17. });
  18. realClassInfo.push({
  19. realName: "Detective Valentine",
  20. prime: "Desert Eagle",
  21. second: "Grenade Launcher",
  22. url: "https://b.thumbs.redditmedia.com/d0ydWrUlVAXA6wABIQdM5_A1zjdTzFIVVS5NwSTFmUA.png"
  23. });
  24. realClassInfo.push({
  25. realName: "John Nash",
  26. prime: "Sniper Rifle",
  27. second: "Fully-automatic Pistol",
  28. url: "https://b.thumbs.redditmedia.com/2Uzmgj6pLZKDdbUIn_1YF-eE5dVB8NtBsPqYBJ4V-7M.png"
  29. });
  30.  
  31. realClassInfo.push({
  32. realName: "Billy",
  33. prime: "Toy Blaster",
  34. second: "",
  35. url: "https://b.thumbs.redditmedia.com/QjbAlNx5lk0m6G6G9wxyBuwYN-j_Vkcst8pbrtZLjdw.png"
  36. });
  37.  
  38. realClassInfo.push({
  39. realName: "Vincent De Vries",
  40. prime: "Shotgun",
  41. second: "Grenade Launcher",
  42. url: "https://b.thumbs.redditmedia.com/SWWX4FlRtlGVcqj_AioVe-edfgXXuV4twVJJah64nbw.png"
  43. });
  44.  
  45. realClassInfo.push({
  46. realName: "General Weiss",
  47. prime: "Rocket Launcher",
  48. second: "",
  49. url: "https://b.thumbs.redditmedia.com/2ykC2EWG7I_Var-c6zFhKD0J7bVBoXBZ7JKxiLSs6Kk.png"
  50. });
  51. realClassInfo.push({
  52. realName: "Hank",
  53. prime: "Minigun",
  54. second: "",
  55. url: "https://b.thumbs.redditmedia.com/BU_G_AyJYAItnngBhMzuzJ-ht7gui9MZT_YXUuIdWoo.png"
  56. });
  57.  
  58. realClassInfo.push({
  59. realName: "Aronsit",
  60. prime: "Flame Thrower",
  61. second: "",
  62. url: "https://b.thumbs.redditmedia.com/WomacWBYSl5lVXPthxJG-ab_ZZC9yqBvl1vVRrBtghY.png"
  63. });
  64.  
  65. realClassInfo.push({
  66. realName: "Duck",
  67. prime: "Jump",
  68. second: "",
  69. url: "https://b.thumbs.redditmedia.com/8TR5TxMkvbuuP1W1e6FfDACDaKN2U6rv4qm78_xpH-g.png"
  70. });
  71.  
  72. realClassInfo.push({
  73. realName: "Nademan",
  74. prime: "Nade Launcher",
  75. second: "",
  76. url: "https://b.thumbs.redditmedia.com/36ecl8FUeDO2IQ717-Q2I68GBkFN5zhRC6mVhrhs4as.png"
  77. });
  78.  
  79.  
  80.  
  81. function showClassInfo() {
  82. try {
  83. var classDisplay = document.getElementById("charClass");
  84. classDisplay.innerHTML = "<b>Secondary:</b><div onclick=\"showClassselector();\" class='hatSelectItem' style='display:inline-block; color:rgba(0, 0, 0, 0.4);'>"+ characterClasses[currentClassID].classN +"<div class='hoverTooltip'><div style='float:left; margin-top:10px; margin-right:10px; width:62px; height:62px; background:url("+ realClassInfo[currentClassID].url +"); background-size:cover; background-repeat:no-repeat; background-position:50% 50%;'></div><div style='color:; font-size:16px; margin-top:5px;'>"+ realClassInfo[currentClassID].realName + "</div><div style='color:#ffd100; font-size:12px; margin-top:0px;'>"+ realClassInfo[currentClassID].prime +"</div><div style='font-size:8px; color:#d8d8d8; margin-top:1px;'>"+ realClassInfo[currentClassID].second +"</div><div style='font-size:12px; margin-top:5px;'></div><div style='font-size:8px; color:#d8d8d8; margin-top:5px;'><i></i></div></div></div>";
  85. } catch(err) {
  86. }
  87. }
  88.  
  89. // weapon skin code
  90. var b=0;
  91.  
  92. var interval = setInterval(function(){
  93. if(document.getElementById("playerNameInput").value !== "") {
  94. showClassInfo();
  95. ShowCurrentWeaponAll();
  96.  
  97. document.getElementById("classItem0").addEventListener("click", showClassInfo, false);
  98. document.getElementById("classItem1").addEventListener("click", showClassInfo, false);
  99. document.getElementById("classItem2").addEventListener("click", showClassInfo, false);
  100. document.getElementById("classItem3").addEventListener("click", showClassInfo, false);
  101. document.getElementById("classItem4").addEventListener("click", showClassInfo, false);
  102. document.getElementById("classItem5").addEventListener("click", showClassInfo, false);
  103. document.getElementById("classItem6").addEventListener("click", showClassInfo, false);
  104. document.getElementById("classItem7").addEventListener("click", showClassInfo, false);
  105. document.getElementById("classItem8").addEventListener("click", showClassInfo, false);
  106. document.getElementById("classItem9").addEventListener("click", showClassInfo, false);
  107. document.getElementById("charWpn").addEventListener("click",function bzero() {b=0;}, false);
  108. document.getElementById("charWpn2").addEventListener("click",function bone() {b=1;}, false);
  109. document.getElementById("camoList").addEventListener("click",ShowCurrentWeapon, false);
  110. document.getElementById("classList").addEventListener("click",ShowCurrentWeaponAll, false);
  111. clearInterval(interval);
  112. }
  113. }, 100);
  114.  
  115. function ShowCurrentWeaponAll() {
  116. b=0;
  117. ShowCurrentWeapon();
  118. b=1;
  119. ShowCurrentWeapon();
  120. }
  121.  
  122. function ShowCurrentWeapon() {
  123. try {
  124. var a = characterClasses[currentClassID].weaponIndexes[b]; /* get the weapon id */
  125. var x=0;
  126. if(getCookie("wpnSkn"+a) !=getCookie("wpnSknundefined")) { /* if the default weapon is NOT selected */
  127. while(camoDataList[a][x].id != getCookie("wpnSkn"+a)) { /* find the proper id of the camo */
  128. x=x+1;
  129. }
  130. }
  131. else { /* if the defualt weapon is selected */
  132. if(camoDataList[a][x].name != "Art of War") { /* this is a work around to the bug in vertix, Art of War and default have the same id */
  133. if(b===0) { characterWepnDisplay.innerHTML = "<b>Primary:</b><div class='hatSelectItem' style='display:inline-block'>" + characterClasses[currentClassID].pWeapon + "</div>"; }
  134. else { characterWepnDisplay2.innerHTML = "<b>Secondary:</b><div class='hatSelectItem' style='display:inline-block'>" + characterClasses[currentClassID].sWeapon + "</div>"; }
  135. return;
  136. }
  137. }
  138. if(b===0) { characterWepnDisplay.innerHTML = "<b>Primary:</b><div class='hatSelectItem' style='display:inline-block; color:" + getItemRarityColor(camoDataList[a][x].chance) + ";'>" + camoDataList[a][x].name + " x" + (parseInt(camoDataList[a][x].count) + 1) + "<div class='hoverTooltip'><div style='float:left; margin-top:10px; margin-right:10px; width:62px; height:62px; background:url(" + getCamoURL(camoDataList[a][x].id) + "); background-size:cover; background-repeat:no-repeat; background-position:50% 50%;'></div><div style='color:" + getItemRarityColor(camoDataList[a][x].chance) + "; font-size:16px; margin-top:5px;'>" + camoDataList[a][x].name + "</div><div style='color:#ffd100; font-size:12px; margin-top:0px;'>droprate " + camoDataList[a][x].chance + "%</div><div style='font-size:8px; color:#d8d8d8; margin-top:1px;'><i>weapon camo</i></div><div style='font-size:12px; margin-top:5px;'>" + characterClasses[currentClassID].pWeapon + " weapon skin.</div><div style='font-size:8px; color:#d8d8d8; margin-top:5px;'><i></i></div></div></div>"; }
  139. else { characterWepnDisplay2.innerHTML = "<b>Secondary:</b><div class='hatSelectItem' style='display:inline-block; color:" + getItemRarityColor(camoDataList[a][x].chance) + ";'>" + camoDataList[a][x].name + " x" + (parseInt(camoDataList[a][x].count) + 1) + "<div class='hoverTooltip'><div style='float:left; margin-top:10px; margin-right:10px; width:62px; height:62px; background:url(" + getCamoURL(camoDataList[a][x].id) + "); background-size:cover; background-repeat:no-repeat; background-position:50% 50%;'></div><div style='color:" + getItemRarityColor(camoDataList[a][x].chance) + "; font-size:16px; margin-top:5px;'>" + camoDataList[a][x].name + "</div><div style='color:#ffd100; font-size:12px; margin-top:0px;'>droprate " + camoDataList[a][x].chance + "%</div><div style='font-size:8px; color:#d8d8d8; margin-top:1px;'><i>weapon camo</i></div><div style='font-size:12px; margin-top:5px;'>" + characterClasses[currentClassID].sWeapon + " weapon skin.</div><div style='font-size:8px; color:#d8d8d8; margin-top:5px;'><i></i></div></div></div>"; }
  140. }
  141. catch (err) {
  142. }
  143. }