.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > POD-Bot mm > Common Questions
Common Questions Are you seeking help ? Get it here !

Reply
 
Thread Tools
Question about bot chatting
Old
  (#1)
person135
Member
 
Status: Offline
Posts: 259
Join Date: Sep 2006
Default Question about bot chatting - 14-06-2008

Hey KWo!
It's been a long time since I came here.

I have a question on how your bots detect keywords in their chats. I am referring to the source code. Also, can you tell me how you detect which player said what.

can you give me the c++ code for this or tell me how to do this?

Thanks


  
Reply With Quote
Re: Question about bot chatting
Old
  (#2)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: Question about bot chatting - 14-06-2008

The podbot mm sources are here.

In the file bot_client.cpp there is a function BotClient_CS_SayText. It intercepts who (ucEntIndex) and what (pBot->SaytextBuffer.szSayText) is saying and puts it to the buffer, then answer with some delay (pBot->SaytextBuffer.fTimeNextChat) after recognizing the keywords in the function BotCheckKeywords in the file bot_chat.cpp. In that file there is a function called BotPrepareChatMessage, which You should take a look at, too. In the BotCreate function in the file bot.cpp there are also such line:
Code:
   // Assign how talkative this Bot will be
   pBot->SaytextBuffer.fChatDelay = RANDOM_FLOAT (4.0, 10.0);
   pBot->SaytextBuffer.cChatProbability = RANDOM_LONG (40, 100); // KWo - 31.03.2006
The first parameter says how often the bot will be talk (how many seconds between 2 chats from the same bot), the second one is also checking the probability the bot wants to talk after that delay. I hope You have got the full answer.
  
Reply With Quote
Re: Question about bot chatting
Old
  (#3)
person135
Member
 
Status: Offline
Posts: 259
Join Date: Sep 2006
Default Re: Question about bot chatting - 15-06-2008

what is the void *p? I see that ucEntIndex = *(unsigned char *) p;

I don't understand what you did very well.

Can you explain it to me in C++ how it intercepts who is talking and what he is saying? do you need to hook saymsg or textmsg? What is the hlsdk thing for intercepting chat messages?


  
Reply With Quote
Re: Question about bot chatting
Old
  (#4)
KWo
Developer of PODBot mm
 
KWo's Avatar
 
Status: Offline
Posts: 3,425
Join Date: Apr 2004
Default Re: Question about bot chatting - 15-06-2008

Quote:
Originally Posted by person135 View Post
what is the void *p? I see that ucEntIndex = *(unsigned char *) p;
It's a pointer to the data without any fixed format (can be int, can be float, can be char, can be whatever - depanding on the assignement).

Quote:
Originally Posted by person135 View Post
I don't understand what you did very well.
It wasn't me - it was Count Floyd in 99% of code... Then take a C++ book and learn it. I'm not going to be Your teacher... I just don't have time for that.

Text/say message? Find in engine.cpp the call for BotClient_CS_SayText - then You will see what kind of message it is...

BTW - why exactly do You need to know that bot chating function? Is there something You want to fix (not working correctly)? Or You are trying to make Your own bot?
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com