mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 12:31:07 -05:00
Update READMEs for PluginDownloader info
This commit is contained in:
parent
ee0cce95ef
commit
15198a5636
@ -1,5 +1,5 @@
|
||||
Access various Microsoft Azure APIs (translate, search, etc.).
|
||||
|
||||
## Azure Plugin
|
||||
|
||||
This plugin connects to various Microsoft Azure APIs.
|
||||
|
||||
`config plugins.azure.translate.key` Set your key for the text translation API
|
||||
|
@ -1,3 +1,3 @@
|
||||
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)
|
||||
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)
|
||||
kick users who use such words from channels that have that capability enabled.
|
||||
|
@ -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.instance (BOT_INSTANCE_ID_HERE)
|
||||
|
@ -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>
|
||||
uses https://catfact.ninja/ as cat facts source<br>
|
||||
|
@ -1,9 +1,11 @@
|
||||
Generate markov responses using the Cobe library.
|
||||
|
||||
Forked from https://github.com/waratte/supybot/tree/master/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
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
Dice rolling plugin with many options.
|
||||
|
||||
Forked from https://github.com/wRAR/supybot-plugin-Dicebot
|
||||
|
||||
Install dependencies: python3 -m pip install -r requirements.txt
|
||||
|
@ -1,3 +1,5 @@
|
||||
The classic game of IRC Duck Hunt.
|
||||
|
||||
Forked from https://github.com/veggiematts/supybot-duckhunt
|
||||
|
||||
Requires Python3, Limnoria.
|
||||
|
@ -1,3 +1,5 @@
|
||||
Miscellaneous "fun" commands.
|
||||
|
||||
# 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.
|
||||
|
||||
|
@ -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:
|
||||
```
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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
|
||||
```
|
||||
config plugins.IMDB.omdbAPI (your_api_key)
|
||||
config plugins.IMDb.omdbAPI (your_api_key)
|
||||
```
|
||||
|
@ -29,7 +29,7 @@
|
||||
###
|
||||
|
||||
"""
|
||||
IMDB: Queries OMDB database for information about IMDB titles
|
||||
IMDb: Queries OMDB database for information about IMDb titles
|
||||
"""
|
||||
|
||||
import supybot
|
@ -32,7 +32,7 @@ import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
_ = PluginInternationalization('IMDB')
|
||||
_ = PluginInternationalization('IMDb')
|
||||
except:
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
@ -45,20 +45,20 @@ def configure(advanced):
|
||||
# user or not. You should effect your configuration by manipulating the
|
||||
# registry as appropriate.
|
||||
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',
|
||||
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.""")))
|
||||
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.""")))
|
||||
|
||||
# alternative template:
|
||||
# $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""")))
|
||||
conf.registerGlobalValue(IMDB, 'omdbAPI',
|
||||
conf.registerGlobalValue(IMDb, 'omdbAPI',
|
||||
registry.String('', _("""OMDB API Key""")))
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
@ -43,14 +43,14 @@ from bs4 import BeautifulSoup
|
||||
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
_ = PluginInternationalization('IMDB')
|
||||
_ = PluginInternationalization('IMDb')
|
||||
except ImportError:
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
_ = lambda x: x
|
||||
|
||||
class IMDB(callbacks.Plugin):
|
||||
"""Queries OMDB database for information about IMDB titles"""
|
||||
class IMDb(callbacks.Plugin):
|
||||
"""Queries OMDB database for information about IMDb titles"""
|
||||
threaded = True
|
||||
|
||||
def dosearch(self, query):
|
||||
@ -87,7 +87,7 @@ class IMDB(callbacks.Plugin):
|
||||
ua = UserAgent()
|
||||
headers = {'User-Agent':str(ua.random)}
|
||||
|
||||
self.log.info("IMDB: requesting %s" % omdb_url)
|
||||
self.log.info("IMDb: requesting %s" % omdb_url)
|
||||
|
||||
try:
|
||||
request = requests.get(omdb_url, timeout=10, headers=headers)
|
||||
@ -99,7 +99,7 @@ class IMDB(callbacks.Plugin):
|
||||
unknown_error = response["Response"] != "True"
|
||||
|
||||
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:
|
||||
meta = None
|
||||
tomato = None
|
||||
@ -142,14 +142,14 @@ class IMDB(callbacks.Plugin):
|
||||
|
||||
result = imdb_template
|
||||
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:
|
||||
self.log.error("IMDB Timeout: %s" % (str(e)))
|
||||
self.log.error("IMDb Timeout: %s" % (str(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:
|
||||
self.log.error("IMDB HTTPError: %s" % (str(e)))
|
||||
self.log.error("IMDb HTTPError: %s" % (str(e)))
|
||||
finally:
|
||||
if result is not None:
|
||||
irc.reply(result)
|
||||
@ -158,7 +158,7 @@ class IMDB(callbacks.Plugin):
|
||||
|
||||
imdb = wrap(imdb, ['text'])
|
||||
|
||||
Class = IMDB
|
||||
Class = IMDb
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
@ -1,4 +1,4 @@
|
||||
[](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.**
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
# Lyrics
|
||||
Limnoria plugin to return song lyrics from http://lyrics.wikia.com/. Search powered by Google.
|
||||
|
||||
load plugindownloader
|
||||
|
@ -1,3 +1,5 @@
|
||||
Generate markov replies to channel messages.
|
||||
|
||||
Forked from: https://github.com/ProgVal/Supybot-plugins/tree/master/Markovgen
|
||||
|
||||
Additions:
|
||||
|
@ -1,6 +1,4 @@
|
||||
# NBAScores
|
||||
|
||||
A [Limnoria](https://github.com/ProgVal/Limnoria) plugin to retrieve NBA basketball scores from NBA.com.
|
||||
Retrieve NBA basketball scores from NBA.com
|
||||
|
||||
## Requirements
|
||||
* Python 3
|
||||
|
@ -1,6 +1,4 @@
|
||||
#NHL
|
||||
|
||||
A [Limnoria](https://github.com/ProgVal/Limnoria) plugin to retrieve NHL hockey scores from NHL.com.
|
||||
Retrieve NHL hockey scores from NHL.com
|
||||
|
||||
## Requirements
|
||||
* Python 3
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
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.
|
||||
|
@ -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
|
||||
|
||||
|
@ -1,7 +1,12 @@
|
||||
Generate text art from images, text, or scroll text art links.
|
||||
|
||||
|
||||
[](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>
|
||||
|
@ -1,3 +1,5 @@
|
||||
The classic TimeBomb game for IRC.
|
||||
|
||||
Forked from https://github.com/quantumlemur/Supybot-Plugins/tree/master/Timebomb
|
||||
|
||||
Python 3 compatible
|
||||
|
@ -1,3 +1,3 @@
|
||||
Forked from https://github.com/ormanya/Supyiel/tree/master/Trackers
|
||||
|
||||
Provide tracker/site/IRC status for various torrent trackers.
|
||||
|
||||
Forked from https://github.com/ormanya/Supyiel/tree/master/Trackers
|
||||
|
@ -1,3 +1,5 @@
|
||||
A fully-featured and customizable trivia game similar to Spike's Trivia for eggdrop.
|
||||
|
||||
# Configuration
|
||||
|
||||
Requires Limnoria and Python 3
|
||||
|
@ -1,3 +1,5 @@
|
||||
Retrieve tweets and other assorted info from the Twitter API.
|
||||
|
||||
Forked from https://github.com/reticulatingspline/Tweety
|
||||
|
||||
# Limnoria plugin for Twitter.
|
||||
|
@ -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
|
||||
|
||||
This is a Limnoria plugin implementation of UNO.
|
@ -29,7 +29,7 @@
|
||||
###
|
||||
|
||||
"""
|
||||
UNO: the uno card game for Limnoria.
|
||||
UNO: the UNO card game for Limnoria.
|
||||
"""
|
||||
|
||||
import supybot
|
||||
@ -62,7 +62,7 @@ if world.testing:
|
||||
from . import test
|
||||
|
||||
Class = plugin.Class
|
||||
Uno = config.Uno
|
||||
UNO = config.UNO
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
@ -32,7 +32,7 @@ import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
_ = PluginInternationalization('Uno')
|
||||
_ = PluginInternationalization('UNO')
|
||||
except:
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
@ -44,8 +44,8 @@ def configure(advanced):
|
||||
# user or not. You should effect your configuration by manipulating the
|
||||
# registry as appropriate.
|
||||
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:
|
@ -43,18 +43,18 @@ import pickle
|
||||
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
_ = PluginInternationalization('Uno')
|
||||
_ = PluginInternationalization('UNO')
|
||||
except ImportError:
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
_ = lambda x: x
|
||||
|
||||
class Uno(callbacks.Plugin):
|
||||
class UNO(callbacks.Plugin):
|
||||
"""
|
||||
Uno!
|
||||
UNO!
|
||||
"""
|
||||
threaded = True
|
||||
|
||||
|
||||
game=[{},{},{},{},{}]
|
||||
|
||||
channeloptions = {}
|
||||
@ -65,9 +65,9 @@ class Uno(callbacks.Plugin):
|
||||
channeloptions['maxbots']=9
|
||||
channeloptions['use_colors']=True
|
||||
channeloptions['use_notice']=True
|
||||
|
||||
|
||||
lastgame=time.time()
|
||||
|
||||
|
||||
def make_sure_path_exists(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
@ -80,9 +80,8 @@ class Uno(callbacks.Plugin):
|
||||
prefixChar = conf.supybot.reply.whenAddressedBy.chars()[0]
|
||||
|
||||
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:
|
||||
self._read_options(irc)
|
||||
@ -109,7 +108,7 @@ class Uno(callbacks.Plugin):
|
||||
gametype=self.game[table].get('type').capitalize()
|
||||
irc.reply('Error: You are already in a game of %s.' % gametype)
|
||||
return
|
||||
|
||||
|
||||
table=self._getopentable()
|
||||
if table==None:
|
||||
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.game[table]['channel']=msg.args[0]
|
||||
self.game[table]['type']=gametype
|
||||
|
||||
|
||||
|
||||
if gametype=='uno':
|
||||
self.game[table]['players'][nick]={}
|
||||
#self.game[table]['nplayers']=int(self.channeloptions[gametype+'_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)
|
||||
self.game[table]['phase']='join'
|
||||
|
||||
|
||||
start = wrap(start, ['public', optional('something')])
|
||||
|
||||
def begin(self, irc, msg, args):
|
||||
"""
|
||||
begin uno game
|
||||
Begin the UNO game.
|
||||
"""
|
||||
self._uno_begin(irc, msg.nick)
|
||||
begin = wrap(begin)
|
||||
|
||||
def _uno_begin(self, irc, nick):
|
||||
"""
|
||||
test
|
||||
"""
|
||||
table=self._gettablefromnick(nick)
|
||||
if table == None:
|
||||
irc.reply('Error: You are not playing a game at any of the tables.')
|
||||
return
|
||||
if self.game[table]['type'] != 'uno':
|
||||
irc.reply('Error: Not an Uno game.')
|
||||
irc.reply('Error: Not an UNO game.')
|
||||
return
|
||||
if self.game[table]['phase'] != 'join':
|
||||
irc.reply("Error: You can't use this command right now.")
|
||||
return
|
||||
nplayers= list(self.game[table]['players'].keys())
|
||||
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
|
||||
# start things for real
|
||||
for n in list(self.game[table]['players'].keys()):
|
||||
@ -178,15 +173,11 @@ class Uno(callbacks.Plugin):
|
||||
self._uno_cpu_play(irc, table)
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
|
||||
def _uno_tell_status(self, irc, nick):
|
||||
"""
|
||||
test
|
||||
"""
|
||||
table=self._gettablefromnick(nick)
|
||||
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
|
||||
channel=self.game[table]['channel']
|
||||
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:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
unocolors=['Blue','Green','Red','Yellow']
|
||||
for color in unocolors:
|
||||
if color in card:
|
||||
@ -300,21 +291,13 @@ class Uno(callbacks.Plugin):
|
||||
|
||||
def tellstatus(self, irc, msg, args):
|
||||
"""
|
||||
?
|
||||
Tell current UNO status
|
||||
"""
|
||||
self._uno_tell_status(irc, msg.nick)
|
||||
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):
|
||||
"""takes no arguments
|
||||
"""
|
||||
Display rules for uno. Start a game of uno with the "uno start" command.
|
||||
"""
|
||||
if text:
|
||||
@ -322,15 +305,14 @@ class Uno(callbacks.Plugin):
|
||||
else:
|
||||
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:
|
||||
irc.reply('Unknown game type.')
|
||||
rules=wrap(rules, [additional('text')])
|
||||
|
||||
|
||||
def join(self, irc, msg, args, table, fakenick):
|
||||
"""[<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.
|
||||
"""
|
||||
try:
|
||||
@ -391,11 +373,11 @@ class Uno(callbacks.Plugin):
|
||||
self.game[table]['players'][nick]={}
|
||||
if isfake==True:
|
||||
self.game[table]['players'][nick]['fake']=True
|
||||
|
||||
|
||||
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'])
|
||||
return
|
||||
|
||||
|
||||
for n in list(self.game[table]['players'].keys()):
|
||||
self.game[table]['players'][n]['hand']=[]
|
||||
# each player draws 7 initial cards
|
||||
@ -420,9 +402,8 @@ class Uno(callbacks.Plugin):
|
||||
join = wrap(join, ['public', optional('int'), optional('something')])
|
||||
|
||||
def leave(self, irc, msg, args, fakenick):
|
||||
"""takes no arguments
|
||||
|
||||
Leave a game of Uno.
|
||||
"""
|
||||
Leave a game of UNO.
|
||||
"""
|
||||
try:
|
||||
self._read_options(irc)
|
||||
@ -439,7 +420,7 @@ class Uno(callbacks.Plugin):
|
||||
if table==None:
|
||||
irc.reply('Error: You are not playing a game at any of the tables.')
|
||||
return
|
||||
|
||||
|
||||
if self.game[table].get('type')=='uno':
|
||||
self._leavegame(irc, msg, nick)
|
||||
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')])
|
||||
|
||||
def _leavegame(self, irc, msg, nick):
|
||||
"""takes no arguments
|
||||
|
||||
Leave a game of Uno.
|
||||
"""
|
||||
Leave a game of UNO.
|
||||
"""
|
||||
try:
|
||||
self._read_options(irc)
|
||||
@ -462,29 +442,28 @@ class Uno(callbacks.Plugin):
|
||||
table=self._gettablefromnick(nick)
|
||||
if table==None:
|
||||
return
|
||||
|
||||
|
||||
|
||||
channel=self.game[table]['channel']
|
||||
|
||||
|
||||
# leaving a game when you're the only player
|
||||
if len(self.game[table]['players'])==1:
|
||||
irc.reply('There are no more players; The game is over.', to=channel)
|
||||
self.game[table]['phase']='gameover'
|
||||
self._cleanup(table)
|
||||
return
|
||||
|
||||
|
||||
# check if it's only bot players left
|
||||
Human=False
|
||||
for n in list(self.game[table]['players'].keys()):
|
||||
if not self.game[table]['players'][n].get('cpu'):
|
||||
if n!=nick: Human=True
|
||||
|
||||
|
||||
if not Human:
|
||||
irc.reply('There are no more human players; the game is over.', to=channel)
|
||||
self.game[table]['phase']='gameover'
|
||||
self._cleanup(table)
|
||||
return
|
||||
|
||||
|
||||
# ---- replace with cpu ----
|
||||
oldnick=nick
|
||||
nick=self._uno_make_cpu(table)
|
||||
@ -551,18 +530,18 @@ class Uno(callbacks.Plugin):
|
||||
|
||||
def _uno_cpu_play(self, irc, table):
|
||||
channel=self.game[table]['channel']
|
||||
|
||||
|
||||
Human=False
|
||||
for n in list(self.game[table]['players'].keys()):
|
||||
if not self.game[table]['players'][n].get('cpu'):
|
||||
Human=True
|
||||
|
||||
|
||||
if not Human:
|
||||
irc.reply('There are no more human players; the game is over.', to=channel)
|
||||
self.game[table]['phase']='gameover'
|
||||
self._cleanup(table)
|
||||
return
|
||||
|
||||
|
||||
nick=list(self.game[table]['players'].keys())[self.game[table]['turn']]
|
||||
discard=self.game[table]['discard'][-1]
|
||||
wildcolor = self.game[table].get('wildcolor')
|
||||
@ -574,7 +553,7 @@ class Uno(callbacks.Plugin):
|
||||
# draw a card
|
||||
card=self._uno_draw_card(table, nick)
|
||||
self.game[table]['players'][nick]['hasdrawn']=True
|
||||
|
||||
|
||||
if self._uno_is_valid_play(table, card, discard, wildcolor)==True:
|
||||
# always play the card if possible
|
||||
ncards=len(self.game[table]['players'][nick]['hand'])
|
||||
@ -651,12 +630,11 @@ class Uno(callbacks.Plugin):
|
||||
|
||||
def play(self, irc, msg, args, text):
|
||||
"""<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
|
||||
|
||||
|
||||
table=self._gettablefromnick(nick)
|
||||
if table==None:
|
||||
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]
|
||||
nick=fakenick
|
||||
text=text.rsplit(' ',1)[:-1][0]
|
||||
|
||||
|
||||
if self.game[table]['phase']=='running':
|
||||
nplayers=len(list(self.game[table]['players'].keys()))
|
||||
if nick not in self.game[table]['players']:
|
||||
irc.reply("Error: You're not playing this game.")
|
||||
return
|
||||
opponent=[p for p in self.game[table]['players'] if p !=nick][0]
|
||||
|
||||
|
||||
turnplayer=list(self.game[table]['players'].keys())[self.game[table]['turn']]
|
||||
if nick!=turnplayer:
|
||||
# Note: it will prefix nick in notice -- need to fix that
|
||||
irc.reply("%s: It is %s's turn." % (nick, turnplayer), prefixNick=False)
|
||||
return
|
||||
|
||||
|
||||
text=text.strip()
|
||||
|
||||
|
||||
discard=self.game[table]['discard'][-1]
|
||||
wildcolor=self.game[table].get('wildcolor')
|
||||
novalid=True
|
||||
|
||||
|
||||
for c in self.game[table]['players'][nick]['hand']:
|
||||
if self._uno_is_valid_play(table, c, discard, wildcolor)==True:
|
||||
novalid=False
|
||||
|
||||
|
||||
if text.lower()=='draw':
|
||||
if self.game[table]['players'][nick].get('hasdrawn')==True:
|
||||
irc.reply('You have already drawn a card.')
|
||||
@ -742,9 +720,9 @@ class Uno(callbacks.Plugin):
|
||||
self._uno_tell_status(irc, nn)
|
||||
self._uno_do_cpu(irc, table)
|
||||
return
|
||||
|
||||
|
||||
card=text
|
||||
|
||||
|
||||
card=[card for card in self.unodeck if card.lower()==text.lower()]
|
||||
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']
|
||||
@ -769,16 +747,16 @@ class Uno(callbacks.Plugin):
|
||||
if card not in hand:
|
||||
irc.reply('That card is not in your hand.')
|
||||
return
|
||||
|
||||
|
||||
# check for illegal move
|
||||
if self._uno_is_valid_play(table, card, discard, wildcolor)==False:
|
||||
irc.reply("You can't play that card.")
|
||||
return
|
||||
|
||||
|
||||
# play the card
|
||||
self.game[table]['players'][nick]['hand'].remove(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:
|
||||
self.game[table]['wildcolor']=newcolor
|
||||
card='%s (%s)' % (card, self.game[table]['wildcolor'])
|
||||
@ -802,7 +780,7 @@ class Uno(callbacks.Plugin):
|
||||
self.game[table]['players'][nick]['hasdrawn']=False
|
||||
else:
|
||||
irc.reply('%s played %s (%s cards left in hand).' % (nick, card, ncards), to=channel)
|
||||
|
||||
|
||||
ncards = len(self.game[table]['players'][nick]['hand'])
|
||||
if ncards==0:
|
||||
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:
|
||||
self.game[table]['direction']*=-1
|
||||
|
||||
|
||||
turn=self.game[table]['turn']+1*self.game[table]['direction']
|
||||
if turn>nplayers-1:turn=0
|
||||
if turn<0:turn=nplayers-1
|
||||
@ -844,9 +822,9 @@ class Uno(callbacks.Plugin):
|
||||
|
||||
def setoption(self, irc, msg, args, channel, text, value):
|
||||
"""<option> <value>
|
||||
|
||||
Changes an option for Uno game. You can view the
|
||||
options for the current channel with the "uno showoptions" command."""
|
||||
Changes an option for UNO game. You can view the
|
||||
options for the current channel with the "uno showoptions" command.
|
||||
"""
|
||||
try:
|
||||
self._read_options(irc)
|
||||
except:
|
||||
@ -879,9 +857,9 @@ class Uno(callbacks.Plugin):
|
||||
setoption = wrap(setoption, [('checkChannelCapability', 'op'), 'something', 'something'])
|
||||
|
||||
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:
|
||||
self._read_options(irc)
|
||||
except:
|
||||
@ -918,7 +896,7 @@ class Uno(callbacks.Plugin):
|
||||
network=irc.network.replace(' ','_')
|
||||
channel=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)
|
||||
if os.path.isfile(f):
|
||||
inputfile = open(f, "rb")
|
||||
@ -969,7 +947,7 @@ class Uno(callbacks.Plugin):
|
||||
if msg.args[0] == self.game[table]['channel']:
|
||||
self._leavegame(irc, msg, nick)
|
||||
self._uno_do_cpu(irc, table) # only works if game type is uno
|
||||
|
||||
|
||||
def doKick(self, irc, msg):
|
||||
(channel, nicks) = msg.args[:2]
|
||||
nicks=nicks.split(',')
|
||||
@ -1009,6 +987,6 @@ class Uno(callbacks.Plugin):
|
||||
m=ircmsgs.privmsg(to, text)
|
||||
self._sendMsg(irc, m)
|
||||
|
||||
Class = Uno
|
||||
Class = UNO
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
@ -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 ====
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
###
|
||||
|
||||
"""
|
||||
Undercut: a card game plugin for multiple players
|
||||
Undercut: a psychological numbers game for multiple players.
|
||||
"""
|
||||
|
||||
import supybot
|
||||
|
@ -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
|
||||
|
||||
@ -8,3 +8,6 @@ Logs into Undernet's X Service
|
||||
|
||||
* If you want your bot to /mode +x on login, make sure to set
|
||||
`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.
|
||||
|
@ -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
|
||||
|
||||
Returns info on a unicode symbol such as emoji. Returning name, hex/html values, etc.
|
||||
|
||||
usage: unicode <symbol>
|
||||
|
@ -1 +1,3 @@
|
||||
Retrieve definitions from the Urban Dictionary.
|
||||
|
||||
Forked from https://github.com/reticulatingspline/UrbanDictionary
|
||||
|
@ -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/
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
Retrieve info from WolframAlpha based on your queries.
|
||||
|
||||
Forked from https://github.com/ormanya/Supyiel/tree/master/WolframAlpha
|
||||
|
||||
# Limnoria plugin for WolframAlpha
|
||||
|
@ -1,3 +1,5 @@
|
||||
Various word games for IRC.
|
||||
|
||||
Froked from https://github.com/mmueller/supybot-wordgames
|
||||
|
||||
Working with Python3 and Limnoria.
|
||||
|
@ -1,3 +1,5 @@
|
||||
Retrieve current time and time zone information for various locations.
|
||||
|
||||
# Limnoria plugin for WorldTime
|
||||
|
||||
Forked from https://github.com/reticulatingspline/WorldTime
|
||||
|
Loading…
x
Reference in New Issue
Block a user