Jump to content

if..then problem


hart
 Share

Recommended Posts

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

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 by hart
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...