PDA

View Full Version : pyHoNBot



theli
12-08-2011, 08:56 AM
Since I was asked about my clan chatbot from time to time I rewrote it in a more cleaner fashion in pure python.
It is heavily based on phenny ( https://github.com/sbp/phenny ) thus most plugins written for it should work with minor modification.

https://github.com/theli-ua/pyHoNBot/

There is one hon specific plugin implemented - announces inhouses in clan chat and lists games clanmates play together

I am not providing any support, though I would gladly accept pull requests.

quickstart for windows users:
download and install python version 2.7 ( http://python.org/ )
download latest code: https://github.com/theli-ua/pyHoNBot/zipball/master
unpack honbot
enter its dir
if needed edit honbot.cmd (it assumes python is installed in C:\Python27)
run honbot.cmd
edit settings files ( on windows 7 default location is C:\Users\username\.honbot\default.py )
you need to change login, password, owner

run honbot.cmd
thats it

Yukari
01-05-2012, 04:40 PM
Thanks Theli, I was looking for something just like this

Slut
01-06-2012, 08:38 AM
This is awesome, thanks a lot.

inklin
01-07-2012, 09:27 AM
♥ theli is awesome.

When we talked in summer it all sounded so complicated. This version is just so awesome and easier to contribute :D !

Aiden311
02-25-2012, 03:09 AM
what does this mod do?

AsViolator69
02-25-2012, 12:43 PM
Please have my babies

Abyss69
03-12-2012, 08:58 AM
what exactly does this mod do? can you train against bots?

theli
03-28-2012, 10:26 AM
what exactly does this mod do? can you train against bots?

No, this is a chat bot

GrosFif
04-01-2012, 03:51 PM
This is really great, thanks for sharing! Now to pimp rawrbot... =D

Shaah
04-12-2012, 07:40 PM
Thanks for that bot!
Got it to work, I'm trying some stuff with it now.

RoLanD
06-23-2012, 12:17 PM
wish there was a video explaining how to set this up. Trying to do for TR channel. Awesome work though

e:
http://i45.tinypic.com/1ze8ear.png

Getting this error. Any idea what I'm doing wrong?

picture is too small, basically it gets disconnected. and says "reconnecting in 20 seconds". I downloaded that Phython then downloaded the code, unpakced it and then clicked on honbot cmd. Did not figure out how to change admin info or didnt understand where and how to write its "dir" like you said

If I try to click on honbot\default.py it automatically closes the window without me being able to see anything


If there is a copy of that ICbot, that would be great. Do you provide it?

MrStitch
06-26-2012, 09:59 AM
wish there was a video explaining how to set this up. Trying to do for TR channel. Awesome work though

e:
http://i45.tinypic.com/1ze8ear.png

Getting this error. Any idea what I'm doing wrong?

picture is too small, basically it gets disconnected. and says "reconnecting in 20 seconds". I downloaded that Phython then downloaded the code, unpakced it and then clicked on honbot cmd. Did not figure out how to change admin info or didnt understand where and how to write its "dir" like you said

If I try to click on honbot\default.py it automatically closes the window without me being able to see anything


If there is a copy of that ICbot, that would be great. Do you provide it?

Edit the default.py file :) as soon as you run the bot for the first time it should create the default conf file.

akkiris
06-28-2012, 07:24 PM
It works good, thank you.

RoLanD
06-29-2012, 06:37 AM
Edit the default.py file :) as soon as you run the bot for the first time it should create the default conf file.

I've Python27 on E instead of C, any idea how I can change its direction so I can actually run the honbot cmd? :P

MrStitch
06-29-2012, 11:06 AM
I've Python27 on E instead of C, any idea how I can change its direction so I can actually run the honbot cmd? :P

Edit honbot.cmd and in the line c:\python27\python.exe honbot put e:\python27\python.exe honbot

if theli allows me i would like to update this bot to work more properly as a channel managment. There are few things i have in mind and would like to do :


Channel user_list database with acess level variating from invited,member,captain,moderator and admin.
Channel gamelist based on games hosted by players on the league and match id's if matchmaking using the /whois command.
acess lvl on channel from 0 to 4 and organizing the commands as groups from :

Acess lvl 0 = banned from the league / gets autobanned from the channel.

Acess lvl 1 (registered) :


!stats,!statsmm,!statspub
!info - draw info from a player info can be written by a mod with command setinfo
!rank - draw user rank on the mm,internal and public rank.
!userson - draw the users online that are registered on the league.
!games - draw the games names and info that are oficialy registered with the bot.


Acess lvl 2 registered and captain :

