diff --git a/index.html b/index.html index c24ef33..7573498 100644 --- a/index.html +++ b/index.html @@ -54,6 +54,12 @@
+
Old packet style (for robots coded before 2-14-24)
+ +
+
+
+
Help/Info!
diff --git a/index.js b/index.js index 9bfb380..dc34395 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,7 @@ let hackSpacerElement = document.getElementById("hack-spacer"); let toggleMobile = document.getElementById('toggle-mobile-layout'); let toggleKeyboardWASD = document.getElementById('toggle-keyboard-style'); +let toggleLegacyPacket = document.getElementById('toggle-legacy'); let toggleInfo = document.getElementById('toggle-info'); // --------------------------- state management ------------------------------------ // @@ -31,14 +32,17 @@ if (localStorage.getItem(toggleMobile.id) == null) { document.addEventListener('DOMContentLoaded', function () { updateMobileSlider(toggleMobile, toggleState=false); updateSlider(toggleKeyboardWASD, toggleState=false); + updateSlider(toggleLegacyPacket, toggleState=false); updateInfoSlider(toggleInfo, toggleState=false); toggleMobile.onmousedown = updateMobileSlider.bind(null, toggleMobile, toggleState=true) toggleKeyboardWASD.onmousedown = updateSlider.bind(null, toggleKeyboardWASD, toggleState=true) + toggleLegacyPacket.onmousedown = updateSlider.bind(null, toggleLegacyPacket, toggleState=true) toggleInfo.onmousedown = updateInfoSlider.bind(null, toggleInfo, toggleState=true) toggleMobile.ontouchstart = updateMobileSlider.bind(null, toggleMobile, toggleState=true) toggleKeyboardWASD.ontouchstart = updateSlider.bind(null, toggleKeyboardWASD, toggleState=true) + toggleLegacyPacket.ontouchstart = updateSlider.bind(null, toggleLegacyPacket, toggleState=true) toggleInfo.ontouchstart = updateInfoSlider.bind(null, toggleInfo, toggleState=true) window.setInterval(renderLoop, 40); // call renderLoop every num milliseconds @@ -139,6 +143,15 @@ function renderLoop() { } } + if (localStorage.getItem(toggleLegacyPacket.id) === 'true') { + rawPacket[0] = rawPacket[1] + rawPacket[1] = rawPacket[2] + rawPacket[2] = rawPacket[3] + rawPacket[3] = rawPacket[4] + rawPacket[4] = rawPacket[5] + rawPacket[5] = rawPacket[6] + } + if (!document.hasFocus()) { rawPacket.fill(0, 0, 20); } //console.log(rawPacket)