User:Placebuilder/common.js

importArticles({   type: 'script',    articles: [        'u:dev:MediaWiki:AdminDashboard block/code.js', 'u:dev:MediaWiki:MarkBlocked.js',    ] }); importScriptPage('AjaxRC/code.js', 'dev'); /* Any JavaScript here will be loaded for all users on every page load. */ // This is an example configuration window.railWAM = { logPage: "My log page" }; //auto refresh window.AjaxRCRefreshText = 'Auto-Refresh'; window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; window.ajaxPages = [ "Special:RecentChanges", "Special:WikiActivity", "Special:UncategorizedPages", "Special:AllPages" ]; //Test-page text box with results: function onClick252 { document.getElementById('mw-content-text').getElementsByClassName("change-this")[0].textContent = document.getElementById('mw-content-text').getElementsByClassName("input21")[0].value * 2; } //make sure to only do it on the test-page: if (mw.config.get('wgPageName') == 'Test-page') { document.getElementById('mw-content-text').innerHTML += ' '; document.getElementById('mw-content-text').innerHTML += 'Get Value Times Two ';   document.getElementById('mw-content-text').innerHTML += '1 '; } //Make a dialog on the Prison Cell NPC Page: var PCNPCcurrent_slide = 0; var PCNPCamount_of_slides = 2; function NextOnSlideClickPCNPC {    PCNPCcurrent_slide++;    if (PCNPCcurrent_slide > PCNPCamount_of_slides) {        PCNPCcurrent_slide = PCNPCamount_of_slides;    }    switch (PCNPCcurrent_slide) {        case 0:            document.getElementById('mw-content-text').getElementsByClassName("dialog_text")[0].textContent = "Hey your new here right? Maybe I can Help you escape.";           break;        case 1:            document.getElementById('mw-content-text').getElementsByClassName("dialog_text")[0].textContent = "See this box behind me? The prison has containers like this all over to loot.";           break;        case 2:            document.getElementById('mw-content-text').getElementsByClassName("dialog_text")[0].textContent = "Search around the prison and you might find some materials! You will automatically craft items when you have the required materials.";           break;    } } function PreviousOnSlideClickPCNPC {    PCNPCcurrent_slide--;    if (PCNPCcurrent_slide < 0) {        PCNPCcurrent_slide = 0;    }    switch (PCNPCcurrent_slide) {        case 0:            document.getElementById('mw-content-text').getElementsByClassName("dialog_text")[0].textContent = "Hey your new here right? Maybe I can Help you escape.";           break;        case 1:            document.getElementById('mw-content-text').getElementsByClassName("dialog_text")[0].textContent = "See this box behind me? The prison has containers like this all over to loot.";           break;        case 2:            document.getElementById('mw-content-text').getElementsByClassName("dialog_text")[0].textContent = "Search around the prison and you might find some materials! You will automatically craft items when you have the required materials.";           break;    } } if (mw.config.get('wgPageName') == 'Prison_Cell_NPC') {    document.getElementById('mw-content-text').innerHTML += 'Hey your new here right? Maybe I can Help you escape. ';    document.getElementById('mw-content-text').innerHTML += ' Next  ';    document.getElementById('mw-content-text').innerHTML += ' Previous  '; } function EcodeFunction1 {    var Ecanvas = document.getElementById("mw-content-text").getElementsByClassName("Ecanvas");    var ctx = Ecanvas[0].getContext("2d");    ctx.beginPath;    ctx.fillStyle = 'gray'; ctx.fillRect(0, 0, 50, 50); ctx.fillStyle = 'gray'; } if (mw.config.get('wgPageName') == 'Test-page') { document.getElementById('mw-content-text').innerHTML += ' '; setTimeout(EcodeFunction1, 200); } //pistol maximum damage section var pistolTempValue = 0; var pistolTimesShot = 0; var PistolLoaded = true; var PistolTimesToRepeat = 0; var PistolReloadTime = 1; function pistolIntervalLoopCode { pistolLoaded = true; pistolTempValue = document.getElementById('mw-content-text').getElementsByClassName("pistolPageMaximumDamage")[0].value; PistolTimesToRepeat = pistolTempValue; pistolTimesShot = 0; if (pistolTempValue > 0) { pistolTimesShot++; pistolTempValue -= 0.01; for (var i = 0; i < Math.ceil(PistolTimesToRepeat) * 2; i++) { if (pistolTempValue >= 0.8) { pistolTempValue -= 0.8; pistolTimesShot++; } else { break; }           if (pistolTimesShot % 14 === 0) { pistolTempValue -= PistolReloadTime; }       }        document.getElementById('mw-content-text').getElementsByClassName("pistolchangetext2314")[0].textContent = " seconds is " + (pistolTimesShot * 15).toString; if (document.getElementById('mw-content-text').getElementsByClassName("pistolPageMaximumDamage")[0].value == 1) { document.getElementById('mw-content-text').getElementsByClassName("pistolchangetext2314")[0].textContent = " second is " + (pistolTimesShot * 15).toString; }   } else { document.getElementById('mw-content-text').getElementsByClassName("pistolchangetext2314")[0].textContent = " seconds is 0/invalid input"; } } function pistolMaximumDamageExpand { if (mw.config.get('wgPageName') == 'Pistol') { if (document.getElementById('mw-content-text').getElementsByClassName("centerPistolID")[0].getElementsByClassName("ButtonPistolID")[0].innerHTML == "Show Maximum Damage Calculator") { document.getElementById('mw-content-text').innerHTML += ' The maximum damage that the pistol can do in '; document.getElementById('mw-content-text').innerHTML += ' '; document.getElementById('mw-content-text').innerHTML += ' seconds is '; document.getElementById('mw-content-text').innerHTML += 'Check '; document.getElementById('mw-content-text').getElementsByClassName("centerPistolID")[0].getElementsByClassName("ButtonPistolID")[0].remove; }   } } if (mw.config.get('wgPageName') == 'Pistol') { document.getElementById('mw-content-text').innerHTML += 'Show Maximum Damage Calculator '; } //random vehicle button on vehicles page: var randomVehicleNumber = 0; var randomVehicles = [ 'https://mad-city.fandom.com/wiki/Camaro', 'https://mad-city.fandom.com/wiki/Phantom', 'https://mad-city.fandom.com/wiki/Reaper', 'https://mad-city.fandom.com/wiki/Phantom', 'https://mad-city.fandom.com/wiki/Mini', 'https://mad-city.fandom.com/wiki/ATV', 'https://mad-city.fandom.com/wiki/Dirtbike', 'https://mad-city.fandom.com/wiki/Shelby', 'https://mad-city.fandom.com/wiki/Mustang', 'https://mad-city.fandom.com/wiki/Challenger', 'https://mad-city.fandom.com/wiki/Phantom', 'https://mad-city.fandom.com/wiki/Tracer', 'https://mad-city.fandom.com/wiki/Inferno_(Car)', 'https://mad-city.fandom.com/wiki/Thunderbird', 'https://mad-city.fandom.com/wiki/Boat', 'https://mad-city.fandom.com/wiki/Jetski', 'https://mad-city.fandom.com/wiki/Hydro', 'https://mad-city.fandom.com/wiki/Helicopter', 'https://mad-city.fandom.com/wiki/Plane', 'https://mad-city.fandom.com/wiki/Scout', 'https://mad-city.fandom.com/wiki/Buzzard', 'https://mad-city.fandom.com/wiki/Warhawk' ]; function chooseRandomVehiclePage { randomVehicleNumber = Math.round(Math.random * randomVehicles.length); window.location = randomVehicles[randomVehicleNumber]; } if (mw.config.get('wgPageName') == 'Vehicles') { document.getElementById('mw-content-text').innerHTML += ' Random Vehicle Page '; } //season 1 page rewards by rank Rewards1 = [{ Reward: "Digital Camo", Rank: 5 }, {   Reward: "Vex", Rank: 10 }, {   Reward: "Winglets", Rank: 15 }, {   Reward: "Waves", Rank: 20 }, {   Reward: "Sunburst", Rank: 25 }, {   Reward: "Magneto", Rank: 35 }, {   Reward: "Phantom", Rank: 50 }, {   Reward: "Rainbow", Rank: 70 }, {   Reward: "Speakers", Rank: 85 }, {   Reward: "Reaper", Rank: 100 }, {   Reward: "", Rank: 999 }]; var currentRewards1; function UpdateRanksEarnedByRankSeason1 { if (document.getElementById('mw-content-text').getElementsByClassName("S1RI")[0].value > 100) { document.getElementById('mw-content-text').getElementsByClassName("S1RI")[0].value = 100; }   currentRewards1 = ""; for (var i = 0; i < 11; i++) { if (document.getElementById('mw-content-text').getElementsByClassName("S1RI")[0].value >= Rewards1[i].Rank) { currentRewards1 += Rewards1[i].Reward; if (document.getElementById('mw-content-text').getElementsByClassName("S1RI")[0].value < Rewards1[i + 1].Rank) { currentRewards1 += "."; } else { currentRewards1 += " and "; }       }    }    document.getElementById('mw-content-text').getElementsByClassName("S1RICT")[0].textContent = "are: " + currentRewards1; } if (mw.config.get('wgPageName') == 'Season_1') { document.getElementById('mw-content-text').innerHTML += ' Season Rewards by Rank '; document.getElementById('mw-content-text').innerHTML += '  '; document.getElementById('mw-content-text').innerHTML += ' are: '; document.getElementById('mw-content-text').innerHTML += ' Update '; } //random hero button on the hero page var possibleLinksHeroes = ["https://mad-city.fandom.com/wiki/Hot_Rod", "https://mad-city.fandom.com/wiki/Vanta", "https://mad-city.fandom.com/wiki/Proton", "https://mad-city.fandom.com/wiki/Voltron", "https://mad-city.fandom.com/wiki/Inferno_(Hero)", "https://mad-city.fandom.com/wiki/Frostbite", "https://mad-city.fandom.com/wiki/Phantom_(Hero)"]; function Random_Hero_Page { window.location = possibleLinksHeroes[Math.round(Math.random * possibleLinksHeroes.length)]; } if (mw.config.get('wgPageName') == 'Hero') { document.getElementById('mw-content-text').innerHTML += ' <button onclick="Random_Hero_Page">Random Hero Page '; } //random color combination on jetpack page var chosenColor = 0; function NewRandomColorCombinationJetpack { for (var i = 0; i < 4; i++) { chosenColor = Math.round(Math.random * 5); if (chosenColor === 0) { document.getElementById('mw-content-text').getElementsByClassName("jetexamplecolor" + i.toString)[0].style = "background:red;color:red"; }       if (chosenColor === 1) { document.getElementById('mw-content-text').getElementsByClassName("jetexamplecolor" + i.toString)[0].style = "background:purple;color:purple"; }       if (chosenColor === 2) { document.getElementById('mw-content-text').getElementsByClassName("jetexamplecolor" + i.toString)[0].style = "background:blue;color:blue"; }       if (chosenColor === 3) { document.getElementById('mw-content-text').getElementsByClassName("jetexamplecolor" + i.toString)[0].style = "background:green;color:green"; }       if (chosenColor === 4) { document.getElementById('mw-content-text').getElementsByClassName("jetexamplecolor" + i.toString)[0].style = "background:yellow;color:yellow"; }       if (chosenColor === 5) { document.getElementById('mw-content-text').getElementsByClassName("jetexamplecolor" + i.toString)[0].style = "background:DeepPink;color:DeepPink"; }   } } if (mw.config.get('wgPageName') == 'Jetpack') { document.getElementById('mw-content-text').innerHTML += '<p class="jetexamplecolor0">color '; document.getElementById('mw-content-text').innerHTML += '<p class="jetexamplecolor1">color '; document.getElementById('mw-content-text').innerHTML += '<p class="jetexamplecolor2">color '; document.getElementById('mw-content-text').innerHTML += '<p class="jetexamplecolor3">color '; NewRandomColorCombinationJetpack; document.getElementById('mw-content-text').innerHTML += '<button onclick="NewRandomColorCombinationJetpack">Get another random color combination example '; } //awesomestrucid mediawiki:Common.js quick link button(because awesomestrucid LOVES javascript) function GoToJavascriptPage { window.location = "https://mad-city.fandom.com/wiki/MediaWiki:Common.js"; } //my userpage customizations-- //- //the -'s are to make this part easy to find by awesomestrucid- if (mw.config.get('wgPageName') == 'User:Awesomestrucid') { document.getElementById('mw-content-text').innerHTML += '<button onclick="GoToJavascriptPage">Javascript Link   '; var awesomestrucid_userdiv = document.createElement("div"); awesomestrucid_userdiv.style = "width: 120px;height: 120px;animation: awesomestrucid 5.8s infinite;"; var awesomestrucid_usernode = document.createTextNode("Hello, I am awesomestrucid welcome to my userpage!"); awesomestrucid_userdiv.appendChild(awesomestrucid_usernode); document.getElementById('mw-content-text').appendChild(awesomestrucid_userdiv); document.getElementById('mw-content-text').innerHTML += ' '; document.getElementById('mw-content-text').innerHTML += ' What rank are you in mad city? <button onclick="whatrankareu">Submit '; if (localStorage.getItem("mad-city_fandom_com_what_is_your_favorite_color") === null) { document.getElementById('mw-content-text').innerHTML += ' What is your favorite color? <button onclick="favcolfunction">Submit '; } else { document.getElementById('mw-content-text').innerHTML += ' You said that your favorite color is ' + localStorage.getItem("mad-city_fandom_com_what_is_your_favorite_color") + '. ';   }    document.getElementById('mw-content-text').innerHTML += ' You have recently viewed: '; } function whatrankareu { if (!isNaN(document.getElementById("whatrankyouare").value)) { if (document.getElementById("whatrankyouare").value < 100) { document.getElementById("xpchangetext").innerHTML = ' ' + 'Good luck getting to rank ' + (parseInt(document.getElementById("whatrankyouare").value) + 1).toString + ' '; } else if (document.getElementById("whatrankyouare").value == 100) { document.getElementById("xpchangetext").innerHTML = ' Wow, nice job getting to the max rank! ';       } else { alert("The maximum rank is 100!"); }   } else { alert("Please enter a number."); } } function favcolfunction { localStorage.setItem("mad-city_fandom_com_what_is_your_favorite_color", document.getElementById("favcolinput").value); document.getElementById("desthis").innerHTML = ' You said that your favorite color is ' + localStorage.getItem("mad-city_fandom_com_what_is_your_favorite_color") + '. '; } //xp page and ranks page input function XP_Page_Update_JS { document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value = Math.round(document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value); if (document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value < 2) { document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value = 2; }   if (document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value > 100) { document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value = 100; }   document.getElementById('mw-content-text').getElementsByClassName("ChangeForInfoXP")[0].textContent = "is " + document.getElementById('mw-content-text').getElementsByClassName("1231231112")[0].value * 50; } if (mw.config.get('wgPageName') == 'Ranks') { document.getElementById('mw-content-text').innerHTML += ' XP required to rank up to rank '; document.getElementById('mw-content-text').innerHTML += ' '; document.getElementById('mw-content-text').innerHTML += '<p class="ChangeForInfoXP">is '; document.getElementById('mw-content-text').innerHTML += '<button onclick="XP_Page_Update_JS">Update '; } if (mw.config.get('wgPageName') == 'XP') { document.getElementById('mw-content-text').innerHTML += ' XP required to rank up to rank '; document.getElementById('mw-content-text').innerHTML += ' '; document.getElementById('mw-content-text').innerHTML += '<p class="ChangeForInfoXP">is '; document.getElementById('mw-content-text').innerHTML += '<button onclick="XP_Page_Update_JS">Update '; } //recently viewed pages: if (localStorage.getItem("mad-city_fandom_com_recently_viewed") === null) { var array123123 = []; array123123[0] = mw.config.get('wgPageName'); localStorage.setItem("mad-city_fandom_com_recently_viewed", JSON.stringify(array123123)); } else { var newarray123123 = JSON.parse(localStorage.getItem("mad-city_fandom_com_recently_viewed")); if (mw.config.get('wgPageName') != 'Recently_Viewed_Pages' && mw.config.get('wgPageName') != 'MediaWiki:Common.js' && mw.config.get('wgPageName') != 'Special:WikiActivity' && mw.config.get('wgPageName') != 'Special:AdminDashboard') { newarray123123.push(mw.config.get('wgPageName')); var wafaswdfasdf = newarray123123.length; if (newarray123123[wafaswdfasdf - 1] == newarray123123[wafaswdfasdf - 2]) { newarray123123.pop; }   }    if (newarray123123.length > 40) { newarray123123.shift; }   localStorage.setItem("mad-city_fandom_com_recently_viewed", JSON.stringify(newarray123123)); } if (mw.config.get('wgPageName') == 'Recently_Viewed_Pages' || mw.config.get('wgPageName') == 'User:Awesomestrucid') { var temperaryArrayForRecentlyViewed = JSON.parse(localStorage.getItem("mad-city_fandom_com_recently_viewed")); var temperaryArrayForRecentlyViewed2 = temperaryArrayForRecentlyViewed.reverse; for (var i = 0; i < temperaryArrayForRecentlyViewed2.length; i++) { document.getElementById('mw-content-text').innerHTML += '<a' + ' href=' + 'https://mad-city.fandom.com/wiki/' + temperaryArrayForRecentlyViewed2[i] + '>' + temperaryArrayForRecentlyViewed2[i] + '</a>'; document.getElementById('mw-content-text').innerHTML += ' ';   } } //tools random tool page button var toolpages = ['Hammer', 'Screwdriver', 'Spoon', 'Picklock', 'Rope', 'C4']; function RandomToolPage { window.location = 'https://mad-city.fandom.com/wiki/' + toolpages[Math.round(Math.random * toolpages.length)]; } if (mw.config.get('wgPageName') == 'Tools') { document.getElementById('mw-content-text').innerHTML += ' <button onclick="RandomToolPage">Random Tool Page '; } //gamepasses random gamepass page button var gamepasspages = ['Heavy Weapons Gamepass', 'Vehicle Radio Gamepass', 'VIP Gamepass', 'SWAT Gamepass', 'Emote Pack 1', 'Emote Pack 2', 'Mobile Customization Gamepass', 'SCAR Gamepass']; function RandomGamepassPage { window.location = 'https://mad-city.fandom.com/wiki/' + gamepasspages[Math.round(Math.random * gamepasspages.length)]; } if (mw.config.get('wgPageName') == 'Gamepasses') { document.getElementById('mw-content-text').innerHTML += ' <button onclick="RandomGamepassPage">Random Gamepass Page '; } //all skins on skins page: function setImageURL(url) { switch (url) { case 0: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = "https://vignette.wikia.nocookie.net/mad-city/images/9/9b/Capture21.PNG/revision/latest?cb=20190306001721"; break; case 1: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/1/1d/Capture2.PNG/revision/latest?cb=20190306001339'; break; case 2: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/9/92/Capture3.PNG/revision/latest?cb=20190306001339'; break; case 3: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/7/71/RobloxScreenShot20190306_091449109.png/revision/latest?cb=20190306161605'; break; case 4: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/7/7e/Capture5.PNG/revision/latest?cb=20190306001339'; break; case 5: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/26/Capture6.PNG/revision/latest?cb=20190306001339'; break; case 6: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/7/75/Capture7.PNG/revision/latest?cb=20190306001339'; break; case 7: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/6/61/Capture8.PNG/revision/latest?cb=20190306001340'; break; case 8: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/7/7f/Capture9.PNG/revision/latest?cb=20190306001340'; break; case 9: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/8/84/Capture10.PNG/revision/latest?cb=20190306001340'; break; case 10: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/6/66/Capture11.PNG/revision/latest?cb=20190306001340'; break; case 11: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/5/5b/Capture12.PNG/revision/latest?cb=20190306001340'; break; case 12: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/e/e7/Capture13.PNG/revision/latest?cb=20190306001340'; break; case 13: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/29/Capture14.PNG/revision/latest?cb=20190306001340'; break; case 14: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/e/e3/Capture15.PNG/revision/latest?cb=20190306001340'; break; case 15: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/5/59/Capture16.PNG/revision/latest?cb=20190306001340'; break; case 16: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/f/f2/Capture17.PNG/revision/latest?cb=20190306001721'; break; case 17: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/3/30/Capture18.PNG/revision/latest?cb=20190306001721'; break; case 18: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/c/c6/Capture19.PNG/revision/latest?cb=20190306001721'; break; case 19: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/2b/Capture20.PNG/revision/latest?cb=20190306001721'; break; case 20: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/9/9b/Capture21.PNG/revision/latest?cb=20190306001721'; break; case 21: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/e/e8/Capture23.PNG/revision/latest?cb=20190306001722'; break; case 22: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/e/eb/Capture155215.PNG/revision/latest?cb=20190306002059'; break; case 23: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/e/e0/Capture1222.PNG/revision/latest?cb=20190306001722'; break; case 24: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/4/4b/Capture12322.PNG/revision/latest?cb=20190306001723'; break; case 25: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/a/a6/Capture76246.PNG/revision/latest?cb=20190306002058'; break; case 26: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/4/40/Capture123111.PNG/revision/latest?cb=20190306002059'; break; case 27: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/9/97/Capture122441.PNG/revision/latest?cb=20190306002058'; break; case 28: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/0/0a/Capture1254214.PNG/revision/latest?cb=20190306002059'; break; case 29: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/8/80/RobloxScreenShot20190309_192149518.png/revision/latest?cb=20190310022228'; break; case 30: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/5/50/Capture124122.PNG/revision/latest?cb=20190306002059'; break; case 31: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/5/54/Capture234222.PNG/revision/latest?cb=20190306002059'; break; case 32: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/2b/Capture124213.PNG/revision/latest?cb=20190306002059'; break; case 33: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/b/b3/Capture65235.PNG/revision/latest?cb=20190306002058'; break; case 34: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/e/e3/Capture1612.PNG/revision/latest?cb=20190306001723'; break; case 35: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/c/cb/Capture5122.PNG/revision/latest?cb=20190306001723'; break; case 36: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/1/17/Capture15523.PNG/revision/latest?cb=20190306001724'; break; case 37: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/0/06/Capture1234.PNG/revision/latest?cb=20190306001722'; break; } } function WindowsetImageURL(one) { switch (one) { case 0: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/8/84/JetBlackWindowColor.PNG/revision/latest?cb=20190308020218'; break; case 1: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/2b/GreenWindowColor.PNG/revision/latest?cb=20190308020233'; break; case 2: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/c/c3/CyanWindowColor.PNG/revision/latest?cb=20190308020245'; break; case 3: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/c/cf/DarkGreenWindowColor.PNG/revision/latest?cb=20190308020300'; break; case 4: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/1/10/GreyWindowColor.PNG/revision/latest?cb=20190308020350'; break; case 5: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/9/9c/HotPinkWindowColor.PNG/revision/latest?cb=20190309035751'; break; case 6: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/f/ff/BlackWindowColor.PNG/revision/latest?cb=20190309035805'; break; case 7: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/5/5a/BlueWindowColor.PNG/revision/latest?cb=20190309035816'; break; case 8: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/f/f1/LimeGreenWindowColor.PNG/revision/latest?cb=20190309035832'; break; case 9: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/2e/RedWindowColor.PNG/revision/latest?cb=20190309035848'; break; case 10: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/a/ae/AlderWindowColor.PNG/revision/latest?cb=20190309035857'; break; case 11: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/9/9a/PinkWindowColor.PNG/revision/latest?cb=20190309035909'; break; case 12: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/9/98/PurpleWindowColor.PNG/revision/latest?cb=20190309035922'; break; case 13: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/2/2f/OrangeWindowColor.PNG/revision/latest?cb=20190309035933'; break; case 14: document.getElementById('mw-content-text').getElementsByClassName("skinimage")[0].src = 'https://vignette.wikia.nocookie.net/mad-city/images/0/00/YellowWindowColor.PNG/revision/latest?cb=20190309035942'; break; } } function windowskins { document.getElementById('mw-content-text').getElementsByClassName("dropdownBox")[0].innerHTML = '<button onclick="WindowsetImageURL(0)" style="width:110px;">Jet Black <button onclick="WindowsetImageURL(1)" style="width:110px;">Green <button onclick="WindowsetImageURL(2)" style="width:110px;">Cyan <button onclick="WindowsetImageURL(3)" style="width:110px;">Dark Green <button onclick="WindowsetImageURL(4)" style="width:110px;">Grey <button onclick="WindowsetImageURL(5)" style="width:110px;">Hot Pink <button onclick="WindowsetImageURL(6)" style="width:110px;">Black <button onclick="WindowsetImageURL(7)" style="width:110px;">Blue <button onclick="WindowsetImageURL(8)" style="width:110px;">Lime Green <button onclick="WindowsetImageURL(9)" style="width:110px;">Red <button onclick="WindowsetImageURL(10)" style="width:110px;">Alder <button onclick="WindowsetImageURL(11)" style="width:110px;">Pink <button onclick="WindowsetImageURL(12)" style="width:110px;">Purple <button onclick="WindowsetImageURL(13)" style="width:110px;">Orange <button onclick="WindowsetImageURL(14)" style="width:110px;">Yellow '; } function surfaceskins { document.getElementById('mw-content-text').getElementsByClassName("dropdownBox")[0].innerHTML = '<button onclick="setImageURL(0)" style="width:110px;">White <button onclick="setImageURL(1)"style="width:110px;">Sunburst <button onclick="setImageURL(2)" style="width:110px;">Rainbow <button onclick="setImageURL(3)" style="width:110px;">Sunbeam <button onclick="setImageURL(4)" style="width:110px;">Digital Camo <button onclick="setImageURL(29)" style="width:110px;">Vice <button onclick="setImageURL(5)" style="width:110px;">Monochrome <button onclick="setImageURL(6)" style="width:110px;">Hot Pink <button onclick="setImageURL(7)" style="width:110px;">Alder <button onclick="setImageURL(8)" style="width:110px;">Pastel Pink <button onclick="setImageURL(9)" style="width:110px;">Green <button onclick="setImageURL(10)" style="width:110px;">Aqua <button onclick="setImageURL(11)" style="width:110px;">Black <button onclick="setImageURL(12)" style="width:110px;">Cool Yellow <button onclick="setImageURL(13)" style="width:110px;">Yellow <button onclick="setImageURL(14)" style="width:110px;">Jet Black <button onclick="setImageURL(15)" style="width:110px;">Maroon <button onclick="setImageURL(16)" style="width:110px;">Pastel Blue <button onclick="setImageURL(17)" style="width:110px;">Blue <button onclick="setImageURL(18)" style="width:110px;">Dark Green <button onclick="setImageURL(19)" style="width:110px;">Purple <button onclick="setImageURL(20)" style="width:110px;">Pastel Green <button onclick="setImageURL(21)" style="width:110px;">Lime Green <button onclick="setImageURL(22)" style="width:110px;">Gray <button onclick="setImageURL(23)" style="width:110px;">Pastel Violet <button onclick="setImageURL(24)" style="width:110px;">Pink <button onclick="setImageURL(25)" style="width:110px;">Orange <button onclick="setImageURL(26)" style="width:110px;">Red <button onclick="setImageURL(27)" style="width:110px;">Candian <button onclick="setImageURL(28)" style="width:110px;">Checkers <button onclick="setImageURL(30)" style="width:110px;">Red Web <button onclick="setImageURL(31)" style="width:110px;">Zebra <button onclick="setImageURL(32)" style="width:110px;">Camo <button onclick="setImageURL(33)" style="width:110px;">Matrix <button onclick="setImageURL(34)" style="width:110px;">Tron <button onclick="setImageURL(35)" style="width:110px;">Black Hex <button onclick="setImageURL(36)" style="width:110px;">Paint Splatter <button onclick="setImageURL(37)" style="width:110px;">Asiimov '; } function viewskins { document.getElementById('mw-content-text').getElementsByClassName("buttony123")[0].remove; document.getElementById('mw-content-text').innerHTML += ' <button onclick="surfaceskins">Surface Skins <button  onclick="windowskins">Window Skins  '; document.getElementById('mw-content-text').innerHTML += '<img width="380" align="right" src="https://vignette.wikia.nocookie.net/mad-city/images/5/5d/Main_photo.png/revision/latest?cb=20190207004915" class="skinimage">'; document.getElementById('mw-content-text').innerHTML += ' '; } if (mw.config.get('wgPageName') == 'Skins') { document.getElementById('mw-content-text').innerHTML += '<button class="buttony123" onclick="viewskins">View all skins '; } //glitches warning if (mw.config.get('wgPageName') == 'Codes') { var para = document.createElement("p"); para.style = "color:blue"; var node = document.createTextNode("All codes are from Taymasters, Famed Chris, and nic10telf twitters."); para.appendChild(node); document.getElementById('mw-content-text').appendChild(para); } //season 2 rewards var season2_rewards = [{ Rank: 5, Reward: "Oreo" }, {   Rank: 10, Reward: "Candy Web" }, {   Rank: 15, Reward: "Gecko" }, {   Rank: 20, Reward: "Frosted" }, {   Rank: 25, Reward: "Pinwheel" }, {   Rank: 30, Reward: "Pony" }, {   Rank: 35, Reward: "Lilac" }, {   Rank: 40, Reward: "Splitwing" }, {   Rank: 45, Reward: "Raspberry" }, {   Rank: 50, Reward: "F1" }, {   Rank: 55, Reward: "Estremo" }, {   Rank: 60, Reward: "Streamline" }, {   Rank: 65, Reward: "Rage" }, {   Rank: 70, Reward: "Blueberry" }, {   Rank: 75, Reward: "Raptor" }, {   Rank: 80, Reward: "Hornet" }, {   Rank: 85, Reward: "Azure" }, {   Rank: 90, Reward: "Breakdown" }, {   Rank: 95, Reward: "Vice" }, {   Rank: 100, Reward: "Hoverboard" }, {   Rank: 120, Reward: "" }]; var currentseason2list = []; function getseasontworewards { if (document.getElementById("season2button").value > 100) { document.getElementById("season2button").value = 100; }   if (document.getElementById("season2button").value < 2) { document.getElementById("season2button").value = 2; }   document.getElementById("season2button").value = Math.round(document.getElementById("season2button").value); currentseason2list = []; for (var i = 0; i < season2_rewards.length; i++) { if (season2_rewards[i].Rank <= document.getElementById("season2button").value) { if (season2_rewards[i + 1].Rank <= document.getElementById("season2button").value) { currentseason2list.push(season2_rewards[i].Reward + " and "); } else { currentseason2list.push(season2_rewards[i].Reward + "."); }       }    }    document.getElementById("season_2_change_text").innerHTML = "are: "; for (var i = 0; i < currentseason2list.length; i++) { document.getElementById("season_2_change_text").innerHTML += currentseason2list[i]; } } if (mw.config.get('wgPageName') == 'Season_2') { var para2 = document.createElement("p"); var node2 = document.createTextNode("The season 2 rewards unlocked by rank"); para2.appendChild(node2); document.getElementById('mw-content-text').appendChild(para2); var button1 = document.createElement("input"); button1.value = "0"; button1.id = "season2button"; var node4 = document.createTextNode(""); button1.appendChild(node4); document.getElementById('mw-content-text').appendChild(button1); var para3 = document.createElement("p"); para3.id = "season_2_change_text"; var node3 = document.createTextNode("are"); para3.appendChild(node3); document.getElementById('mw-content-text').appendChild(para3); document.getElementById('mw-content-text').innerHTML += '<button onclick="getseasontworewards;">Update '; } /* //navigation function detectmob { if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i) ){ return true; } else { return false; } } if(detectmob){ document.getElementById('mw-content-text').innerHTML+='<button class="sticky" onclick="onclickButtonNav" id="navbut" style="visibility:hidden;top:480px;">Navigation '; function onclickButtonNav{ if(document.getElementById("nav").style.display ==''){ document.getElementById("nav").style.display = 'block'; }else{ document.getElementById("nav").style.display = ''; } } function setContentForNav(content){ if(content==1){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Prison_Cell_NPC'>Prison Cell NPC</a></li></ul>"; }   if(content==2){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Police'>Police</a></li><li><a href='https://mad-city.fandom.com/wiki/Prisoner'>Prisoner</a></li><li><a href='https://mad-city.fandom.com/wiki/Hero'>Hero</a></li><li><a href='https://mad-city.fandom.com/wiki/Criminal'>Criminal</a></li></ul>"; }   if(content==3){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Heists'>Heists</a></li><li><a href='https://mad-city.fandom.com/wiki/Bank'>Bank</a></li><li><a href='https://mad-city.fandom.com/wiki/Casino'>Casino</a></li><li><a href='https://mad-city.fandom.com/wiki/Jewelry_Store'>Jewelry Store</a></li><li><a href='https://mad-city.fandom.com/wiki/Nightclub'>Nightclub</a></li></ul>"; }   if(content==4){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Weapons'>Weapons</a></li></ul>"; }   if(content==5){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Vehicles'>Vehicles</a></li></ul>"; }   if(content==6){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/ATM'>ATM</a></li><li><a href='https://mad-city.fandom.com/wiki/Cash_Register'>Cash Register</a></li><li><a href='https://mad-city.fandom.com/wiki/Slot_Machines'>Slot Machines</a></li></ul>"; }   if(content==7){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Crafting'>Crafting</a></li><li><a href='https://mad-city.fandom.com/wiki/Materials'>Materials</a></li><li><a href='https://mad-city.fandom.com/wiki/Codes'>Codes</a></li><li><a href='https://mad-city.fandom.com/wiki/Gamepasses'>Gamepasses</a></li><li><a href='https://mad-city.fandom.com/wiki/Seasons'>Seasons</a></li><li><a href='https://mad-city.fandom.com/wiki/Skins'>Skins</a></li><li><a href='https://mad-city.fandom.com/wiki/Cash'>Cash</a></li></ul>"; }   if(content==8){ document.getElementById("navcontent").innerHTML="<ul><li><a href='https://mad-city.fandom.com/wiki/Update_Log'>Update Log</a></li></ul>"; } } document.getElementById('mw-content-text').innerHTML+=' <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(1);">NPCs <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(2);">Teams <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(3);">Places <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(4);">Weapons <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(5);">Vehicles <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(6);">Objects <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(7);">Gameplay <button style="background:orange;color:#3a3a3a;font-weight:bold; " onclick="setContentForNav(8);">Other  '; setInterval(function{       if(window.pageYOffset<15){        //window.scrollBy(-250, 0);        window.scrollBy(-15, -15);        window.scrollBy(15, 15);    } },30); //oais skin if (localStorage.getItem("mad-city_fandom_com_use_oasis") === undefined) { localStorage.setItem("mad-city_fandom_com_use_oasis", "false"); switchOasis2; } function switchOasis2 { if (localStorage.getItem("mad-city_fandom_com_use_oasis") == "true") { document.getElementById("oasisbutton").innerHTML = "Dark Skin On"; var elmt = document.getElementById("UserProfileMasthead"); if (elmt) { document.getElementById("UserProfileMasthead").getElementsByClassName("masthead-info")[0].style = "background:lightgray;color:black;" }       document.getElementsByClassName("WikiaPage")[0].getElementsByClassName("WikiaPageBackground")[0].style = "background-color:black;"; document.getElementsByClassName("WikiaSiteWrapper")[0].getElementsByClassName("wds-community-header")[0].style = "background-color:black;color:gray;"; document.getElementsByClassName("WikiaSiteWrapper")[0].style = "background:black;color:white;"; var ele = document.getElementById("mw-content-text").getElementsByClassName("article-table"); if (ele) { for (var i = 0; i < document.getElementById("mw-content-text").getElementsByClassName("article-table").length; i++) { document.getElementById("mw-content-text").getElementsByClassName("article-table")[i].style = "background:black;border:solid 2px white"; }       }        for (var i = 0; i < document.getElementById('mw-content-text').getElementsByClassName("portable-infobox pi-background pi-europa pi-theme-wikia pi-layout-default").length; i++) { document.getElementById('mw-content-text').getElementsByClassName("portable-infobox pi-background pi-europa pi-theme-wikia pi-layout-default")[i].style = "background:gray"; }       $("th").css("color", "black"); } else { document.getElementsByClassName("WikiaPage")[0].getElementsByClassName("WikiaPageBackground")[0].style = "background-color:none;"; for (var i = 0; i < document.getElementById('mw-content-text').getElementsByClassName("portable-infobox pi-background pi-europa pi-theme-wikia pi-layout-default").length; i++) { document.getElementById('mw-content-text').getElementsByClassName("portable-infobox pi-background pi-europa pi-theme-wikia pi-layout-default")[i].style = "background:#e9dadd;"; }       document.getElementsByClassName("WikiaSiteWrapper")[0].getElementsByClassName("wds-community-header")[0].style = "background-image:url(https://vignette.wikia.nocookie.net/mad-city/images/0/0e/Community-header-background/revision/latest/zoom-crop/width/471/height/115?cb=20190128181650);"; document.getElementsByClassName("WikiaSiteWrapper")[0].style = "background:none;color:none"; document.getElementById("oasisbutton").innerHTML = "Dark Skin Off"; var elmt = document.getElementById("UserProfileMasthead"); if (elmt) { document.getElementById("UserProfileMasthead").getElementsByClassName("masthead-info")[0].style = "background:none;color:none;"; }       $("th").css("color", ""); var ele = document.getElementById("mw-content-text").getElementsByClassName("article-table"); if (ele) { for (var i = 0; i < document.getElementById("mw-content-text").getElementsByClassName("article-table").length; i++) { document.getElementById("mw-content-text").getElementsByClassName("article-table")[i].style = "color:none;background:none;border:none"; }       }    } } function switchOasis{ document.getElementById("oasisbutton").innerHTML="Dark Skin Off"; if(localStorage.getItem("mad-city_fandom_com_use_oasis")=="true") { localStorage.setItem("mad-city_fandom_com_use_oasis","false"); } else { localStorage.setItem("mad-city_fandom_com_use_oasis","true"); }   switchOasis2; } function hidebuttons{ if(document.getElementById("oasisbutton").style.visibility=="visible"){ document.getElementById("oasisbutton").style.visibility="hidden"; document.getElementById("navbut").style.visibility="hidden"; document.getElementById("hidebutton").innerHTML="➡️"; }else{ document.getElementById("oasisbutton").style.visibility="visible"; document.getElementById("hidebutton").innerHTML="⬅️"; document.getElementById("navbut").style.visibility="visible"; } } document.getElementById('mw-content-text').innerHTML+='<button style="background:red;position: fixed;top: 380px;left:-38px;visibility:hidden;transform:rotate(90deg);z-index: 150;" onclick="switchOasis" id="oasisbutton">Dark Skin Off '; document.getElementById('mw-content-text').innerHTML+='<button style="background:red;position: fixed;top: 330px;left:-6px;z-index: 150;" onclick="hidebuttons;" id="hidebutton" >➡️ '; switchOasis2; } /*anti vandalism - this code cannot blank the article or lock down editing in any way function filterWord(word) { var children = document.getElementById('mw-content-text').children; for (var i = 0; i < children.length; i++) { var replaceele = children[i].innerHTML; var newelement = replaceele.replace(new RegExp(word, "gi"), "this page has been vandalized"); if (newelement != children[i].innerHTML) { document.getElementById('mw-content-text').innerHTML = "<p style='color:red;'>This page has been vandalized, please contact a admin to undo the vandalism. "; }   } } function getParameterByName(name) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regexS = "[\\?&]" + name + "=([^&#]*)"; var regex = new RegExp(regexS); var results = regex.exec(window.location.href); if (results == null) return ""; else return decodeURIComponent(results[1].replace(/\+/g, " ")); } //The code below is code to filter offensive language on articles! window.onload = function { var urlstr = window.location.toString; if (!urlstr.includes('User:') && !urlstr.includes('Message_Wall:') && !urlstr.includes('User_blog:') && !urlstr.includes('Special:') && !urlstr.includes('MediaWiki:')) { // Found user if (getParameterByName("action") ==  && getParameterByName("veaction") == ) { }   } } //kick txat members from the wiki