Results 1 to 7 of 7

Thread: stuck in a function

  1. #1
    Join Date
    Jan 2007
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default stuck in a function

    hi i was trying to create a function which would find blue text in chat box but i can't im stuck on that!

    i did something like this but im stuck:

    SCAR Code:
    function FindCText(txt: string): Boolean;
    var
    u: Integer;
    begin
      u := CreateBitmapMaskFromText(txt, SmallChars, 16711680); // 16711680 would be the blue color of the txt
        Result := FindBitmapMaskTolerance(u, x, y, 32, 442, 496, 459, 30);
          FreeBitmap(u);
    end;

    help me some1
    macromacro123's
    Varrock Yew Cutter[s]
    *********************
    Worked: 28 Hours, 23 Minutes and 46 Seconds.
    Banked: 78 Loads.
    Chopped: 2106 Yew logs.
    NextPlayer
    ERROR. RuneScape has been updated. Script Terminated.Successfully executed
    *********************
    Worked: 26 Hours, 53 Minutes and 33 Seconds.
    Banked: 92 Load[s]
    Chopped: 2484 Yew log[s]

    hehejagex...what you're going to do about it?it

  2. #2
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    function FindCText(txt: string): Boolean;
    var
      x, y, u: Integer;
    begin
      u := CreateBitmapFromText(txt, SmallChars, 16711680); // 16711680 would be the blue color of the txt
      Result := FindBitmapToleranceIn(u, x, y, 32, 442, 496, 459, 30);
      FreeBitmap(u);
    end;
    That work?

  3. #3
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    function FindCText(txt: string): Boolean;
    var
      x, y, u: Integer;
    begin
      Result := IsTextInAreaEx(32, 442, 496, 459, x, y, txt, 15, SmallChars, false, false, 0, 2, 16711680);
    end;

    try that. maybe you have the wrong chars?

    Join the fastest growing merchanting clan on the the net!

  4. #4
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    idk maybe something like this?

    SCAR Code:
    Function FindCText(txt: string): Boolean;
    var
      ChatMessage : string;
    begin
      if GetLastChatText(ChatMessage) then
        Result := (ChatMessage = LowerCase(Trim(txt)));
    end;

  5. #5
    Join Date
    Jan 2007
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ty peep
    macromacro123's
    Varrock Yew Cutter[s]
    *********************
    Worked: 28 Hours, 23 Minutes and 46 Seconds.
    Banked: 78 Loads.
    Chopped: 2106 Yew logs.
    NextPlayer
    ERROR. RuneScape has been updated. Script Terminated.Successfully executed
    *********************
    Worked: 26 Hours, 53 Minutes and 33 Seconds.
    Banked: 92 Load[s]
    Chopped: 2484 Yew log[s]

    hehejagex...what you're going to do about it?it

  6. #6
    Join Date
    Jan 2007
    Posts
    268
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    man... i tryed ur procedures and lagged too much!! here is what i did, inspired by charmz

    SCAR Code:
    function FindCText(txt: string): Boolean;
    var
      Chat: string;
    begin
      if IsTextInAreaEx(40, 415, 130, 415, x, y, ':', 0, SmallChars, False, True, 0, 0, 0) then
        begin
        Chat := Lowercase(Trim(GetTextAtEx(x + 8, 415, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, tr_AllChars)));
          if Pos(txt, Chat) <> 0 then
            begin
              Result := True;
            end;
        end;
    end;

    thing is it finds text in like 3 line in the chat box? what do i need to change to get it to find it in first line when just up to username?
    macromacro123's
    Varrock Yew Cutter[s]
    *********************
    Worked: 28 Hours, 23 Minutes and 46 Seconds.
    Banked: 78 Loads.
    Chopped: 2106 Yew logs.
    NextPlayer
    ERROR. RuneScape has been updated. Script Terminated.Successfully executed
    *********************
    Worked: 26 Hours, 53 Minutes and 33 Seconds.
    Banked: 92 Load[s]
    Chopped: 2484 Yew log[s]

    hehejagex...what you're going to do about it?it

  7. #7
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    like this?

    SCAR Code:
    function FindCText(txt: string): Boolean;
    var
      Chat: string;
      Points : TPoint;
    begin
      Points := TextCoords(8); //will give the coords of the last chat line - (changing 8 to 1 would return the first line's coords)
      if IsTextInAreaEx(Points.x - 2, Points.y - 2, Points.x + 30, Points.y + 14, x, y, ':', 0, SmallChars, False, True, 0, 0, 0) then
        begin
          Chat := Lowercase(Trim(GetTextAtEx(Points.x - 2, Points.y - 2, 0, SmallChars, False, False, 0, 1, 16711680, 40, False, tr_AllChars)));
          if Pos(txt, Chat) <> 0 then Result := True;
        end;
    end;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. any 1 teach me how to use im stuck!
    By swiftskater1 in forum OSR Help
    Replies: 8
    Last Post: 07-03-2007, 03:06 PM
  2. Stuck
    By RS Rebel in forum OSR Help
    Replies: 9
    Last Post: 07-03-2007, 09:27 AM

Posting Permissions

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