Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Created January 15, 2015 21:45
Show Gist options
  • Select an option

  • Save zeroeth/b9ed32b068a373fc6718 to your computer and use it in GitHub Desktop.

Select an option

Save zeroeth/b9ed32b068a373fc6718 to your computer and use it in GitHub Desktop.
Aris minigame score keeper
<html>
<head>
<script>
var ARIS = {};
</script>
</head>
<body>
<div>
<button id="giveWinToken">You Win X!</button>
</div>
<script>
(function() {
var total_wins_item_id = 17;
var game_win_token_item_id = 16;
var starting_token_count = 0;
document.getElementById("giveWinToken").onclick = function()
{
if(starting_token_count <= 0)
{
ARIS.setItemCount (game_win_token_item_id, 1);
ARIS.giveItemCount(total_wins_item_id, 1);
}
}
ARIS.didUpdateItemQty = function(item_id, quantity)
{
starting_token_count = quantity;
}
ARIS.ready = function()
{
ARIS.getItemCount(game_win_token_item_id);
}
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment