This commit is contained in:
Nikolaj Danger
2020-08-04 11:08:18 +02:00
parent 96c5d37e4f
commit 85b093cc18
5 changed files with 16 additions and 13 deletions

View File

@ -10,7 +10,7 @@ import random
#import math #import math
import os import os
from funcs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, emojiToNumber, fiarReactionTest, deleteGame, stopServer, checkBalance, giveMoney, triviaCountPoints, triviaStart, triviaAnswer, blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit, parseFourInARow, fourInARowAI, spellFunc, monsterFunc, nameGen, tavernGen, movieFunc, roll_dice, parseChar, parseRoll, critRoll, parseDestiny from funcs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, emojiToNumber, fiarReactionTest, deleteGame, stopServer, checkBalance, giveMoney, triviaCountPoints, triviaStart, triviaAnswer, blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit, parseFourInARow, fourInARowAI, spellFunc, monsterFunc, nameGen, tavernGen, movieFunc, roll_dice, parseChar, parseRoll, critRoll, parseDestiny, parseHex
from gameLoops import fiar, blackjackLoop from gameLoops import fiar, blackjackLoop
@ -564,11 +564,11 @@ async def parseCommands(message,content):
# Runs a game of Hex # Runs a game of Hex
elif content.startswith("hex"): elif content.startswith("hex"):
try: #try:
command = content.replace("hex","") command = content.replace("hex","")
await hex(message.channel,command,message.author.display_name) await parseHex(command,str(message.channel),message.author.display_name)
except: #except:
logThis("Something went wrong (error code 1500)") # logThis("Something went wrong (error code 1500)")
# Not a command # Not a command
else: else:

View File

@ -1,10 +1,10 @@
"""A collection of all Gwendolyn functions.""" """A collection of all Gwendolyn functions."""
__all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToNumber", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseFourInARow", "fourInARowAI", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny"] __all__ = ["helloFunc", "cap", "imageFunc", "logThis", "findWikiPage", "makeFiles", "emojiToNumber", "fiarReactionTest", "deleteGame", "stopServer", "checkBalance", "giveMoney", "addMoney", "triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseFourInARow", "fourInARowAI", "spellFunc", "monsterFunc", "nameGen", "tavernGen", "movieFunc", "roll_dice", "parseChar", "parseRoll", "critRoll", "parseDestiny","parseHex"]
from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToNumber, fiarReactionTest, deleteGame, stopServer from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToNumber, fiarReactionTest, deleteGame, stopServer
from .games import checkBalance, giveMoney, addMoney, triviaCountPoints, triviaStart, triviaAnswer, blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit, parseFourInARow, fourInARowAI from .games import checkBalance, giveMoney, addMoney, triviaCountPoints, triviaStart, triviaAnswer, blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit, parseFourInARow, fourInARowAI, parseHex
from .lookup import spellFunc, monsterFunc from .lookup import spellFunc, monsterFunc

View File

@ -1,8 +1,9 @@
"""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", "parseFourInARow", "fourInARowAI"] __all__ = ["checkBalance", "giveMoney", "addMoney","triviaCountPoints", "triviaStart", "triviaAnswer", "blackjackShuffle", "blackjackStart", "blackjackPlayerDrawHand", "blackjackContinue", "blackjackFinish", "blackjackHit", "blackjackStand", "blackjackDouble", "blackjackSplit", "parseFourInARow", "fourInARowAI", "parseHex"]
from .money import checkBalance, giveMoney, addMoney from .money import checkBalance, giveMoney, addMoney
from .trivia import triviaCountPoints, triviaStart, triviaAnswer from .trivia import triviaCountPoints, triviaStart, triviaAnswer
from .blackjack import blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit from .blackjack import blackjackShuffle, blackjackStart, blackjackPlayerDrawHand, blackjackContinue, blackjackFinish, blackjackHit, blackjackStand, blackjackDouble, blackjackSplit
from .fourInARow import parseFourInARow, fourInARowAI from .fourInARow import parseFourInARow, fourInARowAI
from .hex import parseHex

View File

@ -31,12 +31,14 @@ def fourInARowStart(channel, user, opponent):
if opponent in ["1","2","3","4","5"]: if opponent in ["1","2","3","4","5"]:
difficulty = int(opponent) difficulty = int(opponent)
diffText = " with difficulty "+opponent
opponent = "Gwendolyn" opponent = "Gwendolyn"
elif opponent in ["0","6","7","8","9","10","69","100","420"]: elif opponent in ["0","6","7","8","9","10","69","100","420"]:
return "That difficulty doesn't exist", False, False, False, False return "That difficulty doesn't exist", False, False, False, False
else: else:
# Opponent is another player # Opponent is another player
difficulty = "NA" difficulty = None
diffText = ""
board = [ [ 0 for i in range(columnCount) ] for j in range(rowCount) ] board = [ [ 0 for i in range(columnCount) ] for j in range(rowCount) ]
players = [user,opponent] players = [user,opponent]
@ -55,7 +57,7 @@ def fourInARowStart(channel, user, opponent):
if players[0] == "Gwendolyn": if players[0] == "Gwendolyn":
gwendoTurn = True gwendoTurn = True
return "Started game against "+opponent+". It's "+players[0]+"'s turn", True, False, False, gwendoTurn return "Started game against "+opponent+diffText+". It's "+players[0]+"'s turn", True, False, False, gwendoTurn
else: else:
return "There's already a 4 in a row game going on in this channel", False, False, False, False return "There's already a 4 in a row game going on in this channel", False, False, False, False
else: else:

View File

@ -55,7 +55,7 @@ def hexStart(channel, user, opponent):
return "That difficulty doesn't exist", False, False, False, False return "That difficulty doesn't exist", False, False, False, False
else: else:
# Opponent is another player # Opponent is another player
difficulty = "NA" difficulty = None
board = [ [ 0 for i in range(columnCount) ] for j in range(rowCount) ] board = [ [ 0 for i in range(columnCount) ] for j in range(rowCount) ]
players = [user,opponent] players = [user,opponent]