Created
December 28, 2021 06:08
-
-
Save hello-smile6/300233990d1789534ed93053c5137e1a to your computer and use it in GitHub Desktop.
Manual TurboWarp Cloud Vars Update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>TurboWarp Client</title> | |
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/MystPi/dreamcss/src/dream.css" /> | |
</head> | |
<body> | |
<h1>TurboWarp Client</h1> | |
<input type="number" id="project-id" /> | |
<button id="start"> | |
Start | |
</button> | |
<br/> | |
<section id="var-cpl" style="display: none"> | |
<h2>Set variable</h2> | |
<input type="text" id="var-name" placeholder="Variable name" /> | |
<input type="number" id="var-value" placeholder="Variable value" /> | |
<button id="set-var"> | |
Set variable | |
</button> | |
</section> | |
<pre id="log"> | |
</pre> | |
<script> | |
document.getElementById("start").addEventListener("click",function() { | |
try { | |
var socket=new WebSocket("wss://clouddata.turbowarp.org/"); | |
window.socket=socket; | |
var log=document.getElementById("log"); | |
log.textContent+="\nInitializing."; | |
socket.addEventListener("open",function() { | |
document.getElementById("project-id").disabled=true; | |
log.textContent+="\nConnected to server."; | |
document.getElementById("var-cpl").style.display="block"; | |
socket.send(JSON.stringify({method: "handshake",user: "9pfs",project_id: document.getElementById("project-id").value})); | |
}); | |
socket.addEventListener("message",function(e) { | |
log.textContent+="\n".concat(e.data); | |
}); | |
socket.addEventListener("close",function(e) { | |
document.getElementById("project-id").disabled=false; | |
window.socket=null; | |
log.textContent+="\n".concat("Closed connection.\nCode: ",e.code,"\nReason: ",e.reason); | |
document.getElementById("var-cpl").style.display="none"; | |
}); | |
} | |
catch(e) { | |
alert(e.stack); | |
} | |
}); | |
document.getElementById("set-var").addEventListener("click",function() { | |
socket.send(JSON.stringify({ | |
method: "set", | |
user: "example", | |
project_id: document.getElementById("project-id").value, | |
name: "\u2601 ".concat(document.getElementById("var-name").value), | |
value: document.getElementById("var-value").value.toString() | |
})); | |
}); | |
</script> | |
</body> | |
</html> |
hMmM
@webdev03 I made it last night because I was bored.
@webdev03 I use it on https://turbowarp.org/46587498 mainly.
I see you
@webdev03 Same
This literally only changes cloud vars on turbowarp. How is better than s2py?!
@The-Cloud-Dev It works in the browser.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@s-Pixels How is this?