Results 1 to 6 of 6

Thread: Need help urgently with OptionsExist

  1. #1
    Join Date
    Jan 2011
    Posts
    350
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default Need help urgently with OptionsExist

    is this correct:
    Simba Code:
    if OptionsExist('ank',True) then

    it seems to be. What i need is to check if there is an option of bank when i right click and NPC but my script wont compile because of this.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    What compile error are you getting?
    Actually....
    When you look up the function, the first parameter needs to be a TStringArray.

    So you would need to make it

    if OptionsExist(['ank'],True) then

    An array is like a list of stuff.

    So you could even do like

    if OptionsExist(['Bank', 'ank' 'nk'], True) then

    But just 'ank' is fine/faster (by a few milliseconds)

  3. #3
    Join Date
    Jan 2011
    Posts
    350
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    thank you

  4. #4
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    if OptionsExist(['Bank', 'ank' 'nk'], True) then
    But just 'ank' is fine/faster (by a few milliseconds)
    Why is it faster? If it finds the first word, the rest wont be compiled. Am I wrong? (or you mean its faster to get false result?)

  5. #5
    Join Date
    Jan 2008
    Location
    C:\
    Posts
    1,483
    Mentioned
    2 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by hunt3rx3 View Post
    Why is it faster? If it finds the first word, the rest wont be compiled. Am I wrong? (or you mean its faster to get false result?)
    It looks like the inputted data gets handled before any searching is done, so he must be referring to the time it takes to load the array and then retrieve it's length.

  6. #6
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Honestly the difference is just a few ms if any, it's negligible.

    I'd say 'ank' will work all the time, to to be safer you can add more parts of it if you want.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •