forked from dd7531/autopxls
-
Notifications
You must be signed in to change notification settings - Fork 2
/
userscript.js
44 lines (41 loc) · 1.64 KB
/
userscript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ==UserScript==
// @name pxls.space autotool
// @namespace https://github.com/Moondarker/autopxls
// @date 2017-04-17
// @version 2.5
// @description May be used together w/ templates script by Abupidr
// @author Moondarker
// @match http://*/*
// @updateURL https://rawgit.com/Moondarker/autopxls/master/userscript.js
// @downloadURL https://rawgit.com/Moondarker/autopxls/master/userscript.js
// @grant none
// @run-at document-end
// ==/UserScript==
(function () {
const opts = (location.search || "?").substr(1).split("&").map(x => x.split("=").map(a => unescape(a))).reduce((o, [k, v]) => Object.assign(o, {[k]: v}), {});
if (typeof opts.template != "undefined") {
window.App.saveImage = document.createElement('script');
window.App.saveImage.src = "https://rawgit.com/Moondarker/autopxls/master/autopxls.js";
window.App.saveImage.onload = function () {
var images = [
{
title: "X" + opts.ox + "Y" + opts.oy,
x: opts.ox,
y: opts.oy,
image: opts.template,
algo: "random",
mode: "h",
convert: opts.convert || 1,
show: 1
}
];
var params = {
cooldown: 100, //You may edit this manually right here
debug: 0
};
window.App.saveImage(images, params.cooldown, params.debug);
this.parentElement.removeChild(this);
};
document.head.appendChild(window.App.saveImage);
}
})();