VivixCore / devobot

Automatically exported from code.google.com/p/devobot
0 stars 0 forks source link

Can't even get them to speak! #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi

Please excuse my ignorance. If I add a line on bot.py, just after it's
found the owner data, (maybe around line 175), I can use "say(client,"bla")".

But anywhere else - in commands.py or events.py, I can't do this, and in
many functions, where the client argument isn't passed. For example, if I
make this function:

@bot.Command()
def sayhello(client, msg, args):
      client.Self.Chat("hi",0,ChatType.Normal) 
      say(client,"hi")

neither of the lines there work. The first doesn't know the constant
ChatType.Normal - Do I need to load something?

Similar for any animations I want to launch, none of the preset ones are
known, so maybe something needs to be included that isn't?

Sorry for being such a noob,

Ale

Original issue reported on code.google.com by sko...@gmail.com on 21 Jul 2009 at 5:07

GoogleCodeExporter commented 9 years ago
WRT your first point - I was able to add a say() inside login after the login 
loop
without any problem. Did you possibly put it inside the loop after the break? 
This
would obviously never run. Also this isn't the ideal location for your own 
code, the
whole idea of devobot is to provide a framework for your events and commands. 
To your
second point - I recently committed a fix where the owner wasn't being 
identified so
since your command isn't public it mightn't have recognized you. Check out the 
latest
version! Also the libomv members are all accessible via the bot module - eg 
bot.ChatType

HTH

Original comment by stephen.mc on 25 Jul 2009 at 10:29