SRL Archive - Help

Error in "or"


djborec

2012-02-06 10:25:25

This part (last line) gives me error:

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:


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

Er1k

2012-02-06 10:28:35

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

Sin

2012-02-06 10:30:36


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

djborec

2012-02-06 10:31:09

From: nosaj.421
FindNPCChatTextMulti(['ert 2'], 'Nothing') instead?


Thanks
worked with
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?

Smidqe

2012-02-06 10:32:39

From: djborec
Thanks
worked with
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.

Er1k

2012-02-06 10:43:59

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.