vendredi 30 octobre 2015

Javascript Conditionals not working

I'm sorry I didn't search for another topic I thought this was a bit too specfic, ok now that's out of the way!

When this is run missionButton.click(); is always ran, even though CheckHealth() is = to 0 it's like it's just skipping over the original if statement, is this normal for js (i'm used to other languages)

//__Action_Functions__

// When you're at zero health.
function Hospital(){     
    location.assign("http://ift.tt/1Nf3uIN");
    var HospitalUse = HospitalID;
    HospitalUse.click();

    setTimeout(location.assign("http://ift.tt/1NHgFR1"),5000);
}


//__Does Mission__
function start(){
    var missionButton = CrimeID; //CrimeID is the ButtonID from the /crimes page/ variables at the top of this script.  

    if(CheckHealth() === 0){Hospital();}
    else if (CheckStamina() > 0);{missionButton.click();}
}

There's no reason I can see this won't work

EXTRA

I'm using tampermonkey, if that makes any difference.

Aucun commentaire:

Enregistrer un commentaire