您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Update Map
当前为
- // ==UserScript==
- // @name Map Updator
- // @namespace http://api.micetigri.fr/
- // @version 0.7
- // @description Update Map
- // @author Billysmille
- // @match http://api.micetigri.fr/maps/
- // @grant none
- // ==/UserScript==
- function updateAll(list) {
- var lsmap = [];
- var i = 0;
- var pattern = new RegExp('@\\d+', 'g');
- var match;
- while ((match = pattern.exec(list))) {
- lsmap.push(match[0]);
- }
- window.setInterval(function () {
- if (i < lsmap.length) {
- var xmlhttp = new XMLHttpRequest();
- xmlhttp.onreadystatechange = function () {
- if (this.readyState == 4 && this.status == 200) {
- var parser = new DOMParser();
- var xmlDoc = parser.parseFromString(this.responseText, 'text/html');
- io.connect('http://node.micetigri.fr:443/').emit('map', {
- map: xmlDoc.getElementById('mapUpdator').getAttribute('map'),
- id: xmlDoc.getElementById('mapUpdator').getAttribute('session')
- });
- }
- };
- xmlhttp.open('GET', 'http://api.micetigri.fr/maps/' + lsmap[i], true);
- xmlhttp.send();
- }
- else {
- location.reload();
- }
- i++;
- }, 6000);
- }
- (function () {
- $('#MapViewer').parents('.panel-body').html('<textarea class="form-control" id="map-list" rows="5"></textarea>');
- $('#mapUpdator').parents('.panel-body').html('<button type="submit" class="btn btn-default" id="update-btn" data-loading-text="Update All...">Update All</button>');
- $('#update-btn').click(function (event) {
- event.preventDefault();
- $(this).button('loading');
- updateAll($('#map-list').val());
- });
- })();