!tempinvite "nick " - Temporary invite a new player to channel allowing him to stay for 1h or a game only. ( couching purposes)
!tempinviteoff " nick "- remove and ban the temporary invited user.

Acess lvl 3 (moderator ) :

!addban "nick " "info " - Add user to the banlist with default info :time and who banned + personal info.
!silence - Silence user.
!unsilence - unsilence user.
!Regame "matchid or gamename "- Register game on the database in order to get the match recorded and ranked.
!unban "nick" - unban a player based on nick and leave an !info on him with time unbanned and by who.


Acess lvl 4 (admin ) :

!say - make the bot say somenthing in channel.
!lvldefault " value " - default lvl required to join channel.
!mmrdefault "value " - default mmr required to join channel.
!moderate " value x " " value y " - silence everybody for x minutes based on y rank ex: !moderate 5 2. this will silence everybody who's acess lvl is below 2.
!join - make the bot join a channel
!exit - make the bot exit a channel
!reconnect - make the bot reconnect.


I'm not very experienced in python i'm more in C but i'll try porting those base commands from C however only if theli allows. Have in mind that doing this alone would require a large amount of work and my time is very short so it could take a while ;p

inklin
06-30-2012, 04:28 PM
if theli allows me i would like to update this bot to work more properly as a channel managment. There are few things i have in mind and would like to do
Those are some nice features. HF with them and this is opensource, so you can contribute as much as you want.



Channel gamelist based on games hosted by players on the league and match id's if matchmaking using the /whois command.
League ? as in Inhouse League type ? or you meant clan?
There is already an IH announcer that works for clan members, based on the notifications it receives (AFAIK), you can modify that.
But if it's for a league like IHL, then bot going /whois all the time, while others do different things to it (.stats, mod options, etc) it will kinda stress it. You can't spam much with the commands due to in game chat spam control, too many messages/lines sent and it disconnects.

MrStitch
07-05-2012, 04:30 AM
Those are some nice features. HF with them and this is opensource, so you can contribute as much as you want.



League ? as in Inhouse League type ? or you meant clan?
There is already an IH announcer that works for clan members, based on the notifications it receives (AFAIK), you can modify that.
But if it's for a league like IHL, then bot going /whois all the time, while others do different things to it (.stats, mod options, etc) it will kinda stress it. You can't spam much with the commands due to in game chat spam control, too many messages/lines sent and it disconnects.

After running a few alterations and a few test i realised that spam control is a bit too high and i cant really do much chat commands however there's a way out :) i can set commands response as queue'd whisper and it will eventualy not get spammed but i rather start a new one in C.

There are several way outs but most of them are not realiable. Either i spam chat server or i spam players both are not allowed so i honestly dont know what to do ;p have to think about somenthing and run few tests.

theli
07-08-2012, 04:02 AM
After running a few alterations and a few test i realised that spam control is a bit too high and i cant really do much chat commands however there's a way out :) i can set commands response as queue'd whisper and it will eventualy not get spammed but i rather start a new one in C.

There are several way outs but most of them are not realiable. Either i spam chat server or i spam players both are not allowed so i honestly dont know what to do ;p have to think about somenthing and run few tests.

Not really sure what you are talking about :-/ . never had any problems with spamming players/server O_O.
also, there is no proper anti-spam plugin in this bot, i never needed it.

MrStitch
07-08-2012, 08:51 AM
Not really sure what you are talking about :-/ . never had any problems with spamming players/server O_O.
also, there is no proper anti-spam plugin in this bot, i never needed it.

I'm talking about hon spam control not the bot one :P and the spamming problem is related to the fact i left the bot on a channel with 250 people and one guy typed .stats in chat... Guess you know what happened next |:

emh
07-08-2012, 02:38 PM
Does honbot require a separate free account xor a subaccount and which?

MrStitch
07-08-2012, 03:50 PM
Does honbot require a separate free account xor a subaccount and which?

Yes it does.

emh
07-10-2012, 11:25 AM
Which?

