Finite State Machine implementation for a bot ?

29 views
Skip to first unread message

xavier

unread,
Dec 8, 2009, 2:07:10 AM12/8/09
to jaxl
Hi,

Has one of you already implemented a FSM to power the bot ?

I'd like to develop a vocabulary of command that is likely to end up
context specific (ie. "show" won't mean the same thing if you are in a
specific context because you ran a specific command(s) before than as
the first command).


Not sure the FSM is the best approach, but I fear the code is going to
go out of control quickly after a handful of commands ;)

On a somehow related topic, the mysql connection seems to drop after a
few hours of activity. Not sure if it's the session that goes missing,
the mysql connection, a ghost in the machine... Any suggestion more
than welcome.

Finally, what's the ETA for the chat ? looks nice !

X+

imoracle

unread,
Dec 24, 2009, 4:29:43 AM12/24/09
to jaxl
Hi,

Interesting thing that you are looking for. I am not sure if it comes
under FSM, but yeah something similar is under development (no
guarantee on when will it be released).

Idea is to have a few command line options, e.g.
php jaxl.php command1 arg1 arg2 .....

and the bot will be able to do a lot more things.
The commands can also be sent through IM chat messages.

If you or other developers are interesting in such a thing, let me
know if you guys can do some brainstorming on it over chat.

MySQL connection, well yes if bot is idle the connection will soon die
out.
Need a better MySQL manager which shd be simple to write.
Instead of one connection hanging for entire lifetime of the bot you
can use different connections depending upon ur need.
ga...@gtalkbots.com uses some tricks to identify when to use a
persistent connection available and when to reopen a new connection to
the database.

Browser chat client is a long pending task. I can't guarantee a date
for the same but 2010 should bring some good news on this :D

Merry Christmas and Happy new year.
Regards,
Abhinav

Abhinav Singh

unread,
Aug 5, 2012, 2:18:16 AM8/5/12
to ja...@googlegroups.com
Hi Xavier,

As we discussed way back, yes FSM is the right approach to get this kind of stuff going.
Fortunately Jaxl v3.x now have an abstract implementation of state machines inside JAXLFsm.

Both XMPPStream and HTTPRequest objects are now a state machine using JAXLFsm.
Kindly checkout the docs here: http://jaxl.readthedocs.org/en/latest/index.html to see if this helps.
Check register_user.php example to see how external application can extend base XMPPStream FSM states.

PS: Late, but this will be useful for incoming v3.x users to this thread.

--
Abhinav
Reply all
Reply to author
Forward
0 new messages