Skip to content

Instantly share code, notes, and snippets.

@mekwall
Created August 20, 2015 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mekwall/78c2e4768ba782b0adf0 to your computer and use it in GitHub Desktop.
Save mekwall/78c2e4768ba782b0adf0 to your computer and use it in GitHub Desktop.
Ehrmagherd
// Start polling it for online check and game installed properly (ie the API is setup correctly)
// Origin needs some time starting + settings up the actual API correctly...
var pollCheckIfSignedIn = function() {
originlaunch.isOriginRunning(function(isRunning) {
if(isRunning) {
originlaunch.isOriginLoggedIn(function(isLoggedIn) {
if(isLoggedIn) {
function pollCheckIfGameIsInstalled() {
originlaunch.isGameInstalled(S.globalContext.realm.game,
function (isInstalled) {
if(isInstalled) { // We got a proper answer, everything is set up!
setTimeout(function() {
$(dialog).find("#joinflow-pluginpopup-continuebutton").removeClass("disabled").click();
}, 1500);
} else {
setTimeout(pollCheckIfGameIsInstalled, 1000);
}
});
}
pollCheckIfGameIsInstalled();
} else {
setTimeout(pollCheckIfSignedIn, 1000);
}
});
} else {
setTimeout(pollCheckIfSignedIn, 1000);
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment