FANDOM


JS stuff

Useless JS script for embedding images and videos (version 1)

// Embed images and videos
function embedType(){
var type = prompt("Type what you would like to embed. Choose 'image' or 'video' (case sensitive)");

// Videos
if (type == 'video'){
var video = prompt("Enter YT video link");
document.getElementById('ytFrame').innerHTML = '<iframe width="350" height="350" src="https://www.youtube.com/embed/' + video.substring(32, 99) + '" frameborder="0" allowfullscreen></iframe>';
    }
// Images
     if (type == 'image') {
    var image = prompt("Type the image URL");
     document.getElementById('ytFrame').innerHTML = '<img src="' + image + '"/>';
    }
}
/* Clear */
function clearMe() {
document.getElementById('ytFrame').innerHTML = 'Cleared';
}

Useless JS script for embedding images and videos (version 2)

function imageVideo(){
var type = prompt('choose \'image\' or \'video\'');
if (type == 'video') {
var video = prompt("Enter YT video link");
if (video.substring(0, 32) == 'https://www.youtube.com/watch?v='){
document.getElementById('ytFrame').innerHTML = '<iframe width="350" height="350" src="https://www.youtube.com/embed/' + video.substring(32, 99) + '" frameborder="0" allowfullscreen></iframe>';
   }
else {
document.getElementById('ytFrame').innerHTML = '<p style="color:red; font-weight:bold;">Error: \'https://www.youtube.com/watch?v=\' was not found in the request. Please try again.';
         }
      }
   
// Images
if(type === 'image'){
var img = prompt("Type the image URL");
     document.getElementById('ytFrame').innerHTML = '<img src="' + img + '"/>';
   }
}


Rock Paper Scissors game

/**
 * Mario&LuigiBowser'sInsideStory's RPS game V1
 * Comes with 3 choices
 * */
 // quick log
 var qlog = function(quick){
     console.log(quick);
 };
 // Computer choice
 var computer = Math.random();
 
 if (computer <= 0.33) {
     computer = 'rock';
 }
 if (computer <= 0.67 & computer >= 0.34) {
     computer = 'paper';
 }
 if (computer <= 1){
     computer = 'scissors';
 }
// Player choice
var player = prompt("Choose 'rock', 'paper' or 'scissors'.");
// Game play
if(player === 'rock' & computer === 'scissors'){
    qlog('You win');
}
else if(player === 'rock' & computer === 'paper'){
    qlog('Computer wins');
}

if(player === 'paper' & computer === 'rock'){
    qlog('You win');
}
else if(player === 'paper' & computer === 'scissors') {
    qlog('Computer wins');
}

if(player === 'scissors' & computer === 'paper') {
    qlog('You win');
}
else if(player === 'scissors' & computer === 'rock') {
    qlog('Computer wins');
}
// same choice

if(player === computer) {
    qlog('Tie');
}


// Illegal choices

if(player != 'rock' & player != 'paper' & player != 'scissors') {
    qlog('Error: illegal choice "' + player + '".');
}


Watching the WikiActivity while looking at another page

$('iframe[src="/wiki/Special:WikiActivity"], a[href="javascript:hideFrame()"]').addClass('hidden');
 
$('a[href="javascript:showFrame()"]').removeClass('hidden');
}
 
function showFrame() {
$('iframe[src="/wiki/Special:WikiActivity"], a[href="javascript:hideFrame()"]').removeClass('hidden');
 
$('a[href="javascript:showFrame()"]').addClass('hidden');
}
/*
$('<a class="wikia-button" href="javascript:showFrame()">See Wiki Activity</a>').prependTo('.WikiaArticle');
 
$('<a class="wikia-button hidden" href="javascript:hideFrame()">Hide Wiki Activity</a>').prependTo('.WikiaArticle');
*/
 
 
 
 
 
$('<a class="wikia-button hidden" href="javascript:hideFrame()">Hide Wiki Activity</a> <a class="wikia-button" href="javascript:showFrame()">See Wiki Activity</a> <iframe class="hidden" src="/wiki/Special:WikiActivity" width="750" height="750"></iframe>').prependTo('.WikiaArticle');
 
 
 
 
$('<style> .hidden, .wikia-button.hidden, .page-Special_WikiActivity a[href="javascript:showFrame()"] { display: none; } </style>').prependTo('head');

