Bumped version; Added coords UI

This commit is contained in:
github-actions[bot] 2025-07-25 03:33:16 +00:00
parent 5c027f0552
commit 22d7ea1f96
4 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Blue Marble
// @namespace https://github.com/SwingTheVine/
// @version 0.30.3
// @version 0.31.0
// @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,5 +20,5 @@
// Wplace --> https://wplace.live
// License --> https://www.mozilla.org/en-US/MPL/2.0/
(()=>{var u=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 s=document.createElement("div");s.id="bm-contain-header";let n=document.createElement("div");n.id="bm-bar-drag",s.appendChild(n);let o=document.createElement("img");o.src="https://raw.githubusercontent.com/SwingTheVine/Wplace-BlueMarble/main/src/assets/Favicon.png",o.alt="Blue Marble Icon",s.appendChild(o);let a=document.createElement("h1");a.textContent=this.name,s.appendChild(a);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 b=document.createElement("p");b.id="bm-user-droplets",b.textContent="Droplets:",c.appendChild(b);let f=document.createElement("p");f.id="bm-user-nextlevel",f.textContent="Next level in...",c.appendChild(f);let i=document.createElement("div");i.id="bm-contain-automation",i.appendChild(this.createInputCheckbox("Stealth","bm-input-stealth",!0)),i.appendChild(this.createQuestionBox("bm-help-stealth","Help: Waits for the website to make requests, instead of sending requests.",e)),i.appendChild(document.createElement("br")),i.appendChild(this.createInputCheckbox("Possessed","bm-input-possessed",!0)),i.appendChild(this.createQuestionBox("bm-help-possessed","Help: Controls the website as if it were possessed.",e)),i.appendChild(document.createElement("br")),i.appendChild(this.createInputCheckbox("Panic","bm-input-panic")),i.appendChild(this.createQuestionBox("bm-help-panic","Help: Stops placing for a while if it detects a user nearby.",e)),i.appendChild(document.createElement("br"));let d=document.createElement("button");d.id="bm-button-coords",d.className="bm-help",d.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 6"><circle cx="2" cy="2" r="2"></circle><path d="M2 6 L3.7 3 L0.3 3 Z"></path><circle cx="2" cy="2" r="0.7" fill="white"></circle></svg></svg>',d.onclick=()=>{},i.appendChild(d),i.appendChild(this.createInputText("bm-input-tx","Tile X")),i.appendChild(this.createInputText("bm-input-ty","Tile Y")),i.appendChild(this.createInputText("bm-input-px","Pixel X")),i.appendChild(this.createInputText("bm-input-ty","Pixel Y")),i.appendChild(document.createElement("br"));let p=document.createElement("textarea");p.id=e,p.readOnly=!0,p.placeholder=`Status: Sleeping...
Version: ${this.version}`,i.appendChild(p),t.appendChild(s),t.appendChild(document.createElement("hr")),t.appendChild(c),t.appendChild(document.createElement("hr")),t.appendChild(i),document.body.appendChild(t),this.handleDrag(t,n)}updateInnerHTML(e,t,s=!1){let n=document.getElementById(e);if(n){if(n instanceof HTMLInputElement){n.value=t;return}s?n.textContent=t:n.innerHTML=t}}createQuestionBox(e,t,s){let n=document.createElement("button");return n.id=e,n.className="bm-help",n.textContent="?",n.title=t,n.onclick=()=>{this.updateInnerHTML(s,t)},n}createInputText(e,t,s=!1){let n=document.createElement("input");return n.id=e,n.type="text",n.value=t,n.readOnly=s,n}createInputCheckbox(e,t,s=!1){let n=document.createElement("label");n.textContent=e;let o=document.createElement("input");return o.type="checkbox",o.id=t,o.checked=s,n.prepend(o),n}handleDrag(e,t){let s=!1,n,o=0;t.addEventListener("mousedown",function(a){s=!0,n=a.clientX-e.getBoundingClientRect().left,o=a.clientY-e.getBoundingClientRect().top,document.body.style.userSelect="none",t.classList.add("dragging")}),t.addEventListener("touchstart",function(a){s=!0;let c=a?.touches?.[0];c&&(n=c.clientX-e.getBoundingClientRect().left,o=c.clientY-e.getBoundingClientRect().top,document.body.style.userSelect="none",t.classList.add("dragging"))},{passive:!1}),document.addEventListener("mousemove",function(a){s&&(e.style.left=a.clientX-n+"px",e.style.top=a.clientY-o+"px",e.style.right="")}),document.addEventListener("touchmove",function(a){if(s){let c=a?.touches?.[0];if(!c)return;e.style.left=c.clientX-n+"px",e.style.top=c.clientY-o+"px",a.preventDefault()}},{passive:!1}),document.addEventListener("mouseup",function(){s=!1,document.body.style.userSelect="",t.classList.remove("dragging")}),document.addEventListener("touchend",function(){s=!1,document.body.style.userSelect="",t.classList.remove("dragging")}),document.addEventListener("touchcancel",function(){s=!1,document.body.style.userSelect="",t.classList.remove("dragging")})}};var m=class{constructor(){this.disableAll=!1}spontaneousResponseListener(e){window.addEventListener("message",t=>{let s=t.data;if(s&&s.source==="blue-marble")switch(s.endpoint){case"me":let n=Math.ceil(Math.pow(Math.floor(s.jsonData?.level)*Math.pow(30,.65),1.5384615384615383)-s.jsonData?.pixelsPainted);e.updateInnerHTML("bm-user-name",`Username: <b>${s.jsonData?.name}</b>`),e.updateInnerHTML("bm-user-droplets",`Droplets: <b>${new Intl.NumberFormat().format(s.jsonData?.droplets)}</b>`),e.updateInnerHTML("bm-user-nextlevel",`Next level in <b>${new Intl.NumberFormat().format(n)}</b> pixel${n==1?"":"s"}`);break;case"robots":this.disableAll=s.jsonData?.userscript?.toString().toLowerCase()=="false"}})}};var g=GM_info.script.name.toString(),x=GM_info.script.version.toString();function E(l){let e=document.createElement("script");e.textContent=`(${l})();`,document.documentElement.appendChild(e),e.remove()}E(()=>{let l=window.fetch;window.fetch=async function(...e){let t=await l.apply(this,e),s=t.clone();if((s.headers.get("content-type")||"").includes("application/json")){let o=(e[0]instanceof Request?e[0]?.url:e[0])||"ignore";o=o.split("/").filter(Boolean).pop()||"ignore",console.log(`Sending JSON message about endpoint "${o}"`),s.json().then(a=>{window.postMessage({source:"blue-marble",endpoint:o,jsonData:a},"*")}).catch(a=>{console.error("BM - Failed to parse JSON:",a)})}return t}});var v=GM_getResourceText("CSS-BM-File");GM_addStyle(v);var r=document.createElement("link");r.href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap";r.rel="preload";r.as="style";r.onload="this.onload=null;this.rel='stylesheet'";document.head.appendChild(r);var C=new u(g,x);C.create();var y=new m;y.spontaneousResponseListener(C);console.log(`${g} (${x}) userscript has loaded!`);})();
(()=>{var m=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 i=document.createElement("h1");i.textContent=this.name,n.appendChild(i);let a=document.createElement("div");a.id="bm-contain-userinfo";let b=document.createElement("p");b.id="bm-user-name",b.textContent="Username:",a.appendChild(b);let f=document.createElement("p");f.id="bm-user-droplets",f.textContent="Droplets:",a.appendChild(f);let g=document.createElement("p");g.id="bm-user-nextlevel",g.textContent="Next level in...",a.appendChild(g);let c=document.createElement("div");c.id="bm-contain-automation",c.appendChild(this.createInputCheckbox("Stealth","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.createInputCheckbox("Possessed","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.createInputCheckbox("Panic","bm-input-panic")),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 l=document.createElement("div");l.id="bm-contain-coords";let r=document.createElement("button");r.id="bm-button-coords",r.className="bm-help",r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 6"><circle cx="2" cy="2" r="2"></circle><path d="M2 6 L3.7 3 L0.3 3 Z"></path><circle cx="2" cy="2" r="0.7" fill="white"></circle></svg></svg>',r.onclick=()=>{},l.appendChild(r),l.appendChild(this.createInputText("bm-input-tx","Tile X")),l.appendChild(this.createInputText("bm-input-ty","Tile Y")),l.appendChild(this.createInputText("bm-input-px","Pixel X")),l.appendChild(this.createInputText("bm-input-py","Pixel Y")),c.appendChild(l),c.appendChild(document.createElement("br"));let u=document.createElement("textarea");u.id=e,u.readOnly=!0,u.placeholder=`Status: Sleeping...
Version: ${this.version}`,c.appendChild(u),t.appendChild(n),t.appendChild(document.createElement("hr")),t.appendChild(a),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}createInputText(e,t="",n="",o=!1){let s=document.createElement("input");return s.id=e,s.type="text",s.placeholder=t,s.value=n,s.readOnly=o,s}createInputCheckbox(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(i){n=!0,o=i.clientX-e.getBoundingClientRect().left,s=i.clientY-e.getBoundingClientRect().top,document.body.style.userSelect="none",t.classList.add("dragging")}),t.addEventListener("touchstart",function(i){n=!0;let a=i?.touches?.[0];a&&(o=a.clientX-e.getBoundingClientRect().left,s=a.clientY-e.getBoundingClientRect().top,document.body.style.userSelect="none",t.classList.add("dragging"))},{passive:!1}),document.addEventListener("mousemove",function(i){n&&(e.style.left=i.clientX-o+"px",e.style.top=i.clientY-s+"px",e.style.right="")}),document.addEventListener("touchmove",function(i){if(n){let a=i?.touches?.[0];if(!a)return;e.style.left=a.clientX-o+"px",e.style.top=a.clientY-s+"px",i.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 h=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: <b>${n.jsonData?.name}</b>`),e.updateInnerHTML("bm-user-droplets",`Droplets: <b>${new Intl.NumberFormat().format(n.jsonData?.droplets)}</b>`),e.updateInnerHTML("bm-user-nextlevel",`Next level in <b>${new Intl.NumberFormat().format(o)}</b> 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(d){let e=document.createElement("script");e.textContent=`(${d})();`,document.documentElement.appendChild(e),e.remove()}v(()=>{let d=window.fetch;window.fetch=async function(...e){let t=await d.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(i=>{window.postMessage({source:"blue-marble",endpoint:s,jsonData:i},"*")}).catch(i=>{console.error("BM - Failed to parse JSON:",i)})}return t}});var y=GM_getResourceText("CSS-BM-File");GM_addStyle(y);var p=document.createElement("link");p.href="https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap";p.rel="preload";p.as="style";p.onload="this.onload=null;this.rel='stylesheet'";document.head.appendChild(p);var E=new m(C,x);E.create();var w=new h;w.spontaneousResponseListener(E);console.log(`${C} (${x}) userscript has loaded!`);})();

View file

@ -30,7 +30,7 @@
</table>
<h1>Blue Marble</h1>
<a href="" target="_blank"><img alt="Latest Version" src="https://img.shields.io/badge/Latest_Version-0.30.0-lightblue?style=flat"></a>
<a href="" target="_blank"><img alt="Latest Version" src="https://img.shields.io/badge/Latest_Version-0.31.0-lightblue?style=flat"></a>
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/releases" target="_blank"><img alt="Latest Release" src="https://img.shields.io/github/v/release/SwingTheVine/Wplace-BlueMarble?sort=date&style=flat&label=Latest%20Release&color=blue"></a>
<a href="https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/LICENSE.txt" target="_blank"><img alt="Software License: MPL-2.0" src="https://img.shields.io/badge/Software_License-MPL--2.0-brightgreen?style=flat"></a>
<a href="https://discord.gg/tpeBPy46hf" target="_blank"><img alt="Contact Me" src="https://img.shields.io/badge/Contact_Me-gray?style=flat&logo=Discord&logoColor=white&logoSize=auto&labelColor=cornflowerblue"></a>

View file

@ -1,6 +1,6 @@
{
"name": "wplace-bluemarble",
"version": "0.30.3",
"version": "0.31.0",
"type": "module",
"scripts": {
"build": "node build/build.js",

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Blue Marble
// @namespace https://github.com/SwingTheVine/
// @version 0.30.3
// @version 0.31.0
// @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