View Single Post
Old 09-06-2004, 08:57 AM   #7 (permalink)
Purethief
 
Join Date: Aug 2004
Age: 34
Posts: 12
Default

Quote:
Originally Posted by blue_drac
what about nested Ifs instead?

Code:
   If (JournalContains “can’t seem to hide”
    UseSkill Hiding
    Else
    Useskill Hiding
      If (JournalContains “can’t seem to hide”
      UseSkill Hiding
      Else
      Useskill Hiding
        If (JournalContains “can’t seem to hide”
        UseSkill Hiding
        Else
        Useskill Hiding
           If (JournalContains “can’t seem to hide”
           UseSkill Hiding
           Else
           Useskill Hiding
             If (JournalContains “can’t seem to hide”
             UseSkill Hiding
             Else
             Useskill Hiding
           EndIf
        EndIf
      EndIf
    EndIf
  EndIf
You nested ifs will mess up... If you fail the 1st hiding (The one before the script starts) you will execute Hide and skip all else branches afterwards. This setup will only execute 1 hiding at all... and this one Hiding will be executed no matter if you succeed or fail.

I contrast the sequential ifs will do exactly what you want. Since ifYournal... Only checks back to the point where it last checked. So if the 1st IF finds a failed Hide attempt then the 2nd IF will only find a failed HIDE SINCE the last check. If you succeeded then there wont be an entry and Razor will skip all your futher hiding ifs...

Hope this makes sense...

[Edited for better explanaition why this setup fails]
Purethief is offline   Reply With Quote