User:WalkerAndEric/global.js

importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); importScriptPage('MediaWiki:B3.js/Chatbot.js', 'monchbox').onload = function { Torus.addListener('join', function(data) {                   if(!Torus.chats[data.roomId].parent) {Torus.io.sendMessage(data.roomId, 'Hi, we have new chat rules. Please read Bleach Wiki:Chat Policy. You must have ten edits to be here.');}           }); setTimeout(function {                   if(!Chatbot.log[533].length) {return;}                    var api = new APIQuery;                    api.newQuery('POST', {action: 'edit', title: 'Project:Chat/' + Torus.commands.eval('chatbot today'), text: ' ' + Chatbot.log[533].join('\n') + ' '}, function {console.log('Log saved');});                    api.send(0);            }, 60 * 60 * 1000); }   if(wgCanonicalSpecialPageName == 'Chat') { mainRoom.model.chats.bind('afteradd', $.proxy(function(chat) { if(chat.attributes.isInlineAlert && chat.attributes.text.indexOf(' has joined the chat.') != -1 && chat.attributes.text.indexOf(wgUserName) != 0) { var chatEntry = new models.ChatEntry({roomId: this.roomId, name: wgUserName, text: 'Hi, we have new chat rules. Please read Bleach Wiki:Chat Policy. You must have ten edits to be here.'}); this.socket.send(chatEntry.xport); }           }, mainRoom)); }