Skip to content

Instantly share code, notes, and snippets.

@feildmaster
Forked from EdGruberman/gist:d8ce793a56b33feca1ee
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save feildmaster/f235abc811dfb1f590b7 to your computer and use it in GitHub Desktop.

Select an option

Save feildmaster/f235abc811dfb1f590b7 to your computer and use it in GitHub Desktop.
function switchRooms(from, to) {
if (from) {
$J.post('http://steamcommunity.com/minigame/ajaxleavegame/',{ 'gameid' : from, 'sessionid' : g_sessionID })
}
if (!to) {
return;
}
var trying = false;
function tryJoin() {
if (!trying) {
trying = true;
JoinGameHelper(join);
return;
} else {
var button = $J('.btn_grey_white_innerfade');
if (button) {
button.click();
trying = false;
}
}
};
window.setInterval(tryJoin, 500);
}
// From 1, going to 2
switchRooms(1, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment