Results 1 to 6 of 6

Thread: Error in "or"

  1. #1
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default Error in "or"

    This part (last line) gives me error:

    Simba Code:
    repeat
             bla blah blah blah
                  until ( ( FindNPCChatTextMulti('ert 2','Nothing') )  or ( GetColor(260,467)=16645886 ) ) or ( EndScript );

    Error is: [Error] (103:120): Type mismatch at line 102
    Compiling failed.

    after I edited it in this form:

    Simba Code:
    repeat
    blah blah blah
       until ( (( FindNPCChatTextMulti('ert 2','Nothing') )  or ( GetColor(260,467)=16645886 ) or (EndScript) );
    it gives this error:
    [Error] (103:119): Closing parenthesis expected at line 102
    Last edited by djborec; 02-06-2012 at 03:28 PM.

  2. #2
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    FindNPCChatTextMulti(['ert 2'], 'Nothing') instead?

  3. #3
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Simba Code:
    until ( (FindNPCChatTextMulti('ert 2',Nothing) )  or ( GetColor(260,467)= 16645886) or (EndScript));
    You added an extra parentheses.

  4. #4
    Join Date
    Oct 2011
    Posts
    207
    Mentioned
    1 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by nosaj.421 View Post
    FindNPCChatTextMulti(['ert 2'], 'Nothing') instead?
    Thanks
    worked with
    Simba Code:
    FindNPCChatTextMulti(['ert 2'], Nothing)

    Just learning scripting in SImba so sorry for this dumb question. Dunno why its there [] ,String is some kind of array in SIMBA?

  5. #5
    Join Date
    Sep 2010
    Location
    Finland
    Posts
    299
    Mentioned
    8 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by djborec View Post
    Thanks
    worked with
    Simba Code:
    FindNPCChatTextMulti(['ert 2'], Nothing) instead?

    Just learning scripting in SImba so sorry for this dumb question. Dunno why its there [] ,String is some kind of array in SIMBA?
    FindNPCChatTextMulti uses TStringArray which is a array of string, and arrays are always putted in square brackets [], and different values separated by comma.
    Last edited by Smidqe; 02-06-2012 at 03:48 PM.
    Rusting away

  6. #6
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    All arrays you should check [] is there. It's a common error, no worries about it. As you script more you will be very aware of that.

    Also, it's a good idea to remember that the ***Multi SRL functions usually take an array as an argument.

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
  •