Skip to content

Instantly share code, notes, and snippets.

@daid
Created February 22, 2015 08:23
Show Gist options
  • Save daid/585b589207c5a8f1d62b to your computer and use it in GitHub Desktop.
Save daid/585b589207c5a8f1d62b to your computer and use it in GitHub Desktop.
<!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