Want to make a chatbot

Questions or HOWTOs about the above? Post 'em here...
Post Reply
mz007
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 16, 2008 3:49 pm

Want to make a chatbot

Post by mz007 »

Hi.
I want to make a chatbot for chat-translation.
-------------
1) Chatbot (external program) connects as player "BzfTranslate".
2) Player A sends a PM "register german" to "BzfTranslate"
3) Player B sends a PM "register french" to "BzfTranslate"
4) Any player sends "Hello" as chat-message.
5) Player A gets a PM "A sagt: Hallo" from "BzfTranslate"
--- and so on ---
any player has to register ONCE until he or the bot reconnect.
the bot doesnt shoot, etc, he is Observer and only listens to chat, translates it and sends it to the ones who sent them their register-messages.

a standalone program, NOT a plugin.

how do i make such a bot? can i modify the bzadmin? if i had a simple program wich listens to messages and sends any answer, i could make the bot from that.
is there any example program? pls dont say "look at the bzflag souce"
User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1403
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom

Post by Spazzy McGee »

I could be done without joining a new player to the server. A server side plugin can change chat messages, for example the Planet MoFo april fools joke changed incoming swear words to funny alternatives. It would probably be better to do it with a plugin.

I guess you could do a similar thing with translation, though I guess you'd want to send chat messages to some sort of online translation service, because you wouldn't want to store a whole translation dictionary, especially several languages. It would probably be laggy.
Last edited by Spazzy McGee on Fri Apr 04, 2008 4:16 pm, edited 1 time in total.
"Life is what happens to you while you're busy making other plans." - John Lennon
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post by F687/s »

> how do i make such a bot? can i modify the bzadmin?

BZAdmin is just, well, a BZAdmin. It is not scriptable, it does not do plugins, and it's message handling is rudimentary. It is possible to wrap BZAdmin in a script (which I did), but that is not a good solution. However, there is quite a bit of documentation for plug-ins and the BZFS API
mz007
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 16, 2008 3:49 pm

Post by mz007 »

Spazzy McGee: i dont want a plugin, i want a standalone program which can connect to every server (but only once per server). I could store a dictionary, but i wanted to use babelfish.

F687/s: I dont want to script something, i want to write a program. (u know C++? :-P ), i also dont want a plugin.


is ther any library for the bzf protocol?
i 'd like to use it if there is one.
i would really like if there was an example program which sends/recieves message so it would be easier.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5195
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Post by JeffM »

there is no library for the bzflag protocol. The best place for you to start would be with modifying a copy of bzadmin, as it is the closest thing we have to a headless client. We have no networking examples that do what you need.

Please also note that the protocol is changing for 3.0

Please note that this will take up a player slot and show up in the player list if you do it this way, and not all servers will want or allow your bot. These are the reasons people are suggesting a plug in. Optimally you could write the code to be able to be run as ether a bot or a plug in, depending on the server owner's wishes.
ImageJeffM
User avatar
blast
General
General
Posts: 4804
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

A plugin would be easier to port to new versions, since it wouldn't be directly tied to protocol.

Another option if you still want some part of it to be standalone would be to write a daemon that would take requests from a basic plugin, and that daemon would do the requests to babelfish and return a message to the plugin.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5195
Joined: Fri Dec 13, 2002 4:11 am
Location: https://github.com/OmniTanks
Contact:

Post by JeffM »

Plug-ins also have full access to the internet using the URLManager, so it can do the lookups directly.
ImageJeffM
mz007
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 16, 2008 3:49 pm

Post by mz007 »

so is there any example for a plugin then? i dont like plugins, because I cant compile them! i go to the source directory of the bzf plugins, write make&&make install and i get .la and .a files instead of .so files!
but if i could compile them, i would also make a plugin.
User avatar
blast
General
General
Posts: 4804
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

mz007 wrote:so is there any example for a plugin then? i dont like plugins, because I cant compile them! i go to the source directory of the bzf plugins, write make&&make install and i get .la and .a files instead of .so files!
but if i could compile them, i would also make a plugin.
If you're building 2.0.x, you have to add --enable-shared to your ./configure command. You also need libtool installed.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
mz007
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 16, 2008 3:49 pm

Post by mz007 »

thanks
mz007
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 16, 2008 3:49 pm

Post by mz007 »

doesnt work. still get la and a files
die another day.
User avatar
Mucho Maas
Private First Class
Private First Class
Posts: 515
Joined: Tue Sep 21, 2004 5:14 pm

Post by Mucho Maas »

Personally, I think the way people type in games (i.e. hasty and full of abbreviations and spelling errors) I doubt you will get good results from a translation program.
The results will most times be incomprehensible.

But I guess its a good practice to try it.
"meet the new fo0 , same as the old f0o ... no no no .. don't get fo0'ed again ... " - The Who
mz007
Private First Class
Private First Class
Posts: 8
Joined: Sat Feb 16, 2008 3:49 pm

Post by mz007 »

i never get so files from the make program.
but i need so files. not the .a files i get.
die another day.
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

mz007 wrote:i never get so files from the make program.
but i need so files. not the .a files i get.
In my experience you have to use --enable-plugins and --enable-shared. Your mileage may vary.

As for translation... automated translation is already very poor (have fun with just simple phrases with Google's translator), it usually never makes sense. Combine that with misspelling and it will be a mess. Good intentions, though.
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
User avatar
blast
General
General
Posts: 4804
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Post by blast »

Make sure you have libtool installed if the plugins aren't building.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
Post Reply