if statement - JavaScript Conditionals not working -
i'm sorry didn't search topic thought bit specific, ok that's out of way!
when run missionbutton.click(); ran, though checkhealth() = 0 it's it's skipping on original if statement, normal javascript (i'm used other languages)
//__action_functions__ // when you're @ 0 health. function hospital(){ location.assign("http://www.gangwarsmobile.com/index.php?p=hospital"); var hospitaluse = hospitalid; hospitaluse.click(); settimeout(location.assign("http://www.gangwarsmobile.com/index.php?p=crimes"),5000); } //__does mission__ function start(){ var missionbutton = crimeid; //crimeid buttonid /crimes page/ variables @ top of script. if(checkhealth() === 0){hospital();} else if (checkstamina() > 0);{missionbutton.click();} }
i can't see reason why not work.
extra
i'm using tampermonkey, if makes difference.
did forget take out ; after () > 0 ?
original:
if(checkhealth() === 0){hospital();} else if (checkstamina() > 0);{missionbutton.click();}
fixed:
if(checkhealth() === 0){ hospital(); } else if (checkstamina() > 0) { missionbutton.click(); }
Comments
Post a Comment