Results 1 to 4 of 4

Thread: More ChatCode of mine

  1. #1
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default More ChatCode of mine

    Hey, I had a few simple ideas, the functions aren't nothing special, but maybe they help someone get along with the chat box.

    Enjoy, open to all comments and suggestions/ improvements...

    SCAR Code:
    Type
      ChatLine = Record
      Name, Text: String;
    End;

    Function ChatBox: Array of ChatLine;
    Var
      X, Y, I: Integer;
    Begin

      SetArrayLength(Result, 8);
     
      X := 10;
     
      For I := 0 To 7 Do
      Begin
     
        Y := 345 + I * 14;
       
        Result[i].Name := Replace(GetTextAtEx(x, y, 5, SmallChars, False, False, 0, 0,
          0, 50, False, tr_allChars), ':', '');
         
        Result[i].Text := GetTextAtEx(82, y, 5, SmallChars, False, False, 0, 0,
          16711680, 50, False, tr_allChars);
         
      End;
    End;

    Function LineOfName(TheName: String): Integer;
    Var
      Txts: Array of ChatLine;
      I: Integer;
    Begin
      Txts := ChatBox;
      For I := 0 To 7 Do
      Begin
        If Txts[i].Name = TheName Then
        Begin
          Result := i + 1;
          Break;
        End;
      End;
    End;

    Function LineOfText(TheText: String): Integer;
    Var
      Txts: Array of ChatLine;
      I: Integer;
    Begin
      Txts := ChatBox;
      For I := 0 To 7 Do
      Begin
        If Txts[i].Text = TheText Then
        Begin
          Result := i + 1;
          Break;
        End;
      End;
    End;

    Function NameOfChatter(TheText: String): String;
    Var
      Txts: Array of ChatLine;
      I: Integer;
    Begin
      Txts := ChatBox;
      For I := 0 To 7 Do
      Begin
        If Pos(TheText, Txts[i].Text) > 0 Then
        Begin
          Result := Txts[i].Name;
          Break;
        End;
      End;
    End;

    Procedure RespondTo(Txt, By: String; Mark: Char; UseName: Boolean);
    Var
      Txts: Array of ChatLine;
      I, X: Integer;
      S, F: String;
    Begin
      Txts := ChatBox;
      For I := 0 To 7 Do
      Begin
        If Pos(Txt, Txts[i].Text) > 0 Then
        Begin
          If UseName Then
            S := NameOfChatter(Txt);
          If Not Mark = '' Then
          Begin
            For X := 0 To Random(4) Do
              F := F + Mark;
          End;
          TypeSend(S+', '+By+F);
        End;
      End;
    End;

    The functions should be pretty self-explanatory if you know any scar, oh right, you do, this is the members section

    Anyhow, if something is bugging you feel free to ask...

  2. #2
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    I hear echo! Is the forum lagging for you to?

    Delete your other thread .

    EDIT: What happens if you get a runescape message, e.g. : "You attempt to catch a fish.".. It would return that text as the name?
    Verrekte Koekwous

  3. #3
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Hmm gotta do a thing like If Pos(':', Texts[i].Name) = 0 Then Continue;

    Thx lol, I wouldn't notice there came two threads.

    Yes, the forums do lagg.

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

    Default

    Don't you mean

    SCAR Code:
    If (Pos(':', Texts[i].Name) <> 0) then continue;

    Edit: I'm an idiot.

    Join the fastest growing merchanting clan on the the net!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. First Script of Mine
    By Dargon in forum First Scripts
    Replies: 6
    Last Post: 09-10-2007, 03:31 PM
  2. rate mine please
    By logical guy711 in forum Semi Stupid Pictures
    Replies: 2
    Last Post: 06-06-2007, 04:26 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
  •