User:Vacuumen/chat.js

/*Script that makes it easy to run functions when receiving messages*/ importScriptPage('MediaWiki:Chat.js/newmessage.js','runescape'); importScriptPage('User:Joeytje50/chatmsg.js','runescape'); function pad(n) {//Function to pad the timestamps with zeroes where needed return (n<10?'0':'') + n; } onchatmessage = function (text, rawtext) { //Scripts to run when you get a new message console.log(rawtext); setTimeout(function {		if ($('.Chat li:last-child').is('.inline-alert') && $('.Chat li:last-child:not(:has(span.time))').length) {			var d = new Date;			var time = pad(d.getHours) + ':' + pad(d.getMinutes) + ':' + pad(d.getSeconds);			$('.Chat li:last-child').prepend(' '+time+' ')		}	},20); return text; //DO NOT EDIT THIS LINE }