Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Wall Edit v2.1 — HUD Theme Update with Enhanced Hex Code Visibility
- (function () {
- 'use strict';
- const style = document.createElement('style');
- style.innerHTML = `
- #solar-wiper-hud input[type=number]::-webkit-inner-spin-button,
- #solar-wiper-hud input[type=number]::-webkit-outer-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- #solar-wiper-hud input[type=number] { -moz-appearance: textfield; }
- #solar-wiper-hud input:focus { outline: 1px solid #555; }
- `;
- document.head.appendChild(style);
- function safeWriteChar(char, fgColor, x, y, bgColor) {
- try {
- if (typeof writeCharToXY === 'function') {
- writeCharToXY(char, fgColor, x, y, bgColor);
- } else if (typeof window.writeCharAt === 'function') {
- window.writeCharAt(char, fgColor, x, y, bgColor);
- }
- } catch (e) { console.error("Write Error:", e); }
- }
- class OWOTSolarWiper {
- constructor() {
- this.isWiping = false;
- this.stopRequested = false;
- this.createUI();
- window.OWOTSolarWiperInstance = this;
- }
- updateStatus(msg, color = '#aaa') {
- const status = document.getElementById('hud-status');
- if (status) {
- status.textContent = msg;
- status.style.color = color;
- }
- }
- createUI() {
- const existing = document.getElementById('solar-wiper-hud');
- if (existing) existing.remove();
- const ui = document.createElement('div');
- ui.id = 'solar-wiper-hud';
- ui.style.cssText = `
- position: fixed; top: 20px; right: 20px;
- background: #1a1a1a; color: #e0e0e0; padding: 12px;
- border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.9);
- z-index: 10010; font-family: sans-serif;
- width: 300px; border:1px solid #333; font-size:12px;
- `;
- ui.innerHTML = `
- <div id="hud-header" style="display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #333;cursor:move;">
- <div style="font-weight:600;color:#fff;">WallEdit <span style="color:#2ecc71;font-size:10px;">v2.1</span></div>
- <div style="display:flex;gap:6px;">
- <button id="hud-toggle" style="background:transparent;border:1px solid #444;color:#888;width:22px;height:22px;cursor:pointer;">−</button>
- <button id="hud-close" style="background:transparent;border:1px solid #444;color:#888;width:22px;height:22px;cursor:pointer;">×</button>
- </div>
- </div>
- <div id="hud-body">
- <label style="display:block;font-size:10px;color:#aaa;margin-bottom:4px;">Character</label>
- <input id="wipe-text" value="█" style="width:100%;padding:6px;border-radius:4px;border:1px solid #333;background:#0d0d0d;color:#fff;margin-bottom:8px;box-sizing:border-box;">
- <div style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;margin-bottom:8px;text-align:center;">
- <div>
- <label style="display:block;font-size:10px;color:#aaa;margin-bottom:2px;">Foreground</label>
- <input id="fg-color" type="color" value="#ffff00" style="width:100%;height:26px;background:none;border:none;padding:0;cursor:pointer;">
- <span id="fg-hex" style="font-size:11px;color:#fff;font-weight:600;font-family:monospace;display:block;margin-top:3px;">#FFFF00</span>
- </div>
- <div>
- <label style="display:block;font-size:10px;color:#aaa;margin-bottom:2px;">Background</label>
- <input id="bg-color" type="color" value="#000000" style="width:100%;height:26px;background:none;border:none;padding:0;cursor:pointer;">
- <span id="bg-hex" style="font-size:11px;color:#fff;font-weight:600;font-family:monospace;display:block;margin-top:3px;">#000000</span>
- </div>
- <div>
- <label style="display:block;font-size:10px;color:#aaa;margin-bottom:2px;">HUD Color</label>
- <input id="hud-color" type="color" value="#1a1a1a" style="width:100%;height:26px;background:none;border:none;padding:0;cursor:pointer;">
- <span id="hud-hex" style="font-size:11px;color:#fff;font-weight:600;font-family:monospace;display:block;margin-top:3px;">#1A1A1A</span>
- </div>
- </div>
- <div style="background:#0d0d0d;padding:8px;border-radius:6px;border:1px solid #282828;margin-bottom:8px;">
- <div style="display:grid;grid-template-columns:1fr 1fr;gap:6px;">
- <input id="start-x" type="number" value="0" placeholder="Start X" style="width:100%;background:#111;color:#fff;border:1px solid #333;text-align:center;padding:4px;">
- <input id="start-y" type="number" value="0" placeholder="Start Y" style="width:100%;background:#111;color:#fff;border:1px solid #333;text-align:center;padding:4px;">
- </div>
- <div style="display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px;">
- <input id="end-x" type="number" value="20" placeholder="End X" style="width:100%;background:#111;color:#fff;border:1px solid #333;text-align:center;padding:4px;">
- <input id="end-y" type="number" value="10" placeholder="End Y" style="width:100%;background:#111;color:#fff;border:1px solid #333;text-align:center;padding:4px;">
- </div>
- </div>
- <div style="display:flex;flex-direction:column;gap:6px;">
- <div style="display:flex;align-items:center;justify-content:space-between;padding:6px;background:#0d0d0d;border:1px solid #282828;">
- <label style="font-size:10px;color:#aaa;">Delay (ms):</label>
- <input id="speed-delay" type="number" value="10" style="width:50px;background:#111;color:#fff;border:1px solid #333;text-align:center;">
- </div>
- <label style="display:flex;align-items:center;padding:6px;background:#0d0d0d;border:1px solid #282828;cursor:pointer;"><input id="fast-mode" type="checkbox" style="margin-right:8px;">Fast Mode (Batch 200)</label>
- </div>
- <button id="start-wipe" style="width:100%;margin-top:10px;padding:10px;background:#fff;color:#000;font-weight:600;border:none;border-radius:4px;cursor:pointer;">Start Wipe</button>
- <button id="stop-wipe" style="width:100%;margin-top:10px;padding:10px;background:#c0392b;color:#fff;font-weight:600;border:none;border-radius:4px;display:none;cursor:pointer;">Stop Wipe</button>
- <div id="progress-wrap" style="display:none;margin-top:10px;">
- <div style="background:#0d0d0d;height:6px;overflow:hidden;border-radius:3px;"><div id="progress-bar" style="width:0%;height:100%;background:#2ecc71;"></div></div>
- <div id="progress-text" style="text-align:center;color:#aaa;font-size:9px;margin-top:4px;">0 / 0</div>
- </div>
- <div id="hud-status" style="margin-top:8px;text-align:center;color:#aaa;font-size:11px;">Ready</div>
- </div>
- `;
- document.body.appendChild(ui);
- this.makeHUDDraggable(ui);
- const setupColorSync = (pickerId, labelId, callback) => {
- const picker = document.getElementById(pickerId);
- const label = document.getElementById(labelId);
- const update = () => {
- const val = picker.value.toUpperCase();
- label.textContent = val;
- if (callback) callback(val);
- };
- picker.oninput = update;
- };
- setupColorSync('fg-color', 'fg-hex');
- setupColorSync('bg-color', 'bg-hex');
- setupColorSync('hud-color', 'hud-hex', (hex) => {
- ui.style.backgroundColor = hex;
- });
- document.getElementById('start-wipe').onclick = () => this.startWipe();
- document.getElementById('stop-wipe').onclick = () => this.stopRequested = true;
- document.getElementById('hud-toggle').onclick = () => {
- const b = document.getElementById('hud-body');
- b.style.display = b.style.display === 'none' ? 'block' : 'none';
- };
- document.getElementById('hud-close').onclick = () => ui.remove();
- }
- makeHUDDraggable(hud) {
- const header = hud.querySelector('#hud-header');
- let isDragging = false, offsetX, offsetY;
- header.onmousedown = (e) => { isDragging = true; offsetX = e.clientX - hud.offsetLeft; offsetY = e.clientY - hud.offsetTop; };
- document.addEventListener('mouseup', () => isDragging = false);
- document.addEventListener('mousemove', (e) => { if (isDragging) { hud.style.left = (e.clientX - offsetX) + 'px'; hud.style.top = (e.clientY - offsetY) + 'px'; hud.style.right = 'auto'; } });
- }
- async startWipe() {
- if (this.isWiping) return;
- this.isWiping = true; this.stopRequested = false;
- document.getElementById('start-wipe').style.display = 'none';
- document.getElementById('stop-wipe').style.display = 'block';
- document.getElementById('progress-wrap').style.display = 'block';
- const char = document.getElementById('wipe-text').value;
- const fg = parseInt(document.getElementById('fg-color').value.slice(1), 16);
- const bg = parseInt(document.getElementById('bg-color').value.slice(1), 16);
- const sX = parseInt(document.getElementById('start-x').value);
- const sY = -parseInt(document.getElementById('start-y').value);
- const eX = parseInt(document.getElementById('end-x').value);
- const eY = -parseInt(document.getElementById('end-y').value);
- const isFast = document.getElementById('fast-mode').checked;
- const delay = parseInt(document.getElementById('speed-delay').value) || 0;
- const minX = Math.min(sX, eX), maxX = Math.max(sX, eX);
- const minY = Math.min(sY, eY), maxY = Math.max(sY, eY);
- const path = [];
- const TILE_W = 20, TILE_H = 10;
- for (let y = minY; y <= maxY; y += TILE_H) {
- for (let x = minX; x <= maxX; x += TILE_W) {
- for (let cy = 0; cy < TILE_H; cy++) {
- for (let cx = 0; cx < TILE_W; cx++) {
- const curX = x + cx, curY = y + cy;
- if (curX <= maxX && curY <= maxY) path.push({ x: curX, y: curY });
- }
- }
- }
- }
- let completed = 0;
- const batchSize = isFast ? 200 : 1;
- for (let i = 0; i < path.length; i += batchSize) {
- if (this.stopRequested) break;
- for (let j = 0; j < batchSize && (i + j) < path.length; j++) {
- const p = path[i + j];
- safeWriteChar(char, fg, p.x, p.y, bg);
- completed++;
- }
- const pct = Math.round((completed / path.length) * 100);
- document.getElementById('progress-bar').style.width = pct + '%';
- document.getElementById('progress-text').textContent = `${completed} / ${path.length}`;
- this.updateStatus(`Wiping: ${pct}%`);
- if (delay > 0) await new Promise(r => setTimeout(r, delay));
- else if (completed % 1000 === 0) await new Promise(r => setTimeout(r, 0));
- }
- this.isWiping = false;
- document.getElementById('start-wipe').style.display = 'block';
- document.getElementById('stop-wipe').style.display = 'none';
- this.updateStatus(this.stopRequested ? 'Wipe Stopped' : 'Wipe Complete', this.stopRequested ? '#c0392b' : '#2ecc71');
- }
- }
- new OWOTSolarWiper();
- })();
Advertisement
Comments
-
- Fixed both end X/Y coords in both text fields to work properly.
-
- The first 2 text fields are the start/end X/Y for the upper left corner, and the text fields below that are the start/end X/Y for the lower right corner.
-
- dg PLEASE do not share powerful scripts
-
- Cool script! maybe make the ui be colored and draggable? and also, your a genius!
-
- can you make a textwall supported version?
-
- dg do not share powerful script!!!!!!
Add Comment
Please, Sign In to add comment