Results 1 to 3 of 3

Thread: GetChatTextColorArray;

  1. #1
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default GetChatTextColorArray;

    Among other things, I'm making a script, and I made this function for it. What do you guys think about this being added to SRL?

    Basically, it returns a TIntegerArray; one integer(colour) for every line of text in the chat box. My test results and screenshot are an example of the output:


    Yes, I'm a noob, I didn't free my bitmap.

    It can be very useful and versatile in my opinion. Ofcourse, more colours can/will/should be added too

    Simba Code:
    1. function GetChatTextColourArray: TIntegerArray;
    2. var
    3.   i: Integer;
    4.   tmpTPA: TPointArray;
    5. begin
    6.   SetLength(Result, 8);
    7.   for i := 0 to 7 do
    8.   begin
    9.     Result[i] := -1;
    10.  
    11.     if FindColors(tmpTPA, clBlack, 7, (349 + (i * 14)), 497, (351 + (i * 14))) then
    12.       if FindColors(tmpTPA, clBlue, 7, (349 + (i * 14)), 497, (351 + (i * 14))) then
    13.         Result[i] := clBlue   // Player chat
    14.       else
    15.         Result[i] := clBlack;
    16.  
    17.     if FindColors(tmpTPA, clRed, 7, (349 + (i * 14)), 497, (351 + (i * 14))) then
    18.       Result[i] := clRed;  // Unlocking new music, bird nest drop
    19.  
    20.     if FindColors(tmpTPA, clYellow, 7, (349 + (i * 14)), 497, (351 + (i * 14))) then
    21.       Result[i] := clYellow;   // Currently used when a demon appears somewhere
    22.  
    23.     if FindColors(tmpTPA, 16776960, 7, (349 + (i * 14)), 497, (351 + (i * 14))) then
    24.       Result[i] := 16776960;   // Cyan - GE buy/sell process completed
    25.  
    26.     if FindColors(tmpTPA, 30446, 7, (349 + (i * 14)), 497, (351 + (i * 14))) then
    27.       Result[i] := 30446;   // Orange - Daily Challenge (assignment + completion)  
    28.   end;
    29. end;

    INACTIVE
    How-to: Make S.M.A.R.T. less laggy

    Sell me your Maple Shieldbows (u)! Up to 95gp ea!

    My Scripts:
    Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
    99 x78 | 99 x10 | 99 x2 | 99 x12


    Use the REPORT tags when posting progress reports to make life easier (:
    [REPORT]Put progress report in here![/REPORT]

    Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    if you add more colors, wouldn't it be less code to make a local tia with all the colors, so then you have an inner loop to iterate through the chat colors?

    I think if the include doesn't have this, it could come in handy for finding important chat texts (ex. there's an action/text that happens in red that you look out for)

  3. #3
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    if you add more colors, wouldn't it be less code to make a local tia with all the colors, so then you have an inner loop to iterate through the chat colors?
    Yes, I did think about this, but initially, I only had 2-3 colours in there. I would probably change it if I add it to the includes.

    Quote Originally Posted by Le Jingle View Post
    I think if the include doesn't have this, it could come in handy for finding important chat texts (ex. there's an action/text that happens in red that you look out for)
    Yes, that red action text is important for this like fire spirit thing (bonifres), nests (ivy/wc) and such. Also, for challenges, if anyone wants to make a script for that.

    INACTIVE
    How-to: Make S.M.A.R.T. less laggy

    Sell me your Maple Shieldbows (u)! Up to 95gp ea!

    My Scripts:
    Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
    99 x78 | 99 x10 | 99 x2 | 99 x12


    Use the REPORT tags when posting progress reports to make life easier (:
    [REPORT]Put progress report in here![/REPORT]

    Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]

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
  •