Log in

View Full Version : Error in "or"



djborec
02-06-2012, 03:25 PM
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
02-06-2012, 03:28 PM
FindNPCChatTextMulti(['ert 2'], 'Nothing') instead?

Sin
02-06-2012, 03:30 PM
until ( (FindNPCChatTextMulti('ert 2',Nothing) ) or ( GetColor(260,467)= 16645886) or (EndScript));

You added an extra parentheses.

djborec
02-06-2012, 03:31 PM
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
02-06-2012, 03:32 PM
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
02-06-2012, 03:43 PM
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.