Results 1 to 8 of 8

Thread: Responding

  1. #1
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Responding

    Well, i've created a function to grab the chat lines and it works. Here's an Example:
    SCAR Code:
    1:
    2: Where wheres.. Mah mah.. Cupcakkkkkkkke!!!
    3: Ibis.
    4: Lucky
    5: Hey guitar
    6: Wasup
    7: Can i borrow dfs
    8: ?

    here's the function:
    SCAR Code:
    function SaveChatText: string;
    var
    C : integer;
    ChatRoom : string;
    begin
      C := 1;
      repeat
       ChatRoom := GetChatBoxText(C,clChat);
       Result := ChatRoom;
       Writeln(IntToStr(C)+': '+ChatRoom);
       C := C + 1;
      until(C > 8)
    end;

    I got the hard part done. But now i'm confused on how to get scar to get that text and do a check to see if it says certain words. And if it does, to respond to them. Can anyone help me?

    ~Des
    Last edited by DeSnob; 05-18-2009 at 03:56 AM.

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    There is a function in SRL for this sorry
    EDIT: its this: InChat
    Thinking about it though, this could be a bit more useful

    T~M

  3. #3
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    instrarr will help with that

  4. #4
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by The Man View Post
    There is a function in SRL for this sorry

    t~M
    That never worked for me, so i created this

    @Morm : Explain further please? I have no idea what it is, and i searched it up and found no results

    Edit: Found a tut, but i got a bit confused about what it does/how to use it.

    ~Des
    Last edited by DeSnob; 05-18-2009 at 03:59 AM.

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    I edited my post

    T~M

  6. #6
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DeSnob View Post
    Well, i've created a function to grab the chat lines and it works. Here's an Example:
    SCAR Code:
    1:
    2: Where wheres.. Mah mah.. Cupcakkkkkkkke!!!
    3: Ibis.
    4: Lucky
    5: Hey guitar
    6: Wasup
    7: Can i borrow dfs
    8: ?

    here's the function:
    SCAR Code:
    function SaveChatText: string;
    var
    C : integer;
    ChatRoom : string;
    begin
      C := 1;
      repeat
       ChatRoom := GetChatBoxText(C,clChat);
       Result := ChatRoom;
       Writeln(IntToStr(C)+': '+ChatRoom);
       C := C + 1;
      until(C > 8)
    end;

    I got the hard part done. But now i'm confused on how to get scar to get that text and do a check to see if it says certain words. And if it does, to respond to them. Can anyone help me?
    I might be wrong but it looks like that it will return the last sentence.
    ~Hermen

  7. #7
    Join Date
    Mar 2008
    Location
    Look behind you.
    Posts
    795
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Hermen View Post
    I might be wrong but it looks like that it will return the last sentence.
    Good point. Brb, I'll try to do something using arrays.

    Edit:
    [random]It's alliveee...It's ALIVE!!![/random]

    Thanks Hermen, that was the problem! +1
    Last edited by DeSnob; 05-18-2009 at 04:14 AM.

  8. #8
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You can of course use the scar/pascal function "pos".

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
  •