This commit is contained in:
NikolajDanger
2020-08-07 18:01:47 +02:00
parent 5839cd5a8f
commit 5a4eebdd7b
6 changed files with 14 additions and 14 deletions

View File

@@ -75,7 +75,7 @@ class GamesCog(commands.Cog):
else: else:
logThis("I didn't understand that (error code 1101)",str(ctx.message.channel.id)) logThis("I didn't understand that (error code 1101)",str(ctx.message.channel.id))
await ctx.send("I didn't understand that (error code 1101)") await ctx.send("I didn't understand that (error code 1101)")
# Runs a game of blackjack # Runs a game of blackjack
@commands.command(aliases = ["bj"]) @commands.command(aliases = ["bj"])
async def blackjack(self, ctx, *, content = ""): async def blackjack(self, ctx, *, content = ""):
@@ -257,22 +257,22 @@ class GamesCog(commands.Cog):
else: else:
logThis("Not a command (error code 1301)") logThis("Not a command (error code 1301)")
await ctx.send("I didn't quite understand that (error code 1301)") await ctx.send("I didn't quite understand that (error code 1301)")
# Runs a game of Connect four # Runs a game of Connect four
@commands.command(aliases = ["fiar","connect4","connectfour","4iar","4inarow"]) @commands.command(aliases = ["fiar","connect4","connectfour","4iar","4inarow"])
async def fourinarow(self, ctx, *, content = ""): async def fourinarow(self, ctx, *, content = ""):
await fiar(ctx.message.channel,content,"#"+str(ctx.message.author.id)) await fiar(ctx.message.channel,content,"#"+str(ctx.message.author.id))
# Runs a game of Hex # Runs a game of Hex
@commands.command(name="hex") @commands.command(name="hex")
async def hexCommand(self, ctx, *, content = ""): async def hexCommand(self, ctx, *, content = ""):
await runHex(ctx.message.channel,content,"#"+str(ctx.message.author.id)) await runHex(ctx.message.channel,content,"#"+str(ctx.message.author.id))
# Runs a game of Monopoly # Runs a game of Monopoly
@commands.command(aliases = ["m","mon","mono"]) @commands.command(aliases = ["m","mon","mono"])
async def monopoly(self, ctx, *, content = ""): async def monopoly(self, ctx, *, content = ""):
await runMonopoly(ctx.message.channel,content,"#"+str(ctx.message.author.id)) await runMonopoly(ctx.message.channel,content,"#"+str(ctx.message.author.id))
# Runs a game of Hangman # Runs a game of Hangman
@commands.command(aliases = ["hm"]) @commands.command(aliases = ["hm"])
async def hangman(self, ctx, *, content = "start"): async def hangman(self, ctx, *, content = "start"):

View File

@@ -1,6 +1,6 @@
"""A collection of all Gwendolyn functions.""" """A collection of all Gwendolyn functions."""
__all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToCommand", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny", "addToDict", "getName", "getID", "replaceMultiple", "monopolyReactionTest","parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex"] __all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToCommand", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny", "addToDict", "getName", "getID", "replaceMultiple", "monopolyReactionTest","parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex", "runHangman"]
from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToCommand, fiarReactionTest, deleteGame, stopServer, addToDict, getName, getID, monopolyReactionTest from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToCommand, fiarReactionTest, deleteGame, stopServer, addToDict, getName, getID, monopolyReactionTest

View File

@@ -1,6 +1,6 @@
"""Functions for games Gwendolyn can play.""" """Functions for games Gwendolyn can play."""
__all__ = ["checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex"] __all__ = ["checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseInvest", "blackjackLoop", "fiar", "runMonopoly", "runHex", "runHangman"]
from .money import checkBalance, giveMoney, addMoney from .money import checkBalance, giveMoney, addMoney
from .trivia import triviaCountPoints, triviaStart, triviaAnswer from .trivia import triviaCountPoints, triviaStart, triviaAnswer

View File

@@ -6,7 +6,7 @@ from funcs import getName, logThis
def hangmanStart(channel,user): def hangmanStart(channel,user):
with open("resources/games/hangmanGames.json", "r") as f: with open("resources/games/hangmanGames.json", "r") as f:
data = json.load(f) data = json.load(f)
if channel not in data: if channel not in data:
with urllib.request.urlopen("https://random-word-api.herokuapp.com/word?number=10") as p: with urllib.request.urlopen("https://random-word-api.herokuapp.com/word?number=10") as p:
words = json.load(p) words = json.load(p)
@@ -37,7 +37,7 @@ def parseHangman(channel,user,command):
del data[channel] del data[channel]
with open("resources/games/hangmanGames.json", "w") as f: with open("resources/games/hangmanGames.json", "w") as f:
json.dump(data,f,indent=4) json.dump(data,f,indent=4)
return "Game stopped.", False, False, [] return "Game stopped.", False, False, []
else: else:
return "I didn't understand that", False, False, [] return "I didn't understand that", False, False, []

View File

@@ -56,7 +56,7 @@ def badCircle():
x = middle + (math.cos(math.radians(degree+start)) * (circleSize/2)) - (lineWidth/2) + devx x = middle + (math.cos(math.radians(degree+start)) * (circleSize/2)) - (lineWidth/2) + devx
y = middle + (math.sin(math.radians(degree+start)) * (circleSize/2)) - (lineWidth/2) + devy y = middle + (math.sin(math.radians(degree+start)) * (circleSize/2)) - (lineWidth/2) + devy
d.ellipse([(x,y),(x+lineWidth,y+lineWidth)],fill=(0,0,0,255)) d.ellipse([(x,y),(x+lineWidth,y+lineWidth)],fill=(0,0,0,255))
return background return background
@@ -176,7 +176,7 @@ def drawImage(channel):
man = drawMan(6) man = drawMan(6)
except: except:
logThis("Error drawing stick figure (error code 1712)") logThis("Error drawing stick figure (error code 1712)")
try: try:
man = man.resize((smolManx,smolMany)) man = man.resize((smolManx,smolMany))
except: except:
@@ -184,5 +184,5 @@ def drawImage(channel):
background.paste(gallow,(100,100),gallow) background.paste(gallow,(100,100),gallow)
background.paste(man,(280,210),man) background.paste(man,(280,210),man)
background.save("resources/games/hangmanBoards/hangmanBoard"+channel+".png") background.save("resources/games/hangmanBoards/hangmanBoard"+channel+".png")

View File

@@ -251,7 +251,7 @@ def stopServer():
with open("resources/games/hexGames.json", "w") as f: with open("resources/games/hexGames.json", "w") as f:
json.dump(emptyDict,f,indent=4) json.dump(emptyDict,f,indent=4)
with open("resources/games/hangmanGames.json", "w") as f: with open("resources/games/hangmanGames.json", "w") as f:
json.dump(emptyDict,f,indent=4) json.dump(emptyDict,f,indent=4)