tonyravioli / dongerdong Goto Github PK
View Code? Open in Web Editor NEWヽ༼ຈل͜ຈ༽ノ DongerDong IRC Fight Bot ヽ༼ຈل͜ຈ༽ノ
Home Page: http://www.donger.org
License: GNU General Public License v3.0
ヽ༼ຈل͜ຈ༽ノ DongerDong IRC Fight Bot ヽ༼ຈل͜ຈ༽ノ
Home Page: http://www.donger.org
License: GNU General Public License v3.0
It's time to overcomplicate the game:
We could add some kind of weapon/shield system, assigning a random kit to every player when they !accept
Quoting Mithadon:
1 handed sword goes with shield so you have a chance to block but the sword is weaker than long sword, axe has a bigger variation from lowest to highest dmg dealt
(fights won + fights lost + fights quit) - (fights started + fights accepted)
while dongerdong.irc.connected == True:
time.sleep(1) # Infinite loop of awesomeness
to:
while dongerdong.irc.connected == True:
try:
time.sleep(1) # Infinite loop of awesomeness
except KeyboardInterrupt:
say some witty thing to chan
print "exit due to keyboard interrupt" to stdout
exit with error code 0
Put timestamp in debug output so we can look at the log and see when things happen.
Create functionality for the bot to fight the user, !healing itself and !hitting the other player depending on probabilities. If it loses, bot should kick itself after (if possible) and rejoin automatically.
Restart or reconnect bot if a ping request isn't heard from server after a certain amount of time. Useful for places like my server, where apparently it loses connection every night.
i.e. remove commented code, add comments
Create a !ping feature to allow bot to /ping the requesting user, and have bot output ping result back to user.
<user> !ping
<bot> user: 0.577 seconds
We need to improve the channel tracker regarding nick changes.. Maybe using the nickserv account internally?
Log:
DEBUG:bearded-potato-donger:command: pubmsg, source: ravioli!~ravioli@unaffiliated/ravioli, target: #donger, arguments: ['!stats MRX']
Unhandled exception in thread started by <bound method Donger._pubmsg of <__main__.Donger object at 0x22ee610>>
Traceback (most recent call last):
File "./dongerdong.py", line 374, in _pubmsg
if cli.channels[ev.target.lower()].users[nick.lower()].account != None:
KeyError: 'mrx'
What's up with that "!= None" thing? I don't even know what that line's doing.
Make dong track nicks properly
It shouldn't do this.
I'm thinking...
Betting:
player1>!fight player2
player2>!accept player1
(intro to match)
PLACE BETS NOW
(sleep for 10 seconds while
players /msg dong bets:
/msg dong !bet 20 on player1
dong announces bets as they come in)
FIGHT ascii
(betting closes on first !hit)
if no opposing bets are placed:
cancel bets
else:
calculate percentages of bets placed by multiple people on each player (i.e. on player 1: polsaker 60% of bet, ravioli 20% of bet, otherperson 20% of bet)
use lowest total (so if there's 10 coin on player2 and 50 coin on player1, max payout (total) for all players is 10)
at the end of the fight, payout depending on percentages. so in the above example, if player1 wins, polsaker gets 6 coin, ravioli gets 2, and otherperson gets 2.
In #donger on freenode, User rotta666 and I have been doing deathmatches, and we both recieve instakills. After getting kicked, we were able to rejoin the channel, which i found odd, since it was a deathmatch. Upon closer inspection, it appears as though it is because akick doesn't work on +r (registered) users. However, it still bans just fine on deathmatches with no instakill. If you would like to assign this issue to me I would be more than happy to dig through my fork and find it.
Bounties that don't expire will pile up and become lost coins forever in purgatory and clutter up !wanted.
Time frames could be a few days or a few weeks.
Traceback (most recent call last):
File "./dongerdong.py", line 201, in _pubmsg
self.fight(cli, self.pending[ev.splitd[1]], ev.splitd[1], self.deathmatch)
File "./dongerdong.py", line 697, in fight
self.prefight()
TypeError: fakeprefight() takes exactly 1 argument (0 given)
why isn't it passing self? that's odd
Currently "total fights" stat is calculated by:
fights started + fights accepted
This doesn't work now that there's a !join feature.
I'm at work and can't troubleshoot right this second, but trying to run dongerdong, here's the output:
DEBUG:peewee:('SELECT name FROM sqlite_master WHERE type = ? ORDER BY name;', ('table',))
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
INFO:bearded-potato-donger:Connecting to irc.freenode.net:6667
ERROR:bearded-potato-donger:Couldn't connect to irc.freenode.net:6667: [Errno 111] Connection refused
For instance, a folder called scripts
, with a file like jaden.py. A user calls !jaden
, which isn't a command specified in the main dongerdong.py script, but IS defined in that jaden.py file.
Implement a 1v1(v1)^x mode.
To think:
09:42 ( challenger ) !deathmatch newb
09:42 (@ dong ) newb: challenger has challenged you to a deathmatch. The loser will be bant for 20 minutes. To accept, use '!accept challenger'
09:42 ( me ) wait wait...
09:42 ( me ) hold up
09:42 ( me ) !stats newb
09:42 (@ dong ) There are no registered stats for newb
09:43 ( me ) challenger: just do regular !fight
09:43 ( challenger ) :|
09:43 ( me ) don't wanna kill him on first fight, eh?
09:43 ( challenger ) !fight newb
09:43 (@ dong ) newb: challenger has challenged you. To accept, use '!accept challenger'
09:43 ( challenger ) !stats
09:43 (@ dong ) challenger's stats: 16 wins, 1 easy wins, 16 losses, 0 coward quits, 0 idle-outs, 3 !praises, 21 fights started, accepted 10 fights (31 total
fights), 167 !hits, 80 !heals, 4973HP of damage dealt and 5013 damage received. http://www.donger.org/stats/
09:43 ( newb ) !accept challenger
09:43 dong ª set [+m] in #donger
09:43 (@ dong ) ___ _______ ________ ____ ______ _____________ __
09:43 (@ dong ) / _ \/ __/ _ /_ __/ // / |/ / _ /_ __/ ___/ // /
09:43 (@ dong ) / // / _// __ |/ / / _ / /|_/ / __ |/ / / /__/ _ /
09:43 (@ dong ) /____/___/_/ |_/_/ /_//_/_/ /_/_/ |_/_/ \___/_//_/
It should probably just do nothing when no fight is in progress.
Unhandled exception in thread started by <bound method Donger._pubmsg of <__main__.Donger object at 0x20aac10>>
Traceback (most recent call last):
File "./dongerdong.py", line 208, in _pubmsg
cli.mode(self.channel, "-v " + ev.source)
AttributeError: 'Donger' object has no attribute 'channel'
Add feature to parse CSV located at http://ravio.li/donger/stats.txt. Should:
Implementing this could allow on-the-fly generation of ASCII Art text, as opposed to hard-coding each one: https://github.com/pwaller/pyfiglet
Add configuration option in config.json for accounts which have owner permissions. We can use this to implement/allow special features like !flush to cancel all pending fights, or !cycle to restart the bot, for example.
"Owners" must be identified to services to be recognized.
Improve the bot's fight AI. It's currently too easy to beat the Supreme Dongerdong.
The bot must play fair.
Where the bot lists rules and stuff at the beginning of the fight, he uses a . instead of a blank message because I didn't/don't know how to make it just blank.
You know what I mean.
Allow bot to join two channels:
where functions in fightchannel are what we have now, and functions in anotherchannel include basic bot functions (weather, "botname!", etc.) in a plugin-based setup. For instance, dongerdong can use #donger as fightchannel and #crude as anotherchannel.
Ideally, bot can announce fights that are commencing in fightchannel, by telling anotherchannel. Bot will announce winners and losers at the conclusion of each fight, and the behavior of the bot can be configured by any user with ops in anotherchannel ("botname, stop", "botname, start").
Add verbose mode, enabled by:
!fight --verbose
or
!fight -v
Where verbose mode outputs all math on hits.
DEBUG:bearded-potato-donger::[email protected] PRIVMSG #donger :!accept nope
DEBUG:bearded-potato-donger:command: pubmsg, source: [email protected], target: #donger, arguments: ['!accept nope']
Unhandled exception in thread started by <bound method Donger._pubmsg of <__main__.Donger object at 0x1e1ac10>>
Traceback (most recent call last):
File "./dongerdong.py", line 131, in _pubmsg
cli.channels[self.chan].users[ev.splitd[1]]
KeyError: 'nope'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./dongerdong.py", line 134, in _pubmsg
del self.pending[ev.splitd[1]]
KeyError: 'nope'
DEBUG:bearded-potato-donger:TO SERVER: PRIVMSG #donger :Err... Maybe you meant to say !fight nope? They never challenged you.
DEBUG:bearded-potato-donger:TO SERVER: PRIVMSG #donger :Well... They were cowards... YOU WIN
DEBUG:bearded-potato-donger::ravioli!~ravioli@unaffiliated/ravioli PRIVMSG #donger :wtf
!stats returns There are no registered stats for <user>
when the user isn't in the channel.
When dong bot loses a fight, automatically place a bounty of 10 on whoever made the last hit to it
Bot should !hit when he can't !heal anymore - preferably without telling himself that the chopsticks are all gone.
Cause the maximum heal to be negated by 8(?) hp every time someone uses !heal without using !hit. For instance, if a user just uses !heal for 3 turns in a row, the maximum heal will be 24 HP less than normal. Using !hit once(?) will reset that max heal HP.
Make turns sequenced as opposed to random in the getturn function.
!top currently pulls people who have the most wins. It should order by kill-to-death ratio. Currently, if we had a user with 300 losses and 30 wins, they'd be considered the "top" player.
It should only include people who have participated in more than X fights (5? 10?) to prevent someone who has only 3 fights (2 wins, 1 loss) from dominating the leaderboard.
i.e.:
( ravioli ) dongerdong!
(@dongerdon ) ravioli!
( ravioli ) dongerdong?
(@dongerdon ) ravioli?
( ravioli ) dongerdong.
(@dongerdon ) ravioli.
Raw log
PRIVMSG #donger :!fight rika
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+rika: heidemann has challenged you. To accept, use '!accept heidemann'
>> :rika!rika@trivialand/guesser/rika PRIVMSG #donger :+!accept heidemann
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong MODE #donger +m
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+ __ __ __ __
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+|__)||_/ /\ \ / |__||_ || \|_ |\/| /\ |\ ||\ |
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+| \ || \/--\ \/ . | ||__||__/|__| |/--\| \|| \|
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+RULES:
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+1. Wait your turn. One person at a time.
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+2. Be a dick about it.
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+Use !hit [nick] to strike.
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+Use !heal to heal yourself.
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+Use !praise [nick] to praise to the donger gods (once per game).
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+Use '/msg dong !join' to join a game mid-fight.
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+ _______________ ________
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+ / __/ _/ ___/ // /_ __/
<< PING LAG1430804161043
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+ / _/_/ // (_ / _ / / /
>> :wolfe.freenode.net PONG wolfe.freenode.net :LAG1430804161043
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+/_/ /___/\___/_//_/ /_/
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong MODE #donger +vv rika heidemann
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+It is rika's turn
<< PRIVMSG nickserv :identify rika
>> :NickServ!NickServ@services. NOTICE heidemann :+You have been logged out of filicia.
>> :NickServ!NickServ@services. NOTICE heidemann :+You are now identified for rika.
>> :wolfe.freenode.net 396 heidemann trivialand/guesser/rika :is now your hidden host (set by services.)
>> :ChanServ!ChanServ@services. MODE #donger -v heidemann
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+ _________ _ _____ ___ ___
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+ / ___/ __ \ | /| / / _ | / _ \/ _ \
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+/ /__/ /_/ / |/ |/ / __ |/ , _/ // /
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+\___/\____/|__/|__/_/ |_/_/|_/____/
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+The coward is dead!
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong MODE #donger -m
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong MODE #donger -v rika
<< PRIVMSG #donger :!fight dong
>> :rika!rika@trivialand/guesser/rika PRIVMSG #donger :+!fight dong
>> :dong!~dong@unaffiliated/ravioli/bot/dongerdong PRIVMSG #donger :+YOU WILL SEE
notice lack of reaction on << PRIVMSG #donger :!fight dong
Currently the bot issues one voice/devoice command per user, like this:
dong sets mode +v user1
dong sets mode +v user2
IRC supports this, which is much cleaner:
dong sets mode +vv user1 user2
Allow !hit's to miss on a random basis
!stats doesn't pull anyone's stats anymore :(
!top still does.
...with the credit for the kill being awarded to the person's opponent (or the last person to hit them if it's multi-player). I think that's working now (giving easy wins), but they should be kicked as well (which isn't happening now).
Idles and quits in deathmatches should cause a bant (just like if they lost the normal way), but should also incur a fine of 10 dongcoins (to be given to the victor, along with the normal 10 coins for winning).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.