Update READMEs for PluginDownloader info

This commit is contained in:
oddluck 2020-02-24 20:21:56 +00:00
parent ee0cce95ef
commit 15198a5636
41 changed files with 157 additions and 143 deletions

View File

@ -1,5 +1,5 @@
Access various Microsoft Azure APIs (translate, search, etc.).
## Azure Plugin ## Azure Plugin
This plugin connects to various Microsoft Azure APIs.
`config plugins.azure.translate.key` Set your key for the text translation API `config plugins.azure.translate.key` Set your key for the text translation API

View File

@ -1,3 +1,3 @@
This plugin ensures that the bot won't say or (optionally) respond to any words This plugin ensures that the bot won't say or (optionally) respond to any words
the bot owner finds offensive. As an additional capability, it can (optionally) the bot owner finds offensive. As an additional capability, it can (optionally)
kick users who use such words from channels that have that capability enabled. kick users who use such words from channels that have that capability enabled.

View File

@ -1,4 +1,9 @@
Use the Bot Libre API (Free) https://www.botlibre.com/api.jsp Retrieve responses from the Bot Libre API.
## BotLibre
Register for an account: https://www.botlibre.com/api.jsp (FREE)
``` ```
config plugins.BotLibre.application (YOUR_APP_KEY_HERE) config plugins.BotLibre.application (YOUR_APP_KEY_HERE)
config plugins.BotLibre.instance (BOT_INSTANCE_ID_HERE) config plugins.BotLibre.instance (BOT_INSTANCE_ID_HERE)

View File

@ -1,6 +1,6 @@
Forked from: https://github.com/butterscotchstallion/limnoria-plugins/tree/master/Cayenne Displays cat facts or cat gifs.
Displays cat facts or cat gifs based on probability Forked from: https://github.com/butterscotchstallion/limnoria-plugins/tree/master/Cayenne
python3 compatible<br> python3 compatible<br>
uses https://catfact.ninja/ as cat facts source<br> uses https://catfact.ninja/ as cat facts source<br>

View File

@ -1,9 +1,11 @@
Generate markov responses using the Cobe library.
Forked from https://github.com/waratte/supybot/tree/master/Cobe Forked from https://github.com/waratte/supybot/tree/master/Cobe
Cobe Cobe
=============== ===============
This is a plugin for Limnoria that allows your bot to use [Cobe](https://github.com/HubbeKing/cobe) This is a plugin for Limnoria that allows your bot to use [Cobe](https://github.com/oddluck/cobe)
A description of cobe: http://teichman.org/blog/2011/02/cobe.html A description of cobe: http://teichman.org/blog/2011/02/cobe.html

View File

@ -1,3 +1,5 @@
Dice rolling plugin with many options.
Forked from https://github.com/wRAR/supybot-plugin-Dicebot Forked from https://github.com/wRAR/supybot-plugin-Dicebot
Install dependencies: python3 -m pip install -r requirements.txt Install dependencies: python3 -m pip install -r requirements.txt

View File

@ -1,3 +1,5 @@
The classic game of IRC Duck Hunt.
Forked from https://github.com/veggiematts/supybot-duckhunt Forked from https://github.com/veggiematts/supybot-duckhunt
Requires Python3, Limnoria. Requires Python3, Limnoria.

View File

@ -1,3 +1,5 @@
Miscellaneous "fun" commands.
# Fun # Fun
Limnoria plugin to return piglatin translation, play rock-paper-scissors. random; joke, cat fact, cat .gif, dev excuse, bofh excuse, useless fact, corporate buzzwords, startup idea, insult, mitch hedberg joke, chuck norris joke, or advice from various APIs and text files. Limnoria plugin to return piglatin translation, play rock-paper-scissors. random; joke, cat fact, cat .gif, dev excuse, bofh excuse, useless fact, corporate buzzwords, startup idea, insult, mitch hedberg joke, chuck norris joke, or advice from various APIs and text files.

View File

@ -1,6 +1,6 @@
Forked from https://github.com/SpiderDave/spidey-supybot-plugins/tree/master/Plugins/Geo Provides geographical information from an IP address, hostmask, nick (must be in channel), or URL.
Provides geographical information from an ip address, hostmask, nick (must be in channel), or url using GeoLite2. Forked from https://github.com/SpiderDave/spidey-supybot-plugins/tree/master/Plugins/Geo
Requires GeoIP2-python: Requires GeoIP2-python:
``` ```

View File

@ -1,6 +1,6 @@
Forked from https://github.com/resistivecorpse/supybot-plugins/tree/master/HuntNFish A simple hunting and fishing game.
this is a basic hunting and fishing game for supybot Forked from https://github.com/resistivecorpse/supybot-plugins/tree/master/HuntNFish
chance of success is a % variable, 1 to 100. it is set with config plugins.HuntNFish.successRate <number 1 to 100> chance of success is a % variable, 1 to 100. it is set with config plugins.HuntNFish.successRate <number 1 to 100>

View File

@ -1,9 +1,9 @@
Forked from https://github.com/butterscotchstallion/limnoria-plugins/tree/master/IMDB Information about IMDb titles from the OMDB API. Search powered by Google.
Queries OMDB database for information about IMDB titles. Search powered by Google. Forked from https://github.com/butterscotchstallion/limnoria-plugins/tree/master/IMDB
https://omdbapi.com/apikey.aspx https://omdbapi.com/apikey.aspx
``` ```
config plugins.IMDB.omdbAPI (your_api_key) config plugins.IMDb.omdbAPI (your_api_key)
``` ```

View File

@ -29,7 +29,7 @@
### ###
""" """
IMDB: Queries OMDB database for information about IMDB titles IMDb: Queries OMDB database for information about IMDb titles
""" """
import supybot import supybot

View File

@ -32,7 +32,7 @@ import supybot.conf as conf
import supybot.registry as registry import supybot.registry as registry
try: try:
from supybot.i18n import PluginInternationalization from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('IMDB') _ = PluginInternationalization('IMDb')
except: except:
# Placeholder that allows to run the plugin on a bot # Placeholder that allows to run the plugin on a bot
# without the i18n module # without the i18n module
@ -45,20 +45,20 @@ def configure(advanced):
# user or not. You should effect your configuration by manipulating the # user or not. You should effect your configuration by manipulating the
# registry as appropriate. # registry as appropriate.
from supybot.questions import expect, anything, something, yn from supybot.questions import expect, anything, something, yn
conf.registerPlugin('IMDB', True) conf.registerPlugin('IMDb', True)
IMDB = conf.registerPlugin('IMDB') IMDB = conf.registerPlugin('IMDb')
conf.registerGlobalValue(IMDB, 'template', conf.registerGlobalValue(IMDb, 'template',
registry.String("\x02\x031,8 IMDb \x0F\x02 | $title ($year, $country, [$rated], $genre, $runtime) | IMDB: $imdbRating | MC: $metascore | RT: $tomatoMeter | http://imdb.com/title/$imdbID | $plot | Director: $director | Writer: $writer | Actors: $actors", _("""Template for the output of a search query."""))) registry.String("\x02\x031,8 IMDb \x0F\x02 | $title ($year, $country, [$rated], $genre, $runtime) | IMDb: $imdbRating | MC: $metascore | RT: $tomatoMeter | http://imdb.com/title/$imdbID | $plot | Director: $director | Writer: $writer | Actors: $actors", _("""Template for the output of a search query.""")))
# alternative template: # alternative template:
# $title ($year - $director) :: [i:$imdbRating r:$tomatoMeter m:$metascore] $plot :: http://imdb.com/title/$imdbID # $title ($year - $director) :: [i:$imdbRating r:$tomatoMeter m:$metascore] $plot :: http://imdb.com/title/$imdbID
conf.registerGlobalValue(IMDB, 'noResultsMessage', conf.registerGlobalValue(IMDb, 'noResultsMessage',
registry.String("No results for that query.", _("""This message is sent when there are no results"""))) registry.String("No results for that query.", _("""This message is sent when there are no results""")))
conf.registerGlobalValue(IMDB, 'omdbAPI', conf.registerGlobalValue(IMDb, 'omdbAPI',
registry.String('', _("""OMDB API Key"""))) registry.String('', _("""OMDB API Key""")))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:

View File

@ -43,14 +43,14 @@ from bs4 import BeautifulSoup
try: try:
from supybot.i18n import PluginInternationalization from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('IMDB') _ = PluginInternationalization('IMDb')
except ImportError: except ImportError:
# Placeholder that allows to run the plugin on a bot # Placeholder that allows to run the plugin on a bot
# without the i18n module # without the i18n module
_ = lambda x: x _ = lambda x: x
class IMDB(callbacks.Plugin): class IMDb(callbacks.Plugin):
"""Queries OMDB database for information about IMDB titles""" """Queries OMDB database for information about IMDb titles"""
threaded = True threaded = True
def dosearch(self, query): def dosearch(self, query):
@ -87,7 +87,7 @@ class IMDB(callbacks.Plugin):
ua = UserAgent() ua = UserAgent()
headers = {'User-Agent':str(ua.random)} headers = {'User-Agent':str(ua.random)}
self.log.info("IMDB: requesting %s" % omdb_url) self.log.info("IMDb: requesting %s" % omdb_url)
try: try:
request = requests.get(omdb_url, timeout=10, headers=headers) request = requests.get(omdb_url, timeout=10, headers=headers)
@ -99,7 +99,7 @@ class IMDB(callbacks.Plugin):
unknown_error = response["Response"] != "True" unknown_error = response["Response"] != "True"
if not_found or unknown_error: if not_found or unknown_error:
self.log.info("IMDB: OMDB error for %s" % (omdb_url)) self.log.info("IMDb: OMDB error for %s" % (omdb_url))
else: else:
meta = None meta = None
tomato = None tomato = None
@ -142,14 +142,14 @@ class IMDB(callbacks.Plugin):
result = imdb_template result = imdb_template
else: else:
self.log.error("IMDB OMDB API %s - %s" % (request.status_code, request.text)) self.log.error("IMDb OMDB API %s - %s" % (request.status_code, request.text))
except requests.exceptions.Timeout as e: except requests.exceptions.Timeout as e:
self.log.error("IMDB Timeout: %s" % (str(e))) self.log.error("IMDb Timeout: %s" % (str(e)))
except requests.exceptions.ConnectionError as e: except requests.exceptions.ConnectionError as e:
self.log.error("IMDB ConnectionError: %s" % (str(e))) self.log.error("IMDb ConnectionError: %s" % (str(e)))
except requests.exceptions.HTTPError as e: except requests.exceptions.HTTPError as e:
self.log.error("IMDB HTTPError: %s" % (str(e))) self.log.error("IMDb HTTPError: %s" % (str(e)))
finally: finally:
if result is not None: if result is not None:
irc.reply(result) irc.reply(result)
@ -158,7 +158,7 @@ class IMDB(callbacks.Plugin):
imdb = wrap(imdb, ['text']) imdb = wrap(imdb, ['text'])
Class = IMDB Class = IMDb
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -1,4 +1,4 @@
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T8E56M6SP9JH2) A fully-featured and customizable IRC trivia game using an archive of Jeopardy! questions.
**Come play in ##Jeopardy on Freenode.** **Come play in ##Jeopardy on Freenode.**

