Results 1 to 22 of 22

Thread: Inchat Function Problem

  1. #1
    Join Date
    Sep 2006
    Location
    Great Britain
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Inchat Function Problem

    Hey

    Today, Jagex updated the game engine along with various other things.
    They also made a few tweaks to the UI.

    They have moved the last line of chat (in the chat box) up several pixels.

    Because of this, the inchat function no longer works correctly. (which means no more auto responses!)

    Now instead of waiting for the new SRL to come out i want to fix this myself.

    This is what I have tried so far, but it hasnt worked:

    -> Go to the scar includes folder
    -> core
    -> Text.scar
    -> in text.scar i edited the following


    In function LastChatter;
    I changed 21, 415 to 24, 411 (because these are the co-ords of where the last line of chat now appears... i.e. 4 pixels higher)


    In function GetLastChatText;
    I changed 40, 415, 130, 415 to 40, 411, 130, 411



    After trying this it didnt work.

    I have experimented with other y-cordinates as well. I have tried 415, 411, 413, and 410.


    Am I going about this the right way?

    Can anyone plz shed some light on how to fix this?

    Thanks,
    Granti

  2. #2
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function LastChatter(var name: String): Boolean;
    By: masquerader
    Description:
    *******************************************************************************}


    function LastChatter(var name: string): Boolean;
    var
      i: Integer;
    begin
      name := LowerCase(Trim(GetTextAtEx(19, 412, 0, SmallChars, False, False, 0, 0,
        0, 50, False, tr_allChars)))
        i := Pos(':', name)
        if (i <> 0) then
      begin
        Delete(name, i, i);
        Result := True;
      end;
    end;

    {*******************************************************************************
    function GetLastChatText(var chat: String): Boolean;
    By: masquerader
    Description:
    *******************************************************************************}


    function GetLastChatText(var chat: string): Boolean;
    var
      textx, texty: Integer;
    begin
      if (IsTextInAreaEx(40, 412, 130, 413, textx, texty, ':', 0, smallchars, False,
        True, 0, 0, 0)) then
      begin
        chat := LowerCase(Trim(GetTextAtEx(textx + 3, 412, 0, SmallChars, False,
          False, 0, 1, 16711680, 40, False, tr_allChars)));
        Result := True;
      end;
    end;

    {*******************************************************************************
    function ChatsBlackText: Array Of String;
    By: Wizzup?
    Description: Gets all text with color 0 in chatbox:
     line 1 is result[0]
     line 2 is result[1]
     line 3 is result[2]
     line 4 is result[3]
     line 5 is result[4]
    *******************************************************************************}


    function ChatsBlackText: array of string;
    var
      I: Byte;
    begin
      SetArrayLength(Result, 5);
      for I := 0 to 4 do
        Result[I] := Trim(GetTextAtEx(18, 412 - (14 * I), 0, SmallChars, False,
          False, 0, 1, 0, 80, False, tr_AllChars));
    end;


    {*******************************************************************************
    function GetBlackChatMessage: String;
    By: Wizzup?
    Description: Gets text with color 0 in last chat line.
    *******************************************************************************}


    function GetBlackChatMessage: string;
    begin
      Result := Trim(GetTextAtEx(18, 412, 0, SmallChars, False,
        False, 0, 1, 0, 80, False, tr_AllChars));
    end;

    These are the fixed functions, replace them if you want.
    Hup Holland Hup!

  3. #3
    Join Date
    Apr 2007
    Location
    Texas
    Posts
    1,668
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Granti View Post
    Hey

    Today, Jagex updated the game engine along with various other things.
    They also made a few tweaks to the UI.
    Good thinking, that is exactly what I would try. It should work unless they made some other changes
    [IMG]http://farm3.static.flickr.com/2120/2052732965_348f3629d0_o.jpg[/IMG]

  4. #4
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    While we're on the subject of Jagex updating things, when will the official fix (for everything) be out? That is, if it's not out already.

  5. #5
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Sooner then you think
    Hup Holland Hup!

  6. #6
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Ah, good

    Oh, and has anyone noticed that SRL's AutoColoring functions don't seem to work? I tried using a couple of them, but it kept saying it couldn't find it.

  7. #7
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    They seem to work for me.. (FindRoadColor, FindFallyRoadColor, FindWaterColor)?
    Hup Holland Hup!

  8. #8
    Join Date
    Sep 2006
    Location
    Great Britain
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Dielseie95,

    Tyvm for taking the time to look over those functions and make corrections.

    However, i have replaced my old functions with your new functions but still it dont work.

    could you have a look over what you edited and check its correct?

    id be very greatful, ty.

  9. #9
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Jason2gs View Post
    Ah, good

    Oh, and has anyone noticed that SRL's AutoColoring functions don't seem to work? I tried using a couple of them, but it kept saying it couldn't find it.
    Which functions aren't working for you?

  10. #10
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Which wasn't working for you?

    SCAR Code:
    function LastChatter(var name: string): Boolean;
    var
      i: Integer;
    begin
      name := LowerCase(Trim(GetTextAtEx(19, 412, 0, SmallChars, False, False, 0, 0,
        0, 50, False, tr_allChars)))
        i := Pos(':', name)
        if (i <> 0) then
      begin
        Delete(name, i, i);
        Result := True;
      end;
    end;

    I updated 1 coord a little, it should work now.
    Hup Holland Hup!

  11. #11
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tarajunky View Post
    Which functions aren't working for you?
    FindDirtRoadColor never (at least for me) works. Well, I never tested anywhere except the new varrock road color, but it should work on there right?

  12. #12
    Join Date
    Sep 2006
    Location
    Great Britain
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)
    I updated 1 coord a little, it should work now.
    Which co-ord did you update sorry?

  13. #13
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    The procedure is in my post .
    Hup Holland Hup!

  14. #14
    Join Date
    Sep 2006
    Location
    Great Britain
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Procedure in first post:

    SCAR Code:
    function LastChatter(var name: string): Boolean;
    var
      i: Integer;
    begin
      name := LowerCase(Trim(GetTextAtEx(19, 412, 0, SmallChars, False, False, 0, 0,
        0, 50, False, tr_allChars)))
        i := Pos(':', name)
        if (i <> 0) then
      begin
        Delete(name, i, i);
        Result := True;
      end;
    end;




    New procedure:
    SCAR Code:
    function LastChatter(var name: string): Boolean;
    var
      i: Integer;
    begin
      name := LowerCase(Trim(GetTextAtEx(19, 412, 0, SmallChars, False, False, 0, 0,
        0, 50, False, tr_allChars)))
        i := Pos(':', name)
        if (i <> 0) then
      begin
        Delete(name, i, i);
        Result := True;
      end;
    end;


    I dont see the difference

  15. #15
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by tarajunky View Post
    Which functions aren't working for you?
    I've tried FindRoadColor and FindDirtRoadColor. I'm fairly sure I had the right dirt road on the minimap, but I might not have. Here's a pic:



    It also doesn't work with FindRoadColor.

    I didn't try the others. I figured Jagex broke the other ones as well.

    Edit:

    Quote Originally Posted by JAD View Post
    FindDirtRoadColor never (at least for me) works. Well, I never tested anywhere except the new varrock road color, but it should work on there right?
    I did do it on the new road. I take it that's why It didn't work, Tara?

  16. #16
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Yes, I think the the new Varrock RoadColor isn't compactible with FindRoadColor.
    And that isn't a proper DirtColor, I think.. You should have a more brown color (like the one above lumbridge swamp).
    Wizzup and Pentti both already made new procedures, though

    @Granti: I edited my first post, that's why they look the same .. But have you tested it again?
    Hup Holland Hup!

  17. #17
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes, there is a new FindVarrockRoadColor function in Autocolor.scar since 3.8 came out. Anytime you are in Varrock you will need to use that one for the gray-ish roads.

    FindDirtRoadColor wasn't designed to get those new varrock dirt paths. It's for the roads between Falador-Barb village-Varrock and between Lumby and the Wiz tower.

  18. #18
    Join Date
    Dec 2006
    Location
    Third rock from the sun.
    Posts
    2,510
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    Ahh, now I know

    Very sorry to bother you!

  19. #19
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What should we use to auto color the Barrock road color then? Because FindVarrockRoadColor just finds the gray road, not the dirt. Is there a function out that would auto color the varrock dirt road then? Or do I need to make one?

  20. #20
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    You can always make your own. Other people have made functions that will detect it, but I'm not sure where to get them.

    I probably would have made one before if I thought it would get used a lot, but I assumed that people would continue using the main roads around Varrock.

  21. #21
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by tarajunky View Post
    You can always make your own. Other people have made functions that will detect it, but I'm not sure where to get them.

    I probably would have made one before if I thought it would get used a lot, but I assumed that people would continue using the main roads around Varrock.
    K I'll probably make my own. I just assumed because your the leetness of autocoloring that you would have made one for SRL 3.8

  22. #22
    Join Date
    Apr 2007
    Posts
    26
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Oh i have being seaching high and low for the right solution for responds, i had tried to change text.scar (lastchatter , and so on) for the responds but just cant work, no responds on L.A.M.E and all other chat. Anyone can advice on how to solve it. BTW can i using FindText function stating the area to seach for 'text'. thanks in advance.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. function problem
    By Richard in forum OSR Help
    Replies: 7
    Last Post: 02-01-2008, 05:53 PM
  2. problem with dropexcept function
    By orion pax in forum OSR Help
    Replies: 1
    Last Post: 10-15-2007, 11:46 PM
  3. Function problem
    By NinjaTerrorist in forum OSR Help
    Replies: 4
    Last Post: 02-16-2007, 11:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •