Skip to content

Commit 624d0e5

Browse files
Update script.js
1 parent 7820da4 commit 624d0e5

File tree

1 file changed

+91
-141
lines changed

1 file changed

+91
-141
lines changed

script.js

Lines changed: 91 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,178 +1,128 @@
11
/**
2-
* POBFUS ENGINE - v1.13.100
3-
* Logic: Topbar Integrated Controls & Dynamic Roof
2+
* POBFUS ELITE - v1.13.100
3+
* Logic: Fixed Countdown, Decoupled Actions, Human-Centric UI
44
*/
55

6-
let _0xMealTimer;
7-
let _0xMealActive = false;
8-
let _0xMealInterval;
9-
let _state = { mday: false, bmas: false };
6+
let _currentTab = 'sys';
7+
let _mealInterval;
108

119
const _011 = {
1210
_init: function() {
13-
// Initialization: Start ticker and idle detection
11+
// Fix: Force immediate update so user doesn't see "INIT"
1412
this._updateTicker();
1513
setInterval(() => this._updateTicker(), 1000);
16-
this._resetIdle();
1714

18-
this.print("SYSTEM: Core Logic v1.13.100 Initialized.", "#8b949e");
19-
this.print("SYSTEM: Current Region - PH House (Zamboanga).", "#39ff14");
20-
this.print("SYSTEM: Millennial Day Protocol is active.", "var(--p-gold)");
15+
this.print("SYSTEM: Millennial Build 1.13.100 Online.", "var(--p-green)");
16+
this.print("SYSTEM: Guest Room Integrated. v0.7 Memorial Active.", "var(--p-gold)");
17+
18+
// Start household chat cycle
19+
this._startHouseholdLogic();
2120
},
2221

23-
/**
24-
* Toggles seasonal overrides from the Topbar
25-
* @param {string} type - 'mday' or 'bmas'
26-
*/
27-
toggle: function(type) {
28-
_state[type] = !_state[type];
22+
// Fixed Countdown Logic
23+
_updateTicker: function() {
24+
const ticker = document.getElementById('status-ticker');
25+
const now = new Date();
26+
const bmasDate = new Date(now.getFullYear(), 11, 23); // Dec 23
2927

30-
// Visual toggle for buttons
31-
const btn = document.getElementById(`btn-${type}`);
32-
btn.classList.toggle(type === 'bmas' ? 'active-bmas' : 'active-mday');
28+
// If we passed Dec 23 this year, set for next year
29+
if (now > bmasDate) bmasDate.setFullYear(now.getFullYear() + 1);
3330

34-
// Enforce mutual exclusivity (only one override at a time)
35-
const other = type === 'bmas' ? 'mday' : 'bmas';
36-
if (_state[type] && _state[other]) {
37-
_state[other] = false;
38-
document.getElementById(`btn-${other}`).classList.remove('active-bmas', 'active-mday');
31+
const diff = bmasDate - now;
32+
const d = Math.floor(diff / (1000 * 60 * 60 * 24));
33+
const h = Math.floor((diff / (1000 * 60 * 60)) % 24);
34+
const m = Math.floor((diff / (1000 * 60)) % 60);
35+
const s = Math.floor((diff / 1000) % 60);
36+
37+
ticker.innerText = `BYTESMAS COUNTDOWN: ${d}d ${h}h ${m}m ${s}s`;
38+
},
39+
40+
_generateFileName: function() {
41+
const chars = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
42+
const syms = "_$[]";
43+
let rand = "";
44+
for(let i=0; i<6; i++) rand += chars.charAt(Math.floor(Math.random()*chars.length));
45+
return `PB_${rand}${syms.charAt(Math.floor(Math.random()*syms.length))}_build.lua`;
46+
},
47+
48+
_transform: function() {
49+
const _in = document.getElementById('input');
50+
if (!_in.value.trim()) {
51+
this.print("ERROR: Source buffer is empty. Transformation aborted.", "var(--p-red)");
52+
return;
3953
}
4054

41-
this.print(`[SYSTEM]: ${type.toUpperCase()} override flipped to ${_state[type] ? 'ON' : 'OFF'}.`, "#fff");
42-
this._updateTicker();
55+
const buildID = Math.random().toString(16).slice(2, 8).toUpperCase();
56+
const output = `-- POBFUS ELITE v1.13.100\n-- BUILD_SIG: ${buildID}\n-- HERITAGE: 0.1 -> 0.7 -> Elite\nlocal _ = "${btoa(_in.value)}"`;
4357

44-
// Force immediate event update if idle
45-
if (_0xMealActive) {
46-
this._resetIdle();
47-
this._startEvent();
48-
}
58+
document.getElementById('output-view').value = output;
59+
this.print(`SUCCESS: Build [${buildID}] compiled successfully.`, "var(--p-blue)");
4960
},
5061

51-
/**
52-
* Updates the Topbar Ticker and the Log House Roof color
53-
*/
54-
_updateTicker: function() {
55-
const ticker = document.getElementById('status-ticker');
56-
const roof = document.getElementById('log-roof');
57-
const now = new Date();
62+
_dl: function() {
63+
const code = document.getElementById('output-view').value;
64+
if (!code) {
65+
this.print("ERROR: Transformation required before deployment.", "var(--p-red)");
66+
return;
67+
}
5868

59-
if (_state.bmas) {
60-
ticker.innerText = "🎄 BYTESMAS OVERRIDE ENGAGED 🎄";
61-
ticker.style.color = "var(--p-red)";
62-
roof.style.background = "#800000"; // Holiday Red
63-
roof.innerText = "Family Log House (Holiday Mode)";
64-
} else if (_state.mday) {
65-
ticker.innerText = "⭐ MILLENNIAL DAY OVERRIDE ENGAGED ⭐";
66-
ticker.style.color = "var(--p-gold)";
67-
roof.style.background = "#996600"; // Golden Roof
68-
roof.innerText = "Family Log House (Millennial Day)";
69-
} else {
70-
// Default: Bytesmas Countdown
71-
let bmasDate = new Date(now.getFullYear(), 11, 23);
72-
if (now > bmasDate) bmasDate = new Date(now.getFullYear() + 1, 11, 23);
73-
74-
const diff = bmasDate - now;
75-
const d = Math.floor(diff / (1000 * 60 * 60 * 24));
76-
const h = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
77-
const m = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
78-
const s = Math.floor((diff % (1000 * 60)) / 1000);
69+
const name = this._generateFileName();
70+
const blob = new Blob([code], { type: 'text/plain' });
71+
const link = document.createElement('a');
72+
link.href = URL.createObjectURL(blob);
73+
link.download = name;
74+
link.click();
7975

80-
ticker.innerText = `BYTESMAS COUNTDOWN: ${d}D ${h}H ${m}M ${s}S`;
81-
ticker.style.color = "var(--p-red)";
82-
roof.style.background = "#333"; // Standard Charcoal
83-
roof.innerText = "Family Log House (v1.13.100)";
84-
}
76+
this.print(`DEPLOY: File [${name}] exported to storage.`, "var(--p-green)");
77+
this.printChat("Skiddy Steve", "Deployment successful. The Android-safe naming logic is holding up.");
8578
},
8679

87-
_getTime: function() {
88-
return new Date().toLocaleTimeString('en-PH', { hour12: false });
80+
switchTab: function(tab) {
81+
_currentTab = tab;
82+
document.querySelectorAll('.log-tab').forEach(t => t.classList.remove('active'));
83+
document.getElementById(`tab-${tab}`).classList.add('active');
84+
document.getElementById('steve-logs').innerHTML = "";
85+
86+
if (tab === 'chat') {
87+
this.printChat("Anti-Tamper Mary", "Steve, the Millennial update looks good. Is the Guest Room stable?");
88+
this.printChat("Skiddy Steve", "Totally stable, Mom. No more Android conflicts.");
89+
}
8990
},
9091

9192
print: function(msg, color = "#fff") {
92-
const _log = document.getElementById('steve-logs');
93-
if (!_log) return;
93+
if (_currentTab !== 'sys') return;
94+
const log = document.getElementById('steve-logs');
9495
const div = document.createElement('div');
95-
div.className = 'log-entry';
9696
div.style.color = color;
97-
div.innerHTML = `<span class="log-ts">${this._getTime()}</span>${msg}`;
98-
_log.appendChild(div);
99-
_log.scrollTop = _log.scrollHeight;
100-
},
101-
102-
_resetIdle: function() {
103-
clearInterval(_0xMealInterval);
104-
clearTimeout(_0xMealTimer);
105-
_0xMealActive = false;
106-
107-
// Random idle trigger between 2-3 minutes
108-
const threshold = Math.random() * (180000 - 120000) + 120000;
109-
_0xMealTimer = setTimeout(() => this._startEvent(), threshold);
97+
div.style.marginBottom = "4px";
98+
div.innerHTML = `<span style="color:#555; font-size:10px;">[${new Date().toLocaleTimeString()}]</span> ${msg}`;
99+
log.appendChild(div);
100+
log.scrollTop = log.scrollHeight;
110101
},
111102

112-
_startEvent: function() {
113-
_0xMealActive = true;
114-
const now = new Date();
115-
// Memorial Window (March 8 - March 15)
116-
const isMemorial = (now.getMonth() === 2 && now.getDate() >= 8 && now.getDate() <= 15);
117-
118-
if (_state.bmas) {
119-
this.print("--- BYTESMAS EVE OVERRIDE ---", "var(--p-red)");
120-
this._runCycle([
121-
["Anti-Tamper Mary", "I've obfuscated the holiday ham."],
122-
["Sly Sarah", "I already decoded the guest list, Mom."],
123-
["Minify Dave", "BY-PAS! BY-PAS!"],
124-
["Skiddy Steve", "Can we just have one normal holiday?"]
125-
], "var(--p-red)", 3500);
126-
} else if (_state.mday || isMemorial) {
127-
this.print("--- MILLENNIAL DAY / v0.7 MEMORIAL ---", "var(--p-gold)");
128-
this._runCycle([
129-
["Hexadecimal Jim", "To v0.7. An outdated update, but a legend."],
130-
["Anti-Tamper Mary", "March 14th is always a heavy day in the kernel."],
131-
["Skiddy Steve", "v0.8 is still in his room. He misses his brother."],
132-
["Buffer Bob", "I... finally... got... the... flowers..."],
133-
["Minify Dave", "0.7... (Dave holds a deprecated floppy disk)"]
134-
], "var(--p-gold)", 5000);
135-
} else {
136-
this.print("--- STANDARD HOUSEHOLD LOG ---", "#00aaff");
137-
this._runCycle([
138-
["Anti-Tamper Mary", "Steve, dinner's ready. Stop script-kiddying."],
139-
["Skiddy Steve", "I'm literally optimizing the house WiFi, Mom!"],
140-
["Hexadecimal Jim", "Jim, pass the 0x53\x61\x6c\x74."]
141-
], "#e0e0e0", 4500);
142-
}
103+
printChat: function(user, msg) {
104+
const log = document.getElementById('steve-logs');
105+
const div = document.createElement('div');
106+
let col = user === "Skiddy Steve" ? "var(--p-green)" : "#d2a8ff";
107+
div.innerHTML = `<b style="color:${col}">${user}:</b> <span style="color:#ccc">${msg}</span>`;
108+
log.appendChild(div);
109+
log.scrollTop = log.scrollHeight;
143110
},
144111

145-
_runCycle: function(pool, defColor, speed) {
112+
_startHouseholdLogic: function() {
113+
const cycle = [
114+
["Anti-Tamper Mary", "Steve, someone in the Guest Room reported a bug."],
115+
["Skiddy Steve", "I'm on it. Just bypass-checking the v0.7 memorial logic."],
116+
["Hexadecimal Jim", "Make sure the bytecode is clean, Steve."],
117+
["Skiddy Steve", "Always is, Jim. Elite build only."]
118+
];
146119
let i = 0;
147-
_0xMealInterval = setInterval(() => {
148-
if (!_0xMealActive) return;
149-
const entry = pool[i % pool.length];
150-
// Dave always gets his custom color
151-
const color = entry[0] === "Minify Dave" ? "#ff00ff" : defColor;
152-
this.print(`[${entry[0]}]: ${entry[1]}`, color);
120+
setInterval(() => {
121+
if (_currentTab === 'chat') this.printChat(cycle[i % cycle.length][0], cycle[i % cycle.length][1]);
122+
else this.print(`[${cycle[i % cycle.length][0]}]: Active.`, "#8b949e");
153123
i++;
154-
}, speed);
155-
},
156-
157-
_remote: function() {
158-
this.print("[SYSTEM]: TV Signal Sent. Flipping to the Memorial Channel...", "#ffcc00");
159-
this._resetIdle();
160-
this._startEvent();
161-
},
162-
163-
_dl: function() {
164-
const _in = document.getElementById('input');
165-
if (!_in.value.trim()) {
166-
this.print("CRITICAL: [Anti-Tamper Mary] Empty source code detected!", "var(--p-red)");
167-
return;
168-
}
169-
clearInterval(_0xMealInterval);
170-
_0xMealActive = false;
171-
this.print("[Skiddy Steve]: Obfuscation Success. Pilot deployed.", "#39ff14");
172-
document.getElementById('output-view').value = `-- POBFUS 1.13.100\nlocal _ = "${btoa(_in.value)}"`;
173-
this._resetIdle();
124+
}, 8000);
174125
}
175126
};
176127

177128
window.onload = () => _011._init();
178-
['mousemove', 'keydown'].forEach(e => document.addEventListener(e, () => _011._resetIdle()));

0 commit comments

Comments
 (0)