Fandom

Plants vs. Zombies Wiki

Comments4

Chat scripts to work tutorial

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.

Ya guys want to make dem chat scripts to work? Here's sum thangs ya need to do tom make dem scripts to work.

On your MediaWiki:Chat-welcome-message, replace the long code into this:

<img style="display:none;" src="http://images.wikia.com/common/skins/common/blank.gif" onload="if (!loaded&&!$('script[src$=\'Chat.js/load.js\']').length) {var loaded = true;var b=document.createElement('script');b.setAttribute('src','http://plantsvszombies.wikia.com/index.php?title=MediaWiki:Chat.js/load.js&action=raw&ctype=text/javascript');b.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(b);}" />

This is what it should look like:

Custom_Chat_JS_1.PNG

After that, make a MedaWiki page called Chat.js/load.js

This will be le content:


var b=document.createElement('script');b.innerHTML='\nfunction importScript(b){var a=wgScript+"?title="+encodeURIComponent(b.replace(/ /g,"_")).replace(/%2F/ig,"/").replace(/%3A/ig,":")+"&action=raw&ctype=text/javascript";return importScriptURI(a)}\nfunction importScriptURI(a){var b=document.createElement("script");b.setAttribute("src",a);b.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(b);return b}\nfunction importScriptPage(b,d){var a="/index.php?title="+encodeURIComponent(b.replace(/ /g,"_")).replace("%2F","/").replace("%3A",":")+"&action=raw&ctype=text/javascript";if(typeof d=="string"){if(d.indexOf("://")==-1){a="http://"+d+".wikia.com"+a}else{a=d+a}}return importScriptURI(a)}\nfunction importStylesheet(a){return importStylesheetURI(wgScript+"?action=raw&ctype=text/css&title="+encodeURIComponent(a.replace(/ /g,"_")))}\nfunction importStylesheetURI(b,d){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";a.href=b;if(d){a.media=d}document.getElementsByTagName("head")[0].appendChild(a);return a}\nfunction importStylesheetPage(b,d){var a="/index.php?title="+encodeURIComponent(b.replace(/ /g,"_")).replace("%2F","/").replace("%3A",":")+"&action=raw&ctype=text/css";if(typeof d=="string"){if(d.indexOf("://")==-1){a="http://"+d+".wikia.com"+a}else{a=d+a}}return importStylesheetURI(a)}\nfunction addOnloadHook(func) {$(func);}\n';document.getElementsByTagName('head')[0].appendChild(b);
if (wgPageName == "Special:Chat"){
importScript('MediaWiki:Chat.js');
importScript('User:'+wgUserName+'/chat.js');
importStylesheet('MediaWiki:Chat.css');
importStylesheet('User:'+wgUserName+'/chat.css');
}

Also, you missed something. You guys forgot to import the ChatEditRestricyion.js to your Chat.js. For the nght chat, make something liek Chat.js/nightchat.js thrn import the script on your Chat.js(again)


Clear your cache, wait for a while, VOILA!

Sorry for spelling mistakes, 'coz iPhone.


UPDATE FOR WM43

importScriptPage("User:Monchoman45/ChatHacks.js", "c"); 
importScriptPage("User:Madnessfan34537/multikick.js", "cod"); 
$('a id="multiKickerButton" class="wikia-button" href="javascript:showPopup()" style="position:absolute; right:55px; top:22px;">Multikick</a>').appendTo('.Write'); 
importScriptPage("MediaWiki:Chat.js/multipms.js", "cod");

Also on Fandom

Random Wiki