Cy|cle. Bu|llet. To Change A Variable Use The Script Of Notes. (list changing in process)
javascript:const container = document.createElement('div');container.style.position = 'fixed';container.style.top = '10px';container.style.right = '10px';container.style.backgroundColor = 'black';container.style.padding = '10px';container.style.border = '2px solid red';container.style.zIndex = '9999';container.innerHTML = ` <h3 style="color: red;">Change Variable Value</h3> <label for="variableName" style="color: red;">Variable name:</label><br> <input type="text" id="variableName" placeholder="name"><br><br> <label for="variableValue" style="color: red;">New value:</label><br> <input type="text" id="variableValue" placeholder="value"><br><br> <button id="setValueButton" style="color: darkred;">Set value</button> <button id="showVariablesButton" style="color: darkred;">Show variables</button> <button id="closeChangeValue" style="color: darkred;">Close</button> <p id="result" style="color: red;"></p>`;document.body.appendChild(container);const variableListContainer = document.createElement('div');variableListContainer.style.position = 'fixed';variableListContainer.style.top = '10px';variableListContainer.style.left = '10px';variableListContainer.style.backgroundColor = 'black';variableListContainer.style.padding = '10px';variableListContainer.style.border = '2px solid red';variableListContainer.style.zIndex = '9999';variableListContainer.style.display = 'none';variableListContainer.innerHTML = ` <h3 style="color: red;">Variable List</h3> <ul id="variableList" style="color: red;"></ul> <button id="closeVariableList" style="color: darkred;">Close</button>`;document.body.appendChild(variableListContainer);let isRepeating = false;let activeProcesses = [];document.getElementById('setValueButton').onclick = function() { const name = document.getElementById("variableName").value; const value = document.getElementById("variableValue").value; const target = vm.runtime.getTargetForStage(); let variable = null; for (let id in target.variables) { if (target.variables[id].name === name) { variable = target.variables[id]; break; } } if (variable) { const currentValue = variable.value; activeProcesses.push({ variableName: name, value: value }); document.getElementById("result").innerText = `Value of ${name} will set to ${value} until you stop it.`; const repeatValue = () => { variable.value = value; }; const intervalId = setInterval(repeatValue, 1000); activeProcesses[activeProcesses.length - 1].intervalId = intervalId; } else { console.log('Variable with the given name not found'); document.getElementById("result").innerText = 'The variable name is not valid'; }};document.getElementById('showVariablesButton').onclick = function() { const target = vm.runtime.getTargetForStage(); const variableList = document.getElementById('variableList'); variableList.innerHTML = ''; for (let id in target.variables) { const li = document.createElement('li'); li.textContent = target.variables[id].name; variableList.appendChild(li); } variableListContainer.style.display = 'block';};document.getElementById('closeChangeValue').onclick = function() { container.style.display = 'block';};document.getElementById('closeVariableList').onclick = function() { variableListContainer.style.display = 'none';};