Added 666 support, memes. Tweaked runloop

This commit is contained in:
Jacob Henry 2016-11-29 04:18:01 +00:00
parent f4dc6e06a5
commit 5871cfde9e
2 changed files with 24 additions and 3 deletions

View File

@ -16,9 +16,27 @@ def handleTrueScrollMsg(slack, msg):
response = "Could not parse your query. Please invoke as \"truescroll <scroll#>\"" response = "Could not parse your query. Please invoke as \"truescroll <scroll#>\""
else: else:
num = m.group(1) num = m.group(1)
brotherScroll = getBrotherScroll(num) brotherScroll = getBrotherScroll(num)
trueScroll = getTrueScroll(num) trueScroll = getTrueScroll(num)
#Correct for 666 (thanks TREVOR)
#Offset broscroll by one if >= 666
if int(brotherScroll) >= 666:
brotherScroll = getBrotherScroll(str(int(num) + 1))
#Offset truescroll in opposite direction
if int(num) > 666:
trueScroll -= 1
#Memes
if int(num) == 666:
trueScroll = "spookiest"
elif "3" in num:
trueScroll = "worst"
response = "The brother with scroll {0} is in fact the {1} brother to sign\n" response = "The brother with scroll {0} is in fact the {1} brother to sign\n"
response += "The {2} brother to sign will have scroll {3}\n" response += "The {2} brother to sign will have scroll {3}\n"
@ -30,14 +48,17 @@ def handleTrueScrollMsg(slack, msg):
brotherNums = [str(x) for x in range(10) if (not x == 3)] brotherNums = [str(x) for x in range(10) if (not x == 3)]
trueNums = [str(x) for x in range(10)] trueNums = [str(x) for x in range(10)]
#Returns string
def getTrueScroll(brotherScroll): def getTrueScroll(brotherScroll):
return convertBase(brotherScroll, brotherNums, trueNums) return convertBase(brotherScroll, brotherNums, trueNums)
#Returns string
def getBrotherScroll(trueScroll): def getBrotherScroll(trueScroll):
return convertBase(trueScroll, trueNums, brotherNums) return convertBase(trueScroll, trueNums, brotherNums)
#Returns string
def convertBase(numStr, srcBaseNums, targBaseNums): def convertBase(numStr, srcBaseNums, targBaseNums):
#Returns int value #Returns int value
def numberFromBase(ns, numerals): def numberFromBase(ns, numerals):
@ -57,7 +78,7 @@ def convertBase(numStr, srcBaseNums, targBaseNums):
return total return total
#Returns string array, each elt is the corresponding numeral #Returns string, each elt is the corresponding numeral
def numberToBase(n, numerals): def numberToBase(n, numerals):
if n==0: if n==0:
return [0] return [0]

View File

@ -6,8 +6,8 @@
while : while :
do do
echo "Press [CTRL+C] to stop..." echo "Press [CTRL+C] to stop..."
sleep 5
python3 WaitonBot.py
sleep 1 sleep 1
python3 WaitonBot.py
sleep 3
python3 CallOfTheVoid.py python3 CallOfTheVoid.py
done done