Aizen`
07-10-2012, 02:08 PM
In case anybody else gets the problem where the bot doesn't respond to admin commands, even if you are the owner, the owner's name has to be in lowercase otherwise it wont respond:> Thanks, Theli!

emh
07-11-2012, 05:33 PM
And the credentials should belong to a separate basic account?

inklin
07-13-2012, 05:20 PM
Separate basic, verified or legacy account :)

Btw, procotol update:
Bot folder\hon\ packets.py -> HON_PROTOCOL_VERSION = 26

theli
07-16-2012, 09:21 AM
Separate basic, verified or legacy account :)

Btw, procotol update:
Bot folder\hon\ packets.py -> HON_PROTOCOL_VERSION = 26

yeah, but i usually update that in repository on a patch day if needed

RoLanD
09-29-2012, 03:40 PM
Ban command is not working with the latest patch for me. it says: "MysQldb is not defined" on the cmd page, and nothing ingame. Any fixes , or something I'm doing wrong?

Ninja101
10-06-2012, 10:08 AM
I'll fix that today.

theli
10-06-2012, 10:12 AM
As i have no time now, Ninja101 is mostly working on bot (mostly for the sake of project epoch's bot but everyone can use the changes of course)
Though i dislike using mysql for banlist tbh >__> overkill imo :P
would be nice if that'd be optional

RoLanD
10-08-2012, 07:52 AM
This is probably one of the best things ever submitted by a user to HoN, thank you for resuming this project.

Ninja101
10-09-2012, 10:42 AM
MySQLdb dependency is gone :)

Should note though that the banlist uses SQLite now. Use the bot command .migrate to move the old bans over.

MattTheHuman
10-23-2012, 12:29 AM
Are those features by MrStitch going to be used, cause some of them were pretty cool

Edit: I've had a few problems with the bot. Hes announcing TMMs and telling people to join. I would also like him to whisper/reply(only they can see) to somneone joining the channel some extra info if thats possible.

Ninja101
10-31-2012, 06:31 PM
Are those features by MrStitch going to be used, cause some of them were pretty cool

Edit: I've had a few problems with the bot. Hes announcing TMMs and telling people to join. I would also like him to whisper/reply(only they can see) to somneone joining the channel some extra info if thats possible.

I'm not quite sure what you mean :c

On another note, added streams module to the bot. Use addstream/delstream to add and remove them from being monitored. When they go live the bot will advertise it in the clan channel + clan message.

MattTheHuman
11-01-2012, 03:56 AM
Damn that stream feature is awesome!
I managed to get the bot to announce when someone joined a TMM and wish them luck, but when they join a public game, it tells people to join up :)
Instead of having the bot whisper people that join the channel, I'm made him reply to .i and he gives some extra info.

theli
11-01-2012, 12:21 PM
Are those features by MrStitch going to be used, cause some of them were pretty cool

Edit: I've had a few problems with the bot. Hes announcing TMMs and telling people to join. I would also like him to whisper/reply(only they can see) to somneone joining the channel some extra info if thats possible.

disable the 'inhouse' plugin

MattTheHuman
11-05-2012, 10:39 PM
has the protocol changed? I can't get my guy to login. I also got the inhouse to work how I wanted it to :D

theli
11-08-2012, 07:22 AM
has the protocol changed? I can't get my guy to login. I also got the inhouse to work how I wanted it to :D
Since when?
it changes from time to time
Best way to keep up is to follow commits on github

MattTheHuman
11-08-2012, 09:16 AM
Awesome thanks, I'm new to github and such, didnt realise what the Commits were. Thanks for the update :D

MattTheHuman
11-16-2012, 09:38 AM
Bump: Protocol changed to 36, sent pull request on github.

colondee
11-16-2012, 07:26 PM
So much work in this. Ill nick some of the code to get the list of currently signed users...some day. Thank you.

Kelomancer
12-08-2012, 02:49 AM
Hi! I downloaded the Bot and I'm having troubles with it. It says errors when I startup it but continues and logs succesful, can't use trivia or ping for example. Is it possible to find any documentation, FAQs or whatever about this bot? I really want to fix the errors and try it out sucessfully. Any help will be appreciated, thanks.

PcDeadZ
12-09-2012, 01:50 PM
v2.6.30 Login success login, pass in md5
now in v2.6.31 login=login but how generate pass?
f=pre_auth&login=pcdeadz&A=BLABLABLA
how generate BLABLABLA etc
New time = new A
it's sha512 or what?
how generate?
Writing standalone chat.

theli
12-12-2012, 09:17 AM
v2.6.30 Login success login, pass in md5
now in v2.6.31 login=login but how generate pass?
f=pre_auth&login=pcdeadz&A=BLABLABLA
how generate BLABLABLA etc
New time = new A
it's sha512 or what?
how generate?
Writing standalone chat.
this is pretty much offtopic to this thread....
anyway, http://en.wikipedia.org/wiki/Secure_Remote_Password_protocol , but you can still use the old authentication scheme if you want

_Arcanine
01-16-2013, 12:08 AM
Guys, im having lots of trouble with this xD if someone that knows how to work this thing and willing to help me, please join the in-game chat channel Clan Sync eSports, much appreciated.

theli
01-16-2013, 04:54 AM
Guys, im having lots of trouble with this xD if someone that knows how to work this thing and willing to help me, please join the in-game chat channel Clan Sync eSports, much appreciated.

could you post your config file (default.py) somewhere on pastebin.com (just replace password with 'passwordhere' one) so that we could see if everything is set up alright

devINVISIBLE
01-18-2013, 10:16 AM
theli,
Just wanted to say thank you for your work on pyHonBot, specifically, saving me the reversing time to find N, g, and the magic behind the real p. I haven't had any experience with SRP before this and would love a personal primer on how the reversing needed to write masterserver.py went.

Cheers,
devINVISIBLE

Also thankful for Tom Cocagne and _pysrp.py

devINVISIBLE
01-20-2013, 12:31 PM
edit settings files ( on windows 7 default location is C:\Documents and Settings\username\.honbot\default.py )

The default windows 7 location is actually C:\Users\<username>\.honbot\default.py

theli
01-21-2013, 04:25 AM
The default windows 7 location is actually C:\Users\<username>\.honbot\default.py
Right, thanks

GrosFif
02-09-2013, 06:53 PM
Apparently clan RawR is coming back (again), so i just got the new version and started playing with it. I'm making a clan ladder module and so far it seems to be working. It's probably ugly and inefficient because i'm 1300 MMR at coding, but if anyone is interested in using it poke me and i'll be happy to share.

EDIT : Ladder module seems to be working pretty well. I however have a question : Are the strings used by the .derp command stored in the bot or server side?

Ninja101
02-13-2013, 06:57 PM
The bot uses strings by downloading the HoN stringtable on startup.

GrosFif
02-13-2013, 09:50 PM
The bot uses strings by downloading the HoN stringtable on startup.

That was my guess, but it just seems weird that the .derp stuff comes from there... Anyways, thanks for answering, as i said i'm 1300mmr when it comes to coding and probably drop to 1100 when it involves any amount of networking.

theli
02-14-2013, 04:04 AM
That was my guess, but it just seems weird that the .derp stuff comes from there... Anyways, thanks for answering, as i said i'm 1300mmr when it comes to coding and probably drop to 1100 when it involves any amount of networking.

thats just a random "flavour" text from hon heroes skills. added without any reason, jff.

ZateFeto
02-17-2013, 02:38 AM
theli, I'll have to thank you for your impressive work, But seems like i can't find any guide for the commands or full command list for the bot and i'd really like to know how does it work else from whispering the bot ingame with .commands

Zate.

Ninja101
02-17-2013, 06:35 PM
You can use .doc <function> to get an explanation of each command if one is set.

theli
02-18-2013, 03:42 AM
You can use .doc <function> to get an explanation of each command if one is set.

Yeah, also, there is no list of implemented function :-/
You can also just browse modules/*.py and see there

ZateFeto
02-19-2013, 03:26 PM
Thanks for the answers, I tried the .doc and a couple of other commands.
But i was talking more about modules like .fixmm - topic "edit" not "set" - save word like TS so when i type .ts it types the server address which i specified.

ZateFeto
02-27-2013, 07:51 AM
Well, Atleast provide us with any kind of text help / video tutorial / instructions .. or even how to code new mods/plugins ..
there are alot of mods/plugins not enabled/working .. how to fix this?

BulletOfDoom
02-27-2013, 08:49 AM
I was trying to configure bad words for bot :
!config badwords [word] . Bot then replied OK
What am I doing wrong?

Ninja101
02-27-2013, 12:55 PM
Use .addword and .delword to alter the list.

ZateFeto
02-28-2013, 09:57 PM
bot keeps silencing clan members for 5 mins, any ideas?

ThePanthera
03-13-2013, 02:45 PM
for the past few hours, i've been trying to write a timer code which allows the chatbox to broadcast a message, every 15 minutes, everything i've tried has failed basically
so if anyone can write it for me or something like that or explain me something, i would greatly appriciate it.

i would greatly appriciate some code with an explanation.

theli
03-14-2013, 04:32 PM
for the past few hours, i've been trying to write a timer code which allows the chatbox to broadcast a message, every 15 minutes, everything i've tried has failed basically
so if anyone can write it for me or something like that or explain me something, i would greatly appriciate it.

i would greatly appriciate some code with an explanation.
try this module, should be self explanatory
http://pastebin.com/59G7eMZv

ThePanthera
03-15-2013, 02:48 PM
try this module, should be self explanatory
http://pastebin.com/59G7eMZv

Thank you, i really appriciate it.

RoLanD
04-20-2013, 12:01 PM
nvm )


Thx again for this bot <3

KennosiS
04-30-2013, 10:03 AM
Is there any way to make it rejoin a channel when he is alone and hasnt admin privileges?

Thanks