Sen descrición http://bits.zero9f9.com/pybot
Matt Weller 404d77b957 Merge branch 'master' into time_event | %!s(int64=10) %!d(string=hai) anos | |
---|---|---|
docs | %!s(int64=10) %!d(string=hai) anos | |
modules | %!s(int64=10) %!d(string=hai) anos | |
tests | %!s(int64=10) %!d(string=hai) anos | |
.gitignore | %!s(int64=10) %!d(string=hai) anos | |
.travis.yml | %!s(int64=10) %!d(string=hai) anos | |
CHANGES | %!s(int64=10) %!d(string=hai) anos | |
Makefile | %!s(int64=10) %!d(string=hai) anos | |
README.md | %!s(int64=10) %!d(string=hai) anos | |
Vagrantfile | %!s(int64=10) %!d(string=hai) anos | |
bootstrap.sh | %!s(int64=10) %!d(string=hai) anos | |
bot.py | %!s(int64=10) %!d(string=hai) anos | |
botbrain.py | %!s(int64=10) %!d(string=hai) anos | |
conf.py | %!s(int64=10) %!d(string=hai) anos | |
conferror.py | %!s(int64=11) %!d(string=hai) anos | |
confman.py | %!s(int64=10) %!d(string=hai) anos | |
db.py | %!s(int64=10) %!d(string=hai) anos | |
event.py | %!s(int64=10) %!d(string=hai) anos | |
index.rst | %!s(int64=10) %!d(string=hai) anos | |
logger.py | %!s(int64=10) %!d(string=hai) anos | |
mysql_dump | %!s(int64=10) %!d(string=hai) anos | |
pybotrc | %!s(int64=10) %!d(string=hai) anos | |
requirements.txt | %!s(int64=10) %!d(string=hai) anos | |
setup.sh | %!s(int64=10) %!d(string=hai) anos | |
stats.py | %!s(int64=11) %!d(string=hai) anos | |
util.py | %!s(int64=10) %!d(string=hai) anos | |
version.py | %!s(int64=10) %!d(string=hai) anos | |
webwriter.py | %!s(int64=10) %!d(string=hai) anos |
he is modular, extensible, multi-threaded, and configurable.
pybot runs on python 2.6 and 2.7 (though steamapi does not work with 2.6, the core bot does). python versions > 3 are in the works.
sudo ./bootstrap.sh
to install pybot dependencies such as mysql../setup.sh
. It will check for module dependencies and create a mysql_init file../bot.py pybotrc
rejoice.
for debugging purposes, ./bot.py -d.
If you have Vagrant locally installed and configured, you can set up pybot by invoking
vagrant up
. Your development environment will be configured, and you can skip step 1 and
2 above. After that, SSH into your VM and do steps 3 through 5 to finish things off.
pybot requires mysqldb. It's probably in your package manager. It will run without it, it'll just throw lots of exceptions. SQLite integration and no-db (pickle) support are in the works.
Run ./bootstrap.sh
and wait for your system to be configured. Mysql will be installed with a
default password of 'root', which you'll definitely want to change.
Run ./setup.sh
and follow the prompts. It will create a mysql_init file, which you can then
run against mysql with mysql -p < mysql_init
. This will create your database and add a user
with full privileges on that database. Your bot will run as this user.
Put that information into the pybotrc.
If you do not run ./setup.sh
you will have to perform the step below.
Add a mysql user for pybot with permissions to update, insert, and delete from the created tables.
Logged into mysql: grant all on <dbname>.* to '<username>' identified by '<password>';
Run the included mysql_dump file (as root, mysql -p <pybot's database name> < mysql_dump
).
Set his dbpass in the config file (pybotrc) to the password you've given him.
Copy that config file to the home folder of whatever user will be running the bot. (~user/.pybotrc)
As that user, ./bot.py.
Here pybot is connected to two networks at once. They are held entirely separately. Modules loaded on one are independent of modules loaded on another. If one server goes down, the other connections to other networks are unaffected.
This project uses smiley's steamapi for its steam integration, and PRAW (python reddit API wrapper) for the redditinfo module.