hart Posted March 10, 2009 Share Posted March 10, 2009 if $monselect > 0 Then attack() elseif $monselect = 0 then findmon() Else ... endif when elseif executes, it tries to find monsters by sending a key which is findmon(). the problem is when it finds no monsters, elseif will be triggered again. so i want it to go to else block if it finds no monsters. what should i add? any tip will be fine. i really had a hard time searching for solutions for this and i'm new to autoit. Link to comment Share on other sites More sharing options...
Authenticity Posted March 10, 2009 Share Posted March 10, 2009 Use Select...Case...EndSelect structure and use the ContinueCase if the result of the function is something. Link to comment Share on other sites More sharing options...
hart Posted March 11, 2009 Author Share Posted March 11, 2009 (edited) thx i'll try this. i used this block for my skill. btw i tried exitloop with do.. findmon().. until with that code i dn't know why it exits my main function. this how my code should look like. my whole func stops at exitloop, shoudn't it be the do loop that will stop? func x() while 1 ... if..then... elseif do... if.. exitloop .. .. .. Edited March 11, 2009 by hart Link to comment Share on other sites More sharing options...
Authenticity Posted March 11, 2009 Share Posted March 11, 2009 It's difficult to understand what is what in this snippet. Anyway, the generic structure should be a loop like Do...Until <something true> so if this loop is within a loop, exiting this loop would continue with the outer loop, if there is no outer loop it will continue with the execution of the code chart flow which may be nothing. Give a more descriptive, even one that generate errors, just to see the way you coded it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now