SRL Archive - OSR Help

SMART_DrawTextMulti help?


Ian

2013-01-08 19:47:22

The example for SMART_DrawTextMulti in the documentation gives a compiling error.

Example:
SMART_DrawTextMulti(true, true, ['Time Run: '+TimeRunning', 'Logs Chopped: 10'], Point(10, 10), LoginChars, clRed);

Error given:
[Error] C:\Simba\Scripts\AKSmelterPaint.simba(3127:53): Closing square bracket (']') expected at line 3126
Compiling failed.

I think there is a
'
in the wrong place but I moved it around and it still wouldn't work :/

Any help is appreciated :)

riwu

2013-01-08 19:53:31

Where did you find this example?
There's an extra {'} after TimeRunning. The integer after Logs Chopped is enclosed by string literals so it won't change. Probably should be something like ToStr(LogsChopped)?

SMART_DrawTextMulti(true, true, ['Time Run: ' + TimeRunning, 'Logs Chopped: ' + ToStr(LogsChopped)], Point(10, 10), LoginChars, clRed);

Ian

2013-01-08 20:03:48

I found the example here :
http://docs.villavu.com/srl-5/paintsmart.html#id20

I'll try what you posted.

E: Tried with this, still gives the closing square bracket error:

SMART_DrawTextMulti(false, true, ['BarType + '    (' + FloatToStr(XPPerBar) + ' XP Each)], Point(10, 10), LoginChars, clRed);

riwu

2013-01-08 20:17:18

From: BMWxi
I found the example here :
http://docs.villavu.com/srl-5/paintsmart.html#id20

I'll try what you posted.

E: Tried with this, still gives the closing square bracket error:

SMART_DrawTextMulti(false, true, ['BarType + '    (' + FloatToStr(XPPerBar) + ' XP Each)], Point(10, 10), LoginChars, clRed);

You have the {'} at the wrong places again.

SMART_DrawTextMulti(false, true, [BarType + ' (' + ToStr(XPPerBar) + ' XP Each)'], Point(10, 10), LoginChars, clRed);
So if BarType == Gold and XPPerBar == 50, it will display
Gold (50 Xp Each)

Ian

2013-01-08 20:25:36

Whoops, thanks :)

I just had copy and pasted it from my text proggy :duh:

Although the example in the SRL Function Reference should probably be fixed still.