diff --git a/dist/BlueMarble.user.js b/dist/BlueMarble.user.js
index 0d4a7f7..8c514d5 100644
--- a/dist/BlueMarble.user.js
+++ b/dist/BlueMarble.user.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Blue Marble
// @namespace https://github.com/SwingTheVine/
-// @version 0.27.0
+// @version 0.27.2
// @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA.
// @author SwingTheVine
// @license MPL-2.0
@@ -20,4 +20,4 @@
// Wplace --> https://wplace.live
// License --> https://www.mozilla.org/en-US/MPL/2.0/
-(()=>{var p=class{constructor(t,e){this.name=t,this.version=e}create(){let t="bm-output-status",e=document.createElement("div");e.id="bm-overlay",e.style.top="10px",e.style.right="75px";let n=document.createElement("div");n.id="bm-contain-header";let o=document.createElement("div");o.id="bm-bar-drag",n.appendChild(o);let a=document.createElement("img");a.src="https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/src/assets/Favicon.png",a.alt="Blue Marble Icon",n.appendChild(a);let s=document.createElement("h1");s.textContent=this.name,n.appendChild(s);let c=document.createElement("div");c.id="bm-contain-userinfo";let h=document.createElement("p");h.id="bm-user-name",h.textContent="Username:",c.appendChild(h);let f=document.createElement("p");f.id="bm-user-droplets",f.textContent="Droplets:",c.appendChild(f);let g=document.createElement("p");g.id="bm-user-nextlevel",g.textContent="Next level in...",c.appendChild(g);let i=document.createElement("div");i.id="bm-contain-automation";let b=document.createElement("label");b.textContent="Stealth Mode";let r=document.createElement("input");r.type="checkbox",r.id="bm-input-stealth",r.checked=!0,b.prepend(r),i.appendChild(b),i.appendChild(this.createQuestionBox("bm-help-stealth","Help: Waits for the website to make requests, instead of sending requests.",t)),i.appendChild(document.createElement("br"));let u=document.createElement("textarea");u.id=t,u.readOnly=!0,u.placeholder="Status: Sleeping...",i.appendChild(u),e.appendChild(n),e.appendChild(document.createElement("hr")),e.appendChild(c),e.appendChild(document.createElement("hr")),e.appendChild(i),document.body.appendChild(e),this.handleDrag(e,o)}updateInnerHTML(t,e,n=!1){let o=document.getElementById(t);if(o){if(o instanceof HTMLInputElement){o.value=e;return}n?o.textContent=e:o.innerHTML=e}}createQuestionBox(t,e,n){let o=document.createElement("button");return o.id=t,o.className="bm-help",o.textContent="?",o.title=e,o.onclick=()=>{this.updateInnerHTML(n,e)},o}handleDrag(t,e){let n=!1,o,a=0;e.addEventListener("mousedown",function(s){n=!0,o=s.clientX-t.getBoundingClientRect().left,a=s.clientY-t.getBoundingClientRect().top,document.body.style.userSelect="none",e.classList.add("dragging")}),e.addEventListener("touchstart",function(s){n=!0;let c=s?.touches?.[0];c&&(o=c.clientX-t.getBoundingClientRect().left,a=c.clientY-t.getBoundingClientRect().top,document.body.style.userSelect="none",e.classList.add("dragging"))},{passive:!1}),document.addEventListener("mousemove",function(s){n&&(t.style.left=s.clientX-o+"px",t.style.top=s.clientY-a+"px",t.style.right="")}),document.addEventListener("touchmove",function(s){if(n){let c=s?.touches?.[0];if(!c)return;t.style.left=c.clientX-o+"px",t.style.top=c.clientY-a+"px",s.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",function(){n=!1,document.body.style.userSelect="",e.classList.remove("dragging")}),document.addEventListener("touchend",function(){n=!1,document.body.style.userSelect="",e.classList.remove("dragging")}),document.addEventListener("touchcancel",function(){n=!1,document.body.style.userSelect="",e.classList.remove("dragging")})}};var m=class{constructor(){this.disableAll=!1}spontaneousResponseListener(t){window.addEventListener("message",e=>{let n=e.data;if(n&&n.source==="blue-marble")switch(n.endpoint){case"me":let o=Math.ceil(Math.pow(Math.floor(n.jsonData?.level)*Math.pow(30,.65),1.5384615384615383)-n.jsonData?.pixelsPainted);t.updateInnerHTML("bm-user-name",`Username: ${n.jsonData?.name}`),t.updateInnerHTML("bm-user-droplets",`Droplets: ${new Intl.NumberFormat().format(n.jsonData?.droplets)}`),t.updateInnerHTML("bm-user-nextlevel",`Next level in ${new Intl.NumberFormat().format(o)} pixel${o==1?"":"s"}`);break;case"robots":this.disableAll=n.jsonData?.userscript?.toString().toLowerCase()=="false"}})}};var C=GM_info.script.name.toString(),x=GM_info.script.version.toString();function v(l){let t=document.createElement("script");t.textContent=`(${l})();`,document.documentElement.appendChild(t),t.remove()}v(()=>{let l=window.fetch;window.fetch=async function(...t){let e=await l.apply(this,t),n=e.clone();if((n.headers.get("content-type")||"").includes("application/json")){let a=(t[0]instanceof Request?t[0]?.url:t[0])||"ignore";a=a.split("/").filter(Boolean).pop()||"ignore",console.log(`Sending JSON message about endpoint "${a}"`),n.json().then(s=>{window.postMessage({source:"blue-marble",endpoint:a,jsonData:s},"*")}).catch(s=>{console.error("BM - Failed to parse JSON:",s)})}return e}});var y=GM_getResourceText("CSS-Overlay");GM_addStyle(y);var d=document.createElement("link");d.href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap";d.rel="preload";d.as="style";d.onload="this.onload=null;this.rel='stylesheet'";document.head.appendChild(d);var E=new p(C,x);E.create();var L=new m;L.spontaneousResponseListener(E);console.log(`${C} (${x}) userscript has loaded!`);})();
+(()=>{var p=class{constructor(e,t){this.name=e,this.version=t}create(){let e="bm-output-status",t=document.createElement("div");t.id="bm-overlay",t.style.top="10px",t.style.right="75px";let n=document.createElement("div");n.id="bm-contain-header";let o=document.createElement("div");o.id="bm-bar-drag",n.appendChild(o);let s=document.createElement("img");s.src="https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/src/assets/Favicon.png",s.alt="Blue Marble Icon",n.appendChild(s);let a=document.createElement("h1");a.textContent=this.name,n.appendChild(a);let i=document.createElement("div");i.id="bm-contain-userinfo";let m=document.createElement("p");m.id="bm-user-name",m.textContent="Username:",i.appendChild(m);let h=document.createElement("p");h.id="bm-user-droplets",h.textContent="Droplets:",i.appendChild(h);let f=document.createElement("p");f.id="bm-user-nextlevel",f.textContent="Next level in...",i.appendChild(f);let c=document.createElement("div");c.id="bm-contain-automation",c.appendChild(this.createLineCheckbox("Stealth Mode","bm-input-stealth",!0)),c.appendChild(this.createQuestionBox("bm-help-stealth","Help: Waits for the website to make requests, instead of sending requests.",e)),c.appendChild(document.createElement("br")),c.appendChild(this.createLineCheckbox("Possessed Mode","bm-input-possessed",!0)),c.appendChild(this.createQuestionBox("bm-help-possessed","Help: Controls the website as if it were possessed.",e)),c.appendChild(document.createElement("br")),c.appendChild(this.createLineCheckbox("Panic","bm-input-panic",!0)),c.appendChild(this.createQuestionBox("bm-help-panic","Help: Stops placing for a while if it detects a user nearby.",e)),c.appendChild(document.createElement("br"));let r=document.createElement("textarea");r.id=e,r.readOnly=!0,r.placeholder="Status: Sleeping...",c.appendChild(r),t.appendChild(n),t.appendChild(document.createElement("hr")),t.appendChild(i),t.appendChild(document.createElement("hr")),t.appendChild(c),document.body.appendChild(t),this.handleDrag(t,o)}updateInnerHTML(e,t,n=!1){let o=document.getElementById(e);if(o){if(o instanceof HTMLInputElement){o.value=t;return}n?o.textContent=t:o.innerHTML=t}}createQuestionBox(e,t,n){let o=document.createElement("button");return o.id=e,o.className="bm-help",o.textContent="?",o.title=t,o.onclick=()=>{this.updateInnerHTML(n,t)},o}createLineCheckbox(e,t,n=!1){let o=document.createElement("label");o.textContent=e;let s=document.createElement("input");return s.type="checkbox",s.id=t,s.checked=n,o.prepend(s),o}handleDrag(e,t){let n=!1,o,s=0;t.addEventListener("mousedown",function(a){n=!0,o=a.clientX-e.getBoundingClientRect().left,s=a.clientY-e.getBoundingClientRect().top,document.body.style.userSelect="none",t.classList.add("dragging")}),t.addEventListener("touchstart",function(a){n=!0;let i=a?.touches?.[0];i&&(o=i.clientX-e.getBoundingClientRect().left,s=i.clientY-e.getBoundingClientRect().top,document.body.style.userSelect="none",t.classList.add("dragging"))},{passive:!1}),document.addEventListener("mousemove",function(a){n&&(e.style.left=a.clientX-o+"px",e.style.top=a.clientY-s+"px",e.style.right="")}),document.addEventListener("touchmove",function(a){if(n){let i=a?.touches?.[0];if(!i)return;e.style.left=i.clientX-o+"px",e.style.top=i.clientY-s+"px",a.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",function(){n=!1,document.body.style.userSelect="",t.classList.remove("dragging")}),document.addEventListener("touchend",function(){n=!1,document.body.style.userSelect="",t.classList.remove("dragging")}),document.addEventListener("touchcancel",function(){n=!1,document.body.style.userSelect="",t.classList.remove("dragging")})}};var u=class{constructor(){this.disableAll=!1}spontaneousResponseListener(e){window.addEventListener("message",t=>{let n=t.data;if(n&&n.source==="blue-marble")switch(n.endpoint){case"me":let o=Math.ceil(Math.pow(Math.floor(n.jsonData?.level)*Math.pow(30,.65),1.5384615384615383)-n.jsonData?.pixelsPainted);e.updateInnerHTML("bm-user-name",`Username: ${n.jsonData?.name}`),e.updateInnerHTML("bm-user-droplets",`Droplets: ${new Intl.NumberFormat().format(n.jsonData?.droplets)}`),e.updateInnerHTML("bm-user-nextlevel",`Next level in ${new Intl.NumberFormat().format(o)} pixel${o==1?"":"s"}`);break;case"robots":this.disableAll=n.jsonData?.userscript?.toString().toLowerCase()=="false"}})}};var b=GM_info.script.name.toString(),g=GM_info.script.version.toString();function x(l){let e=document.createElement("script");e.textContent=`(${l})();`,document.documentElement.appendChild(e),e.remove()}x(()=>{let l=window.fetch;window.fetch=async function(...e){let t=await l.apply(this,e),n=t.clone();if((n.headers.get("content-type")||"").includes("application/json")){let s=(e[0]instanceof Request?e[0]?.url:e[0])||"ignore";s=s.split("/").filter(Boolean).pop()||"ignore",console.log(`Sending JSON message about endpoint "${s}"`),n.json().then(a=>{window.postMessage({source:"blue-marble",endpoint:s,jsonData:a},"*")}).catch(a=>{console.error("BM - Failed to parse JSON:",a)})}return t}});var E=GM_getResourceText("CSS-Overlay");GM_addStyle(E);var d=document.createElement("link");d.href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap";d.rel="preload";d.as="style";d.onload="this.onload=null;this.rel='stylesheet'";document.head.appendChild(d);var C=new p(b,g);C.create();var L=new u;L.spontaneousResponseListener(C);console.log(`${b} (${g}) userscript has loaded!`);})();
diff --git a/docs/README.md b/docs/README.md
index b41fcfa..66eb74c 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -23,7 +23,7 @@
-
+
diff --git a/package-lock.json b/package-lock.json
index ebbb765..4ca3bc1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,7 +7,7 @@
"devDependencies": {
"esbuild": "^0.25.0"
},
- "version": "0.26.3"
+ "version": "0.27.2"
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.25.8",
@@ -467,5 +467,5 @@
}
}
},
- "version": "0.26.3"
+ "version": "0.27.2"
}
diff --git a/package.json b/package.json
index ca72313..4d63d57 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "wplace-bluemarble",
- "version": "0.27.0",
+ "version": "0.27.2",
"type": "module",
"scripts": {
"build": "node build/build.js",
diff --git a/src/BlueMarble.meta.js b/src/BlueMarble.meta.js
index d604cd1..998fbb0 100644
--- a/src/BlueMarble.meta.js
+++ b/src/BlueMarble.meta.js
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Blue Marble
// @namespace https://github.com/SwingTheVine/
-// @version 0.27.0
+// @version 0.27.2
// @description A userscript to automate and/or enhance the user experience on Wplace.live. Make sure to comply with the site's Terms of Service, and rules! This script is not affiliated with Wplace.live in any way, use at your own risk. This script is not affiliated with TamperMonkey. The author of this userscript is not responsible for any damages, issues, loss of data, or punishment that may occur as a result of using this script. This script is provided "as is" under the MPL-2.0 license. The "Blue Marble" icon is licensed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. The image is owned by NASA.
// @author SwingTheVine
// @license MPL-2.0
diff --git a/src/overlay.css b/src/overlay.css
index b051d13..e9b6424 100644
--- a/src/overlay.css
+++ b/src/overlay.css
@@ -56,6 +56,10 @@ div#bm-overlay {
margin-top: 0.5em;
}
+#bm-contain-automation {
+ margin-top: 0.5em;
+}
+
#bm-contain-automation input[type="checkbox"] {
vertical-align: middle;
margin-right: 0.5ch;
@@ -79,6 +83,6 @@ div#bm-overlay {
font-size: small;
background-color: rgba(0, 0, 0, 0.2);
padding: 0 0.5ch;
- height: 3em;
+ height: 3.75em;
width: 100%;
}
\ No newline at end of file
diff --git a/src/overlay.js b/src/overlay.js
index bc35f81..a3706ec 100644
--- a/src/overlay.js
+++ b/src/overlay.js
@@ -64,15 +64,12 @@ export class Overlay {
const containerAutomation = document.createElement('div'); // Automated stuff container
containerAutomation.id = 'bm-contain-automation';
- const labelStealthMode = document.createElement('label'); // Stealth Mode checkbox (container) label
- labelStealthMode.textContent = 'Stealth Mode';
-
- const inputStealthMode = document.createElement('input'); // Stealth Mode checkbox
- inputStealthMode.type = 'checkbox';
- inputStealthMode.id = 'bm-input-stealth';
- inputStealthMode.checked = true; // Checkbox checked by default
- labelStealthMode.prepend(inputStealthMode); // Adds the input to the label
- containerAutomation.appendChild(labelStealthMode); // Adds the label & checkbox to the automation container
+ // Stealth Mode checkbox
+ containerAutomation.appendChild(this.createLineCheckbox(
+ 'Stealth Mode',
+ 'bm-input-stealth',
+ true
+ ));
// Adds the help icon for stealth mode
containerAutomation.appendChild(this.createQuestionBox(
@@ -83,6 +80,37 @@ export class Overlay {
containerAutomation.appendChild(document.createElement('br')); // Line break
+ // Possessed Mode
+ containerAutomation.appendChild(this.createLineCheckbox(
+ 'Possessed Mode',
+ 'bm-input-possessed',
+ true
+ ));
+
+ // Adds the help icon for possessed mode
+ containerAutomation.appendChild(this.createQuestionBox(
+ 'bm-help-possessed',
+ 'Help: Controls the website as if it were possessed.',
+ outputStatusId
+ ));
+
+ containerAutomation.appendChild(document.createElement('br')); // Line break
+
+ // Panic option
+ containerAutomation.appendChild(this.createLineCheckbox(
+ 'Panic',
+ 'bm-input-panic'
+ ));
+
+ // Adds the help icon for panic
+ containerAutomation.appendChild(this.createQuestionBox(
+ 'bm-help-panic',
+ 'Help: Stops placing for a while if it detects a user nearby.',
+ outputStatusId
+ ));
+
+ containerAutomation.appendChild(document.createElement('br')); // Line break
+
const outputStatus = document.createElement('textarea'); // Outputs bot status
outputStatus.id = outputStatusId;
outputStatus.readOnly = true; // Read-only input field
@@ -147,6 +175,24 @@ export class Overlay {
return questionBox;
}
+ /** Creates the checkbox line/label
+ * @param {string} labelText - The text for the label
+ * @param {string} checkboxId - The ID for the checkbox input
+ * @param {boolean} [checkboxDefault] - (Optional) The default status of the checkbox (true = checked). False by default.
+ * @returns {HTMLLabelElement} HTML Label Element with Input child
+ * @since 0.27.1
+ */
+ createLineCheckbox(labelText, checkboxId, checkboxDefault=false) {
+ const label = document.createElement('label');
+ label.textContent = labelText;
+ const input = document.createElement('input');
+ input.type = 'checkbox';
+ input.id = checkboxId;
+ input.checked = checkboxDefault;
+ label.prepend(input); // Adds the input as the first child of the label (before the text)
+ return label;
+ }
+
/** Handles dragging of the overlay.
* @param {HTMLElement} overlay - The overlay element to be moved.
* @param {HTMLElement} barDrag - The element that acts as the drag handle.