-
-
Save daid/585b589207c5a8f1d62b to your computer and use it in GitHub Desktop.
This file contains 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 lang="us"> | |
<head> | |
<meta charset="utf-8"> | |
<title>EmptyEpsilon</title> | |
</head> | |
<body> | |
<textarea id="script" style="width: 400px; height: 400px">player = getPlayerShip(-1) | |
if player == nil then return {error = "No ship"} end | |
return {hull = player:getHull() / player:getHullMax()} | |
</textarea> | |
<button onclick="send()">Send</button> | |
<div id="output"></div> | |
<script src="jquery.js"></script> | |
<script> | |
function send() | |
{ | |
$.post('exec.lua', $("#script").val(), function(data) { | |
$("#output").text(JSON.stringify(data)); | |
}, "json") | |
.fail(function(x, y, reason) { | |
$("#output").text("FAIL"); | |
}); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment