Skip to content

Instantly share code, notes, and snippets.

@Xinayder
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save Xinayder/622628b7af7fee0e55cc to your computer and use it in GitHub Desktop.

Select an option

Save Xinayder/622628b7af7fee0e55cc to your computer and use it in GitHub Desktop.
Summer Sale 2015 autojoin script
// HOW TO USE:
// Copy the contents of this file
// Open up the developer console
// Paste the contents of this file and press enter.
function autoJoinGame() {
CModal.DismissActiveModal();
ShowAlertDialog("Auto-Join", "Trying to join game...");
$J.post('http://steamcommunity.com/minigame/ajaxjoingame/',
{ 'gameid': 0 }
).done(function(json) {
if (json.success == '1') {
clearInterval(timer);
ShowAlertDialog('Auto-Join', 'Successfully joined game! Redirecting you to the game in a few seconds.');
setTimeout("top.location.href = 'http://steamcommunity.com/minigame/towerattack/';", 2000);
} else {
ShowAlertDialog('Auto-Join', "Couldn't join game. Trying again...");
}
}).fail(function(jqXHR) {
var responseJSON = jqXHR.responseText.evalJSON();
if (responseJSON.success == '24') {
ShowAlertDialog('Auto-Join', 'Tried to join a room which was 10 levels higher than the last game you played.');
} else {
ShowAlertDialog('Auto-Join', "Couldn't join game. Trying again...");
}
});
}
var timer = setInterval("autoJoinGame()", 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment