emilix85 0 Posted April 30, 2013 Report Share Posted April 30, 2013 (edited) Hi guys i have a problem with a loop while....If the 2 conditions ($either) of the while is false the bot go out of the loop and run the next command this is normal and ok; but if the 2 conditions ($either) of the while is true i want that the bot should continue to check conditions (must stay in while) without executing any commands. in practice must exit from the loop and execute the command only if the 2 conditions is false. This is the code: ui text box("Account Attivo:", #Account) ui stat monitor("Username:", #Username) ui stat monitor("Timer:", #Contatore) ui button("Clear Cookies") { clear cookies } set(#Username, $trim($scrape attribute(<outerhtml=w"<span id=\"*\">Offerta più alta:<br>*</span>">, "innertext")), "Global") set(#Contatore, $trim($scrape attribute(<outerhtml=w"<span id=\"*\"><span class=\"*\"> * </span></span>">, "innertext")), "Global") Loop() define Loop { loop while($either($comparison(#Contatore, ">", 80), $comparison(#Username, "=", "Offerta più alta:{#Account}"))) { set(#Contatore, $trim($scrape attribute(<outerhtml=w"<span id=\"*\"><span class=\"*\"> * </span></span>">, "innertext")), "Global") set(#Username, $trim($scrape attribute(<outerhtml=w"<span id=\"*\">Offerta più alta:<br>*</span>">, "innertext")), "Global") } Clicca() } define Clicca { click(<outerhtml=w"<input type=\"button\" id=\"*\" onclick=\"*\" value=\"PUNTA\">">, "Left Click", "No") wait(10) Loop() } Thanks Edited April 30, 2013 by emilix85 Quote Link to post Share on other sites
LazyBotter 188 Posted April 30, 2013 Report Share Posted April 30, 2013 I dont understand what you are trying to do properly, should you not be using $both? Quote Link to post Share on other sites
emilix85 0 Posted April 30, 2013 Author Report Share Posted April 30, 2013 what is the difference between $both anf $either? Quote Link to post Share on other sites
Aymen 385 Posted April 30, 2013 Report Share Posted April 30, 2013 what is the difference between $both anf $either? $both means AND$either means OR Quote Link to post Share on other sites
emilix85 0 Posted April 30, 2013 Author Report Share Posted April 30, 2013 (edited) in practice, the loop should continue until both conditions are true:if the both conditions are true (the loop stops) then >>> run command "Clicca"if the both conditions are false (the loop stops) then >>> stay in the loop as long as the conditions are true (How can I do this?) must take the action only if the two conditions are true. use the loop while because I need to follow 2 variables: a timer(#contatore), and usernames(#Username): Loop() define Loop { loop while($either($comparison(#Contatore, "<=", 80), $comparison(#Username, "=!", "Offerta più alta:{#Account}"))) { set(#Contatore, $trim($scrape attribute(<outerhtml=w"<span id=\"*\"><span class=\"*\"> * </span></span>">, "innertext")), "Global") set(#Username, $trim($scrape attribute(<outerhtml=w"<span id=\"*\">Offerta più alta:<br>*</span>">, "innertext")), "Global") } Clicca() } define Clicca { click(<outerhtml=w"<input type=\"button\" id=\"*\" onclick=\"*\" value=\"PUNTA\">">, "Left Click", "No") wait(10) Loop() } Thanks Edited April 30, 2013 by emilix85 Quote Link to post Share on other sites
LazyBotter 188 Posted April 30, 2013 Report Share Posted April 30, 2013 Loop() define Loop { loop while($both($comparison(#Contatore, "<=", 80), $comparison(#Username, "=!", "Offerta più alta:{#Account}"))) { set(#Contatore, $trim($scrape attribute(<outerhtml=w"<span id=\"*\"><span class=\"*\"> * </span></span>">, "innertext")), "Global") set(#Username, $trim($scrape attribute(<outerhtml=w"<span id=\"*\">Offerta più alta:<br>*</span>">, "innertext")), "Global") } Clicca() } define Clicca { click(<outerhtml=w"<input type=\"button\" id=\"*\" onclick=\"*\" value=\"PUNTA\">">, "Left Click", "No") wait(10) Loop() } ??? Quote Link to post Share on other sites
emilix85 0 Posted May 2, 2013 Author Report Share Posted May 2, 2013 you're right Lazy! was wrong the entire structure Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.