Last active
August 29, 2015 14:22
-
-
Save Xinayder/622628b7af7fee0e55cc to your computer and use it in GitHub Desktop.
Summer Sale 2015 autojoin script
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
| // 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