Results 1 to 5 of 5

Thread: SMART_DrawTextMulti help?

  1. #1
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default SMART_DrawTextMulti help?

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

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

    Error given:
    Code:
    [Error] C:\Simba\Scripts\AKSmelterPaint.simba(3127:53): Closing square bracket (']') expected at line 3126
    Compiling failed.
    I think there is a
    Simba Code:
    '
    in the wrong place but I moved it around and it still wouldn't work :/

    Any help is appreciated

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    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)?
    Simba Code:
    SMART_DrawTextMulti(true, true, ['Time Run: ' + TimeRunning, 'Logs Chopped: ' + ToStr(LogsChopped)], Point(10, 10), LoginChars, clRed);

  3. #3
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    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:

    Simba Code:
    SMART_DrawTextMulti(false, true, ['BarType + '    (' + FloatToStr(XPPerBar) + ' XP Each)], Point(10, 10), LoginChars, clRed);
    Last edited by Ian; 01-09-2013 at 01:10 AM. Reason: Still won't work :/

  4. #4
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    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:

    Simba Code:
    SMART_DrawTextMulti(false, true, ['BarType + '    (' + FloatToStr(XPPerBar) + ' XP Each)], Point(10, 10), LoginChars, clRed);
    You have the {'} at the wrong places again.
    Simba Code:
    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)

  5. #5
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Whoops, thanks

    I just had copy and pasted it from my text proggy

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

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
  •