View File

@ -1,4 +1,3 @@
# Lyrics
Limnoria plugin to return song lyrics from http://lyrics.wikia.com/. Search powered by Google. Limnoria plugin to return song lyrics from http://lyrics.wikia.com/. Search powered by Google.
load plugindownloader load plugindownloader

View File

@ -1,3 +1,5 @@
Generate markov replies to channel messages.
Forked from: https://github.com/ProgVal/Supybot-plugins/tree/master/Markovgen Forked from: https://github.com/ProgVal/Supybot-plugins/tree/master/Markovgen
Additions: Additions:

View File

@ -1,6 +1,4 @@
# NBAScores Retrieve NBA basketball scores from NBA.com
A [Limnoria](https://github.com/ProgVal/Limnoria) plugin to retrieve NBA basketball scores from NBA.com.
## Requirements ## Requirements
* Python 3 * Python 3

View File

@ -1,6 +1,4 @@
#NHL Retrieve NHL hockey scores from NHL.com
A [Limnoria](https://github.com/ProgVal/Limnoria) plugin to retrieve NHL hockey scores from NHL.com.
## Requirements ## Requirements
* Python 3 * Python 3

View File

@ -1,3 +1,3 @@
RPG. Customizable Role Playing Game for IRC. Customizable Role Playing Game for IRC.
Forked from https://github.com/antb/StewieGriffin/tree/master/Rpg Forked from https://github.com/antb/StewieGriffin/tree/master/Rpg

View File

@ -1,3 +1,5 @@
Highly customizable and fully-featured link title snarfer with many URL handlers.
Forked from https://github.com/butterscotchstallion/limnoria-plugins/tree/master/SpiffyTitles Forked from https://github.com/butterscotchstallion/limnoria-plugins/tree/master/SpiffyTitles
If you're coming from another fork of SpiffyTitles, please note that some config variables have changed in this version. Everything is now grouped by url handler; spiffytitles.default, spiffytitles.youtube, spiffytitles.imdb, etc. If you're coming from another fork of SpiffyTitles, please note that some config variables have changed in this version. Everything is now grouped by url handler; spiffytitles.default, spiffytitles.youtube, spiffytitles.imdb, etc.

View File

@ -1,6 +1,6 @@
# TVMaze Fetch TV show information and schedules from the TVMaze API.
## Limnoria plugin to fetch TV show information and schedules from tvmaze.com API # TVMaze
### Instructions ### Instructions

View File

@ -1,7 +1,12 @@
Generate text art from images, text, or scroll text art links.
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T8E56M6SP9JH2) [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=T8E56M6SP9JH2)
Try the plugin out in #ircart on EFnet. irc://irc.efnet.org/#ircart ## Try the plugin out in #ircart on EFnet.
irc://irc.efnet.org/#ircart
<b>TextArt Plugin</b><br> <b>TextArt Plugin</b><br>

View File

@ -1,3 +1,5 @@
The classic TimeBomb game for IRC.
Forked from https://github.com/quantumlemur/Supybot-Plugins/tree/master/Timebomb Forked from https://github.com/quantumlemur/Supybot-Plugins/tree/master/Timebomb
Python 3 compatible Python 3 compatible

View File

@ -1,3 +1,3 @@
Forked from https://github.com/ormanya/Supyiel/tree/master/Trackers
Provide tracker/site/IRC status for various torrent trackers. Provide tracker/site/IRC status for various torrent trackers.
Forked from https://github.com/ormanya/Supyiel/tree/master/Trackers

View File

@ -1,3 +1,5 @@
A fully-featured and customizable trivia game similar to Spike's Trivia for eggdrop.
# Configuration # Configuration
Requires Limnoria and Python 3 Requires Limnoria and Python 3

View File

@ -1,3 +1,5 @@
Retrieve tweets and other assorted info from the Twitter API.
Forked from https://github.com/reticulatingspline/Tweety Forked from https://github.com/reticulatingspline/Tweety
# Limnoria plugin for Twitter. # Limnoria plugin for Twitter.

View File

@ -1,3 +1,5 @@
The classic card game of UNO for IRC. Play against other chatters or the bot.
Forked from https://github.com/SpiderDave/spidey-supybot-plugins/tree/master/Plugins/Uno Forked from https://github.com/SpiderDave/spidey-supybot-plugins/tree/master/Plugins/Uno
This is a Limnoria plugin implementation of UNO. This is a Limnoria plugin implementation of UNO.

View File

@ -29,7 +29,7 @@
### ###
""" """
UNO: the uno card game for Limnoria. UNO: the UNO card game for Limnoria.
""" """
import supybot import supybot
@ -62,7 +62,7 @@ if world.testing:
from . import test from . import test
Class = plugin.Class Class = plugin.Class
Uno = config.Uno UNO = config.UNO
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -32,7 +32,7 @@ import supybot.conf as conf
import supybot.registry as registry import supybot.registry as registry
try: try:
from supybot.i18n import PluginInternationalization from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('Uno') _ = PluginInternationalization('UNO')
except: except:
# Placeholder that allows to run the plugin on a bot # Placeholder that allows to run the plugin on a bot
# without the i18n module # without the i18n module
@ -44,8 +44,8 @@ def configure(advanced):
# user or not. You should effect your configuration by manipulating the # user or not. You should effect your configuration by manipulating the
# registry as appropriate. # registry as appropriate.
from supybot.questions import expect, anything, something, yn from supybot.questions import expect, anything, something, yn
conf.registerPlugin('Uno', True) conf.registerPlugin('UNO', True)
Uno = conf.registerPlugin('Uno') UNO = conf.registerPlugin('UNO')
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -43,18 +43,18 @@ import pickle
try: try:
from supybot.i18n import PluginInternationalization from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('Uno') _ = PluginInternationalization('UNO')
except ImportError: except ImportError:
# Placeholder that allows to run the plugin on a bot # Placeholder that allows to run the plugin on a bot
# without the i18n module # without the i18n module
_ = lambda x: x _ = lambda x: x
class Uno(callbacks.Plugin): class UNO(callbacks.Plugin):
""" """
Uno! UNO!
""" """
threaded = True threaded = True
game=[{},{},{},{},{}] game=[{},{},{},{},{}]
channeloptions = {} channeloptions = {}
@ -65,9 +65,9 @@ class Uno(callbacks.Plugin):
channeloptions['maxbots']=9 channeloptions['maxbots']=9
channeloptions['use_colors']=True channeloptions['use_colors']=True
channeloptions['use_notice']=True channeloptions['use_notice']=True
lastgame=time.time() lastgame=time.time()
def make_sure_path_exists(path): def make_sure_path_exists(path):
try: try:
os.makedirs(path) os.makedirs(path)
@ -80,9 +80,8 @@ class Uno(callbacks.Plugin):
prefixChar = conf.supybot.reply.whenAddressedBy.chars()[0] prefixChar = conf.supybot.reply.whenAddressedBy.chars()[0]
def start(self, irc, msg, args, text): def start(self, irc, msg, args, text):
"""takes no arguments """
Start a new game of UNO. For the rules of the game, use the "uno rules" command.
Start a new game of Uno. For the rules of the game, use the uno rules command.
""" """
try: try:
self._read_options(irc) self._read_options(irc)
@ -109,7 +108,7 @@ class Uno(callbacks.Plugin):
gametype=self.game[table].get('type').capitalize() gametype=self.game[table].get('type').capitalize()
irc.reply('Error: You are already in a game of %s.' % gametype) irc.reply('Error: You are already in a game of %s.' % gametype)
return return
table=self._getopentable() table=self._getopentable()
if table==None: if table==None:
irc.reply('Sorry, all the game tables are in use at the moment.') irc.reply('Sorry, all the game tables are in use at the moment.')
@ -118,41 +117,37 @@ class Uno(callbacks.Plugin):
self._cleanup(table) self._cleanup(table)
self.game[table]['channel']=msg.args[0] self.game[table]['channel']=msg.args[0]
self.game[table]['type']=gametype self.game[table]['type']=gametype
if gametype=='uno': if gametype=='uno':
self.game[table]['players'][nick]={} self.game[table]['players'][nick]={}
#self.game[table]['nplayers']=int(self.channeloptions[gametype+'_nplayers']) #self.game[table]['nplayers']=int(self.channeloptions[gametype+'_nplayers'])
self.game[table]['nplayers']=int(self.channeloptions['nplayers']) self.game[table]['nplayers']=int(self.channeloptions['nplayers'])
irc.reply('%s has started a new game of %s at table %s. For the rules of the game, type "%suno rules". To accept this challenge, join with "%suno join". To add a cpu player, type "%suno join cpu".' % (nick, gametype.capitalize(), table+1, self.prefixChar,self.prefixChar,self.prefixChar), prefixNick=False) irc.reply('%s has started a new game of %s at table %s. For the rules of the game, type "%suno rules". To accept this challenge, join with "%suno join". To add a cpu player, type "%suno join cpu".' % (nick, gametype.capitalize(), table+1, self.prefixChar,self.prefixChar,self.prefixChar), prefixNick=False)
self.game[table]['phase']='join' self.game[table]['phase']='join'
start = wrap(start, ['public', optional('something')]) start = wrap(start, ['public', optional('something')])
def begin(self, irc, msg, args): def begin(self, irc, msg, args):
""" """
begin uno game Begin the UNO game.
""" """
self._uno_begin(irc, msg.nick) self._uno_begin(irc, msg.nick)
begin = wrap(begin) begin = wrap(begin)
def _uno_begin(self, irc, nick): def _uno_begin(self, irc, nick):
"""
test
"""
table=self._gettablefromnick(nick) table=self._gettablefromnick(nick)
if table == None: if table == None:
irc.reply('Error: You are not playing a game at any of the tables.') irc.reply('Error: You are not playing a game at any of the tables.')
return return
if self.game[table]['type'] != 'uno': if self.game[table]['type'] != 'uno':
irc.reply('Error: Not an Uno game.') irc.reply('Error: Not an UNO game.')
return return
if self.game[table]['phase'] != 'join': if self.game[table]['phase'] != 'join':
irc.reply("Error: You can't use this command right now.") irc.reply("Error: You can't use this command right now.")
return return
nplayers= list(self.game[table]['players'].keys()) nplayers= list(self.game[table]['players'].keys())
if len(nplayers) < 2: if len(nplayers) < 2:
irc.reply('Error: You need at least two players for Uno.') irc.reply('Error: You need at least two players for UNO.')
return return
# start things for real # start things for real
for n in list(self.game[table]['players'].keys()): for n in list(self.game[table]['players'].keys()):
@ -178,15 +173,11 @@ class Uno(callbacks.Plugin):
self._uno_cpu_play(irc, table) self._uno_cpu_play(irc, table)
else: else:
return return
def _uno_tell_status(self, irc, nick): def _uno_tell_status(self, irc, nick):
"""
test
"""
table=self._gettablefromnick(nick) table=self._gettablefromnick(nick)
if table==None: if table==None:
irc.reply('Error: You are not playing Uno at any of the tables.') irc.reply('Error: You are not playing UNO at any of the tables.')
return return
channel=self.game[table]['channel'] channel=self.game[table]['channel']
opponents=[p for p in list(self.game[table]['players'].keys()) if p!=nick] opponents=[p for p in list(self.game[table]['players'].keys()) if p!=nick]
@ -265,7 +256,7 @@ class Uno(callbacks.Plugin):
if discardcolor in c: if discardcolor in c:
return False return False
return True return True
unocolors=['Blue','Green','Red','Yellow'] unocolors=['Blue','Green','Red','Yellow']
for color in unocolors: for color in unocolors:
if color in card: if color in card:
@ -300,21 +291,13 @@ class Uno(callbacks.Plugin):
def tellstatus(self, irc, msg, args): def tellstatus(self, irc, msg, args):
""" """
? Tell current UNO status
""" """
self._uno_tell_status(irc, msg.nick) self._uno_tell_status(irc, msg.nick)
tellstatus=wrap(tellstatus) tellstatus=wrap(tellstatus)
def test(self, irc, msg, args):
"""
?
"""
prefixChar = conf.supybot.reply.whenAddressedBy.chars()[0]
irc.reply(chars)
test=wrap(test)
def rules(self, irc, msg, args, text): def rules(self, irc, msg, args, text):
"""takes no arguments """
Display rules for uno. Start a game of uno with the "uno start" command. Display rules for uno. Start a game of uno with the "uno start" command.
""" """
if text: if text:
@ -322,15 +305,14 @@ class Uno(callbacks.Plugin):
else: else:
gametype='uno' gametype='uno'
if gametype=='uno': if gametype=='uno':
irc.reply('Rules for Uno: http://www.wonkavator.com/uno/unorules.html') irc.reply('Rules for UNO: http://www.wonkavator.com/uno/unorules.html')
else: else:
irc.reply('Unknown game type.') irc.reply('Unknown game type.')
rules=wrap(rules, [additional('text')]) rules=wrap(rules, [additional('text')])
def join(self, irc, msg, args, table, fakenick): def join(self, irc, msg, args, table, fakenick):
"""[<table>] """[<table>]
Join a game of UNO previously started with the "uno start" command.
Join a game of Uno previously started with the "uno start" command.
Specify <table> if there is more than one game to join in that channel. Specify <table> if there is more than one game to join in that channel.
""" """
try: try:
@ -391,11 +373,11 @@ class Uno(callbacks.Plugin):
self.game[table]['players'][nick]={} self.game[table]['players'][nick]={}
if isfake==True: if isfake==True:
self.game[table]['players'][nick]['fake']=True self.game[table]['players'][nick]['fake']=True
if len(list(self.game[table]['players'].keys())) < self.game[table]['nplayers']: if len(list(self.game[table]['players'].keys())) < self.game[table]['nplayers']:
irc.reply('%s has joined the %s game at table %s. Use %suno begin to begin the game.' % (nick,self.game[table]['type'],table+1, self.prefixChar), prefixNick=False, to=self.game[table]['channel']) irc.reply('%s has joined the %s game at table %s. Use %suno begin to begin the game.' % (nick,self.game[table]['type'],table+1, self.prefixChar), prefixNick=False, to=self.game[table]['channel'])
return return
for n in list(self.game[table]['players'].keys()): for n in list(self.game[table]['players'].keys()):
self.game[table]['players'][n]['hand']=[] self.game[table]['players'][n]['hand']=[]
# each player draws 7 initial cards # each player draws 7 initial cards
@ -420,9 +402,8 @@ class Uno(callbacks.Plugin):
join = wrap(join, ['public', optional('int'), optional('something')]) join = wrap(join, ['public', optional('int'), optional('something')])
def leave(self, irc, msg, args, fakenick): def leave(self, irc, msg, args, fakenick):
"""takes no arguments """
Leave a game of UNO.
Leave a game of Uno.
""" """
try: try:
self._read_options(irc) self._read_options(irc)
@ -439,7 +420,7 @@ class Uno(callbacks.Plugin):
if table==None: if table==None:
irc.reply('Error: You are not playing a game at any of the tables.') irc.reply('Error: You are not playing a game at any of the tables.')
return return
if self.game[table].get('type')=='uno': if self.game[table].get('type')=='uno':
self._leavegame(irc, msg, nick) self._leavegame(irc, msg, nick)
self._uno_do_cpu(irc, table) # only works if game type is uno self._uno_do_cpu(irc, table) # only works if game type is uno
@ -447,9 +428,8 @@ class Uno(callbacks.Plugin):
leave = wrap(leave, ['public', optional('something')]) leave = wrap(leave, ['public', optional('something')])
def _leavegame(self, irc, msg, nick): def _leavegame(self, irc, msg, nick):
"""takes no arguments """
Leave a game of UNO.
Leave a game of Uno.
""" """
try: try:
self._read_options(irc) self._read_options(irc)
@ -462,29 +442,28 @@ class Uno(callbacks.Plugin):
table=self._gettablefromnick(nick) table=self._gettablefromnick(nick)
if table==None: if table==None:
return return
channel=self.game[table]['channel'] channel=self.game[table]['channel']
# leaving a game when you're the only player # leaving a game when you're the only player
if len(self.game[table]['players'])==1: if len(self.game[table]['players'])==1:
irc.reply('There are no more players; The game is over.', to=channel) irc.reply('There are no more players; The game is over.', to=channel)
self.game[table]['phase']='gameover' self.game[table]['phase']='gameover'
self._cleanup(table) self._cleanup(table)
return return
# check if it's only bot players left # check if it's only bot players left
Human=False Human=False
for n in list(self.game[table]['players'].keys()): for n in list(self.game[table]['players'].keys()):
if not self.game[table]['players'][n].get('cpu'): if not self.game[table]['players'][n].get('cpu'):
if n!=nick: Human=True if n!=nick: Human=True
if not Human: if not Human:
irc.reply('There are no more human players; the game is over.', to=channel) irc.reply('There are no more human players; the game is over.', to=channel)
self.game[table]['phase']='gameover' self.game[table]['phase']='gameover'
self._cleanup(table) self._cleanup(table)
return return
# ---- replace with cpu ---- # ---- replace with cpu ----
oldnick=nick oldnick=nick
nick=self._uno_make_cpu(table) nick=self._uno_make_cpu(table)
@ -551,18 +530,18 @@ class Uno(callbacks.Plugin):
def _uno_cpu_play(self, irc, table): def _uno_cpu_play(self, irc, table):
channel=self.game[table]['channel'] channel=self.game[table]['channel']
Human=False Human=False
for n in list(self.game[table]['players'].keys()): for n in list(self.game[table]['players'].keys()):
if not self.game[table]['players'][n].get('cpu'): if not self.game[table]['players'][n].get('cpu'):
Human=True Human=True
if not Human: if not Human:
irc.reply('There are no more human players; the game is over.', to=channel) irc.reply('There are no more human players; the game is over.', to=channel)
self.game[table]['phase']='gameover' self.game[table]['phase']='gameover'
self._cleanup(table) self._cleanup(table)
return return
nick=list(self.game[table]['players'].keys())[self.game[table]['turn']] nick=list(self.game[table]['players'].keys())[self.game[table]['turn']]
discard=self.game[table]['discard'][-1] discard=self.game[table]['discard'][-1]
wildcolor = self.game[table].get('wildcolor') wildcolor = self.game[table].get('wildcolor')
@ -574,7 +553,7 @@ class Uno(callbacks.Plugin):
# draw a card # draw a card
card=self._uno_draw_card(table, nick) card=self._uno_draw_card(table, nick)
self.game[table]['players'][nick]['hasdrawn']=True self.game[table]['players'][nick]['hasdrawn']=True
if self._uno_is_valid_play(table, card, discard, wildcolor)==True: if self._uno_is_valid_play(table, card, discard, wildcolor)==True:
# always play the card if possible # always play the card if possible
ncards=len(self.game[table]['players'][nick]['hand']) ncards=len(self.game[table]['players'][nick]['hand'])
@ -651,12 +630,11 @@ class Uno(callbacks.Plugin):
def play(self, irc, msg, args, text): def play(self, irc, msg, args, text):
"""<card> """<card>
Play a <card> for the UNO game. Examples: "uno play red 0", "uno play wild blue", "uno play draw", "uno play done"
Play a <card> for the Uno game. Examples: "uno play red 0", "uno play wild blue", "uno play draw", "uno play done"
""" """
nick=msg.nick nick=msg.nick
table=self._gettablefromnick(nick) table=self._gettablefromnick(nick)
if table==None: if table==None:
irc.reply('Error: You are not playing a game at any of the tables.') irc.reply('Error: You are not playing a game at any of the tables.')
@ -670,30 +648,30 @@ class Uno(callbacks.Plugin):
fakenick=fakenick[0] fakenick=fakenick[0]
nick=fakenick nick=fakenick
text=text.rsplit(' ',1)[:-1][0] text=text.rsplit(' ',1)[:-1][0]
if self.game[table]['phase']=='running': if self.game[table]['phase']=='running':
nplayers=len(list(self.game[table]['players'].keys())) nplayers=len(list(self.game[table]['players'].keys()))
if nick not in self.game[table]['players']: if nick not in self.game[table]['players']:
irc.reply("Error: You're not playing this game.") irc.reply("Error: You're not playing this game.")
return return
opponent=[p for p in self.game[table]['players'] if p !=nick][0] opponent=[p for p in self.game[table]['players'] if p !=nick][0]
turnplayer=list(self.game[table]['players'].keys())[self.game[table]['turn']] turnplayer=list(self.game[table]['players'].keys())[self.game[table]['turn']]
if nick!=turnplayer: if nick!=turnplayer:
# Note: it will prefix nick in notice -- need to fix that # Note: it will prefix nick in notice -- need to fix that
irc.reply("%s: It is %s's turn." % (nick, turnplayer), prefixNick=False) irc.reply("%s: It is %s's turn." % (nick, turnplayer), prefixNick=False)
return return
text=text.strip() text=text.strip()
discard=self.game[table]['discard'][-1] discard=self.game[table]['discard'][-1]
wildcolor=self.game[table].get('wildcolor') wildcolor=self.game[table].get('wildcolor')
novalid=True novalid=True
for c in self.game[table]['players'][nick]['hand']: for c in self.game[table]['players'][nick]['hand']:
if self._uno_is_valid_play(table, c, discard, wildcolor)==True: if self._uno_is_valid_play(table, c, discard, wildcolor)==True:
novalid=False novalid=False
if text.lower()=='draw': if text.lower()=='draw':
if self.game[table]['players'][nick].get('hasdrawn')==True: if self.game[table]['players'][nick].get('hasdrawn')==True:
irc.reply('You have already drawn a card.') irc.reply('You have already drawn a card.')
@ -742,9 +720,9 @@ class Uno(callbacks.Plugin):
self._uno_tell_status(irc, nn) self._uno_tell_status(irc, nn)
self._uno_do_cpu(irc, table) self._uno_do_cpu(irc, table)
return return
card=text card=text
card=[card for card in self.unodeck if card.lower()==text.lower()] card=[card for card in self.unodeck if card.lower()==text.lower()]
validwild=['Wild Blue','Wild Green', 'Wild Red', 'Wild Yellow', validwild=['Wild Blue','Wild Green', 'Wild Red', 'Wild Yellow',
'Wild Draw 4 Blue','Wild Draw 4 Green', 'Wild Draw 4 Red', 'Wild Draw 4 Yellow'] 'Wild Draw 4 Blue','Wild Draw 4 Green', 'Wild Draw 4 Red', 'Wild Draw 4 Yellow']
@ -769,16 +747,16 @@ class Uno(callbacks.Plugin):
if card not in hand: if card not in hand:
irc.reply('That card is not in your hand.') irc.reply('That card is not in your hand.')
return return
# check for illegal move # check for illegal move
if self._uno_is_valid_play(table, card, discard, wildcolor)==False: if self._uno_is_valid_play(table, card, discard, wildcolor)==False:
irc.reply("You can't play that card.") irc.reply("You can't play that card.")
return return
# play the card # play the card
self.game[table]['players'][nick]['hand'].remove(card) self.game[table]['players'][nick]['hand'].remove(card)
self.game[table]['discard'].append(card) self.game[table]['discard'].append(card)
ncards=len(self.game[table]['players'][nick]['hand']) ncards=len(self.game[table]['players'][nick]['hand'])
if 'Wild' in card: if 'Wild' in card:
self.game[table]['wildcolor']=newcolor self.game[table]['wildcolor']=newcolor
card='%s (%s)' % (card, self.game[table]['wildcolor']) card='%s (%s)' % (card, self.game[table]['wildcolor'])
@ -802,7 +780,7 @@ class Uno(callbacks.Plugin):
self.game[table]['players'][nick]['hasdrawn']=False self.game[table]['players'][nick]['hasdrawn']=False
else: else:
irc.reply('%s played %s (%s cards left in hand).' % (nick, card, ncards), to=channel) irc.reply('%s played %s (%s cards left in hand).' % (nick, card, ncards), to=channel)
ncards = len(self.game[table]['players'][nick]['hand']) ncards = len(self.game[table]['players'][nick]['hand'])
if ncards==0: if ncards==0:
irc.reply('The game is over. '+ircutils.bold('%s wins!' % nick), to=channel) irc.reply('The game is over. '+ircutils.bold('%s wins!' % nick), to=channel)
@ -812,7 +790,7 @@ class Uno(callbacks.Plugin):
if 'Reverse' in card: if 'Reverse' in card:
self.game[table]['direction']*=-1 self.game[table]['direction']*=-1
turn=self.game[table]['turn']+1*self.game[table]['direction'] turn=self.game[table]['turn']+1*self.game[table]['direction']
if turn>nplayers-1:turn=0 if turn>nplayers-1:turn=0
if turn<0:turn=nplayers-1 if turn<0:turn=nplayers-1
@ -844,9 +822,9 @@ class Uno(callbacks.Plugin):
def setoption(self, irc, msg, args, channel, text, value): def setoption(self, irc, msg, args, channel, text, value):
"""<option> <value> """<option> <value>
Changes an option for UNO game. You can view the
Changes an option for Uno game. You can view the options for the current channel with the "uno showoptions" command.
options for the current channel with the "uno showoptions" command.""" """
try: try:
self._read_options(irc) self._read_options(irc)
except: except:
@ -879,9 +857,9 @@ class Uno(callbacks.Plugin):
setoption = wrap(setoption, [('checkChannelCapability', 'op'), 'something', 'something']) setoption = wrap(setoption, [('checkChannelCapability', 'op'), 'something', 'something'])
def showoptions(self, irc, msg, args): def showoptions(self, irc, msg, args):
"""(takes no arguments) """
Shows options for UNO game for the current channel.
Shows options for Uno game for the current channel.""" """
try: try:
self._read_options(irc) self._read_options(irc)
except: except:
@ -918,7 +896,7 @@ class Uno(callbacks.Plugin):
network=irc.network.replace(' ','_') network=irc.network.replace(' ','_')
channel=irc.msg.args[0] channel=irc.msg.args[0]
#irc.reply('test: %s.%s.options' % (irc.network, irc.msg.args[0] )) #irc.reply('test: %s.%s.options' % (irc.network, irc.msg.args[0] ))
f="%s%s.%s.options" % (self.dataPath, network, channel) f="%s%s.%s.options" % (self.dataPath, network, channel)
if os.path.isfile(f): if os.path.isfile(f):
inputfile = open(f, "rb") inputfile = open(f, "rb")
@ -969,7 +947,7 @@ class Uno(callbacks.Plugin):
if msg.args[0] == self.game[table]['channel']: if msg.args[0] == self.game[table]['channel']:
self._leavegame(irc, msg, nick) self._leavegame(irc, msg, nick)
self._uno_do_cpu(irc, table) # only works if game type is uno self._uno_do_cpu(irc, table) # only works if game type is uno
def doKick(self, irc, msg): def doKick(self, irc, msg):
(channel, nicks) = msg.args[:2] (channel, nicks) = msg.args[:2]
nicks=nicks.split(',') nicks=nicks.split(',')
@ -1009,6 +987,6 @@ class Uno(callbacks.Plugin):
m=ircmsgs.privmsg(to, text) m=ircmsgs.privmsg(to, text)
self._sendMsg(irc, m) self._sendMsg(irc, m)
Class = Uno Class = UNO
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -1,4 +1,4 @@
This is a Supybot plugin implementation of psychological number games described in Metamagical Themas by Douglas Hofstadter. Psychological number game as described in "Metamagical Themas" by Douglas Hofstadter.
==== Usage ==== ==== Usage ====

View File

@ -29,7 +29,7 @@
### ###
""" """
Undercut: a card game plugin for multiple players Undercut: a psychological numbers game for multiple players.
""" """
import supybot import supybot

View File

@ -1,6 +1,6 @@
Python3 compatible. Forked from https://github.com/IotaSpencer/supyplugins/tree/master/UndernetX Logs into UnderNet's X Service.
Logs into Undernet's X Service Python3 compatible. Forked from https://github.com/IotaSpencer/supyplugins/tree/master/UndernetX
## Setup ## Setup
@ -8,3 +8,6 @@ Logs into Undernet's X Service
* If you want your bot to /mode +x on login, make sure to set * If you want your bot to /mode +x on login, make sure to set
`plugins.UndernetX.modeXonID` to `True` if it isn't already. `plugins.UndernetX.modeXonID` to `True` if it isn't already.
* To prevent channel joins before authorized with X set
`plugins.UndernetX.auth.noJoinsUntilAuthed` to `True` if it isn't already.

View File

@ -1,5 +1,5 @@
Returns info on a unicode symbol (name, hex/html, etc.)
Forked from https://github.com/gsf/supybot-plugins/tree/master/plugins/Unicode Forked from https://github.com/gsf/supybot-plugins/tree/master/plugins/Unicode
Returns info on a unicode symbol such as emoji. Returning name, hex/html values, etc.
usage: unicode <symbol> usage: unicode <symbol>

View File

@ -1 +1,3 @@
Retrieve definitions from the Urban Dictionary.
Forked from https://github.com/reticulatingspline/UrbanDictionary Forked from https://github.com/reticulatingspline/UrbanDictionary

View File

@ -1,4 +1,4 @@
Limnoria plugin to fetch cannabis (marijuana) strain information from the strain api (strains.evanbusse.com) Fetch cannabis (marijuana) strain information from the strain api (strains.evanbusse.com)
obtain an api key from http://strains.evanbusse.com/ obtain an api key from http://strains.evanbusse.com/

View File

@ -1,3 +1,5 @@
Retrieve info from WolframAlpha based on your queries.
Forked from https://github.com/ormanya/Supyiel/tree/master/WolframAlpha Forked from https://github.com/ormanya/Supyiel/tree/master/WolframAlpha
# Limnoria plugin for WolframAlpha # Limnoria plugin for WolframAlpha

View File

@ -1,3 +1,5 @@
Various word games for IRC.
Froked from https://github.com/mmueller/supybot-wordgames Froked from https://github.com/mmueller/supybot-wordgames
Working with Python3 and Limnoria. Working with Python3 and Limnoria.

View File

@ -1,3 +1,5 @@
Retrieve current time and time zone information for various locations.
# Limnoria plugin for WorldTime # Limnoria plugin for WorldTime
Forked from https://github.com/reticulatingspline/WorldTime Forked from https://github.com/reticulatingspline/WorldTime