Emotebomb ChatBot Command

    emotebomb: function(n, t, c){
        if(n !== 'Mario&LuigiBowser\'sInsideStory' & n !== 'Messenger Deception' & n !== 'TheKorraFanatic' & n !== 'Back Up2') {
            send('This is a restricted command. Only those with given access can use it.');
            return;
        }
        t = t.trim();
        if (!Number(t)) t = 56;
        t = Number(t) > 56? 56 : Number(t);
        var emotes = ['(hurricoaster)', '(angry)', '(ba)', '(batman)', '(blush)', '(books)', '(confused)', '(content)', '(cool)', '(crying)', '(yn)', '(frustrated)', '(ghost)', '(happy)', '(heart)', '(hmm)', '(indifferent)', ':D', '(mario)', '(moon)', '(ninja)', '(nintendo)', '(n)', '(owl)', '(pacman)', '(pirate)', ':(', '(stop)', ':|', '(heidy)', '(wink)', '(y)', '(mad)', '(palm)', '(nyan)', '(ROFL)', '(fire)', '(allears)', '(ping)', '(ban)', '(pong)', '(cookie)', '\\M/', '(bug)', '(puff)', '(witch)', '(dance)', '(ninja2)', '(pie)', '(sun)', '(rbua)', '(walrus)', '(yay)', '(giggle)', '(ohai)', '(shark)', '(upvote)'];
        var repeat = function(r) {
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
            for (var e = 0; e < 56; e += 1) {
                send(r[e]);
            }
        };
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
        repeat(emotes);
    }

Discord template

$(function (){
    var id = $('span.discord').attr('id');
    var theme = $('span.discord-theme').attr('id');
    var width = $('span.discord-width').attr('id');
    var height = $('span.discord-height').attr('id');
    if (id.length === 0) {
        return;
    }
    else {
    $('<iframe class="discord-frame" src="https://discordapp.com/widget?id=' + id + '&theme=' + theme + '" frameborder="0" width="' + width + '" height="' + height +'"></iframe>').prependTo('span.discord');
    }
});

"Daisy is missing" game

var where = prompt('Daisy is missing, do you know where she can be? Choose "under the bed", "washing machine" or "the car"').toLowerCase();
var comp = Math.floor(Math.random() * 3);
switch(where){
    case 'under the bed':
        if (comp === 0){
            console.log('Yay, you found her!');
        }
        else{
            console.log('No she wasn\'t there...');
        }
        break;
    case 'washing machine':
        if (comp === 1){
            console.log('Yay, you found her!');
        }
        else{
            console.log('No she wasn\'t there...');
        }
    break;
    case 'the car':
        if (comp === 2){
            console.log('Yay, you found her!');
        }
        else{
            console.log('No she wasn\'t there...');
        }
        break;
        default: console.log('Idk what "' + where + '" is. Sorry, can\'t help you');
}

Ajax ban command

/** Ajax ban command
* Allows to ban users in-chat while the user to be banned isn't present. It also works if user is in chat.
* By Mario&LuigiBowser'sInsideStory
*/
$('.Rail .public').before('<button class="ajax_ban">Ajax ban user</button>');
 
// ban command
$('.ajax_ban').click(function createAjaxBan(){
    if (!mainRoom.model.users.findByName(wgUserName).attributes.isModerator){
        alert('You do not have permission to ban a user.');
        return;
    }
    var banAttr = prompt('Type the user to ban, expiry time, and reason in this order separated by pipes (|). Use spaces between each pipe.', 'Username | Expiry Time | Reason').split(' | '),
        times =  {
        '30 minutes' : 1800,
        '1 hour' : 3600,
        '2 hours' : 7200,
        '3 hours' : 18000,
        '5 hours' : 18000,
        '12 hours' : 43200,
        '1 day' : 86400,
        '3 days' : 259200,
        '1 week' : 604800,
        '2 weeks' : 1209600,
        '1 month' : 2592000,
        '3 months' : 7776000,
        '6 months' : 15552000,
        '1 year' : 31536000,
        '2 years' : 63072000,
        '3 years' : 94608000,
        'infinite' : 31536000000
    };
    if (banAttr[0] === mw.config.get('wgUserName')){
        alert('You cannot ban yourself.');
        return;
    }
    if (banAttr === null){
        return;
    }
    if (!times.hasOwnProperty(banAttr[1])){
        alert('You have entered an invalid expiry time. Please try again.');
        return;
    }
    mainRoom.socket.send(new models.BanCommand({  
        userToBan: banAttr[0], 
        time: times[banAttr[1]], 
        reason: banAttr[2]}).xport()
    );
});

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.