Thread

Constructing Bots (Sdk)

Constructing Bots // Sdk

1  |  

fungus

Jan 23, 1999, 2:13pm
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body text="#000000" bgcolor="#C0C0C0" link="#993366" vlink="#CC66CC" alink="#990000">
<i>&nbsp;&nbsp;&nbsp; okay, okay.... now I have BC++ compiling properly
you have to contend with a few questions about programming too!</i><i></i>
<p><i>How would you recommend I construct the body of a chat-analysing
piece of code?</i><i></i>
<p><i>should I use something like strcmp( ) and a whole load of if loops
to sort through the responses, or is there a version of switch( ) that
will parse long chunks or characters?</i><i></i>
<p><i>Again, apologies for my microscopic (but hopefully growning) understanding
of C</i>
</body>
</html>

edward sumerfield

Jan 25, 1999, 3:31am
--------------A3F96EC68620126CD08CD47D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Its hard to say without knowing what you want to achieve with you bot but I
can say a few things.

No there is no fancy switch statement. C only supports switch on integral
values.

Take a look at the function strstr() which searches one string for another one
so you might have

char message[256];
char *where_is;
strcpy(message, "Hello this is a message");
where_is = strstr("is", message);
if (where_is) {

printf("Found string '%s'.\n", where_is);
}

What do you want to do with you chat analyser?

[View Quote] > okay, okay.... now I have BC++ compiling properly you have to contend
> with a few questions about programming too!
>
> How would you recommend I construct the body of a chat-analysing piece of
> code?
>
> should I use something like strcmp( ) and a whole load of if loops to sort
> through the responses, or is there a version of switch( ) that will parse
> long chunks or characters?
>
> Again, apologies for my microscopic (but hopefully growning) understanding
> of C

--------------A3F96EC68620126CD08CD47D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body text="#000000" bgcolor="#C0C0C0" link="#993366" vlink="#CC66CC" alink="#990000">
Its hard to say without knowing what you want to achieve with you bot but
I can say a few things.
<p>No there is no fancy switch statement. C only supports switch on integral
values.
<p>Take a look at the function strstr() which searches one string for another
one so you might have
<p>&nbsp;&nbsp;&nbsp; char message[256];
<br>&nbsp;&nbsp;&nbsp; char *where_is;
<br>&nbsp;&nbsp;&nbsp; strcpy(message, "Hello this is a message");
<br>&nbsp;&nbsp;&nbsp; where_is = strstr("is", message);
<br>&nbsp;&nbsp;&nbsp; if (where_is) {
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf("Found string '%s'.\n",
where_is);
<br>&nbsp;&nbsp;&nbsp; }
<p>What do you want to do with you chat analyser?
[View Quote] </body>
</html>

--------------A3F96EC68620126CD08CD47D--

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn