mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
Changed numberwang_bot changed the twee. backup the scores
This commit is contained in:
1 parent
2eb87eb522
commit
9ecd97dff1
6 files changed
+35
-53
No files matched your search
@@ -1,8 +0,0 @@
|
|||||||
Traceback (most recent call last):
|
|
||||||
File "./topicbot.py", line 187, in <module>
|
|
||||||
listen()
|
|
||||||
File "./topicbot.py", line 161, in listen
|
|
||||||
get_topic(channel, user, time)
|
|
||||||
File "./topicbot.py", line 61, in get_topic
|
|
||||||
with open("topics_" + channel + ".txt", "r") as topics:
|
|
||||||
IOError: [Errno 2] No such file or directory: 'topics_topicbot.txt'
|
|
||||||
+14
-11
@@ -1,16 +1,19 @@
|
|||||||
krowbar&^%8&^%1422035087
|
krowbar&^%33&^%1422565422
|
||||||
karlen&^%13&^%1422027689
|
karlen&^%15&^%1422291058
|
||||||
endorphant&^%26&^%1422033378
|
endorphant&^%62&^%1422561985
|
||||||
jumblesale&^%18&^%1422027769
|
jumblesale&^%18&^%1422027769
|
||||||
marcus&^%12&^%1421960027
|
marcus&^%12&^%1421960027
|
||||||
papa&^%5&^%1422029014
|
papa&^%41&^%1422542104
|
||||||
epicmorphism&^%3&^%1421937744
|
epicmorphism&^%3&^%1421937744
|
||||||
audy&^%13&^%1422034301
|
audy&^%27&^%1422542589
|
||||||
kc&^%5&^%1421975132
|
kc&^%16&^%1422326056
|
||||||
vilmibm&^%3&^%1421887627
|
vilmibm&^%3&^%1421887627
|
||||||
cmr&^%4&^%1421989946
|
cmr&^%6&^%1422388018
|
||||||
imt&^%12&^%1422014172
|
imt&^%95&^%1422565426
|
||||||
cndorphant&^%22&^%1422033254
|
cndorphant&^%125&^%1422395920
|
||||||
rain&^%4&^%1422034265
|
rain&^%15&^%1422310975
|
||||||
sl2c&^%6&^%1422036167
|
sl2c&^%28&^%1422524176
|
||||||
leni&^%2&^%1421978450
|
leni&^%2&^%1421978450
|
||||||
|
selfsame&^%1&^%1422230012
|
||||||
|
bear&^%46&^%1422561755
|
||||||
|
coaxial&^%4&^%1422325983
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
krowbar&^%21&^%22
|
krowbar&^%21&^%23
|
||||||
um&^%11&^%8
|
um&^%11&^%8
|
||||||
kc&^%0&^%22
|
kc&^%0&^%22
|
||||||
marcus&^%3&^%1
|
marcus&^%3&^%1
|
||||||
khoi&^%1&^%0karlen&^%0&^%1karlen&^%0&^%1jumblesale&^%1&^%0karlen&^%0&^%1karlen&^%0&^%1karlen&^%0&^%1dan&^%1&^%0datagrok&^%0&^%1vilmibm&^%0&^%1papa&^%1&^%0vilmibm&^%1&^%0vilmibm&^%0&^%1jumblesale&^%1&^%0selfsame&^%1&^%0karlen&^%0&^%1jumblesale&^%0&^%1karlen&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1
|
khoi&^%1&^%0karlen&^%0&^%1karlen&^%0&^%1jumblesale&^%1&^%0karlen&^%0&^%1karlen&^%0&^%1karlen&^%0&^%1dan&^%1&^%0datagrok&^%0&^%1vilmibm&^%0&^%1papa&^%1&^%0vilmibm&^%1&^%0vilmibm&^%0&^%1jumblesale&^%1&^%0selfsame&^%1&^%0karlen&^%0&^%1jumblesale&^%0&^%1karlen&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1jumblesale&^%1&^%0
|
||||||
+13
-27
@@ -35,6 +35,7 @@ MIN_ROUNDS = 5
|
|||||||
MAX_ROUNDS = 12
|
MAX_ROUNDS = 12
|
||||||
SCORE_FILE = "numberwangscores.txt"
|
SCORE_FILE = "numberwangscores.txt"
|
||||||
SHOW_TOP_NUM = 5
|
SHOW_TOP_NUM = 5
|
||||||
|
GOOD_CHAN = "#bots"
|
||||||
|
|
||||||
roundsLeft = 0
|
roundsLeft = 0
|
||||||
bonusRound = 0
|
bonusRound = 0
|
||||||
@@ -68,6 +69,10 @@ def hello():
|
|||||||
ircsock.send("PRIVMSG "+ channel +" :Hello!\n")
|
ircsock.send("PRIVMSG "+ channel +" :Hello!\n")
|
||||||
|
|
||||||
def start_numberwang(channel, user):
|
def start_numberwang(channel, user):
|
||||||
|
if(channel != "#bots"):
|
||||||
|
ircsock.send("PRIVMSG " + channel + " :Numberwang has been disabled for " + channel + " due to spamminess. Please join " + GOOD_CHAN + " to start a game.\n")
|
||||||
|
return
|
||||||
|
|
||||||
print user + " started a game"
|
print user + " started a game"
|
||||||
resetGlobals()
|
resetGlobals()
|
||||||
ircsock.send("PRIVMSG " + channel + " :It's time for Numberwang!\n")
|
ircsock.send("PRIVMSG " + channel + " :It's time for Numberwang!\n")
|
||||||
@@ -190,29 +195,6 @@ def show_user_score(channel, user):
|
|||||||
#if we don't find a score line
|
#if we don't find a score line
|
||||||
ircsock.send("PRIVMSG " + channel + " :" + user + ": You haven't scored any points yet!\n")
|
ircsock.send("PRIVMSG " + channel + " :" + user + ": You haven't scored any points yet!\n")
|
||||||
|
|
||||||
def give_tilde(channel, user, time):
|
|
||||||
found = False
|
|
||||||
with open("tildescores.txt", "r+") as scorefile:
|
|
||||||
scores = scorefile.readlines()
|
|
||||||
scorefile.seek(0)
|
|
||||||
scorefile.truncate()
|
|
||||||
for score in scores:
|
|
||||||
person = score.strip("\n").split("&^%")
|
|
||||||
if(person[0] == user):
|
|
||||||
found = True
|
|
||||||
if(too_recent(time, person[2])):
|
|
||||||
ircsock.send("PRIVMSG " + channel + " :You have asked for a tilde too recently. Try again later.\n")
|
|
||||||
else:
|
|
||||||
prize = get_prize(user)
|
|
||||||
score = person[0] + "&^%" + str(int(person[1]) + prize[0]) + "&^%" + time + "\n"
|
|
||||||
ircsock.send("PRIVMSG " + channel + " :" + prize[1] + "\n")
|
|
||||||
scorefile.write(score)
|
|
||||||
if(not found):
|
|
||||||
prize = get_prize(user)
|
|
||||||
ircsock.send("PRIVMSG " + channel + " :Welcome to the tilde game! Here's " + p.number_to_words(prize[0]+1) + " free tilde(s) to start you off.\n")
|
|
||||||
scorefile.write(user + "&^%" + str(prize[0]+1) + "&^%" + time + "\n")
|
|
||||||
|
|
||||||
|
|
||||||
def rollcall(channel):
|
def rollcall(channel):
|
||||||
ircsock.send("PRIVMSG "+ channel +" :Is it time for Numberwang? It might be! Start a new game with !numberwang or stop a current game with !wangernumb Get your score with !myscore and the list of top wangers with !topwangers\n")
|
ircsock.send("PRIVMSG "+ channel +" :Is it time for Numberwang? It might be! Start a new game with !numberwang or stop a current game with !wangernumb Get your score with !myscore and the list of top wangers with !topwangers\n")
|
||||||
|
|
||||||
@@ -222,6 +204,7 @@ def connect(server, channel, botnick):
|
|||||||
ircsock.send("NICK "+ botnick +"\n")
|
ircsock.send("NICK "+ botnick +"\n")
|
||||||
|
|
||||||
joinchan(channel)
|
joinchan(channel)
|
||||||
|
joinchan(GOOD_CHAN)
|
||||||
|
|
||||||
def get_user_from_message(msg):
|
def get_user_from_message(msg):
|
||||||
try:
|
try:
|
||||||
@@ -256,10 +239,13 @@ def listen():
|
|||||||
|
|
||||||
if ircmsg.find(":!numberwang") != -1 and roundsLeft == 0:
|
if ircmsg.find(":!numberwang") != -1 and roundsLeft == 0:
|
||||||
start_numberwang(channel, user)
|
start_numberwang(channel, user)
|
||||||
if ircmsg.find(":!wangernumb") != -1 and roundsLeft > 0:
|
|
||||||
stop_numberwang(channel, user)
|
if channel == GOOD_CHAN:
|
||||||
if roundsLeft > 0:
|
if ircmsg.find(":!wangernumb") != -1 and roundsLeft > 0:
|
||||||
guess_numberwang(channel, user, messageText)
|
stop_numberwang(channel, user)
|
||||||
|
if roundsLeft > 0:
|
||||||
|
guess_numberwang(channel, user, messageText)
|
||||||
|
|
||||||
if ircmsg.find(":!topwangers") != -1:
|
if ircmsg.find(":!topwangers") != -1:
|
||||||
show_highscores(channel)
|
show_highscores(channel)
|
||||||
if ircmsg.find(":!myscore") != -1:
|
if ircmsg.find(":!myscore") != -1:
|
||||||
|
|||||||
@@ -8,5 +8,6 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="twine2/">Twine 2.0</a></li>
|
<li><a href="twine2/">Twine 2.0</a></li>
|
||||||
<li><a href="mission/">Mission name generator</a></li>
|
<li><a href="mission/">Mission name generator</a></li>
|
||||||
|
<li><a href="Grimoire/">Grimoire: The Pathfinder Item Roller</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
+5
-5
@@ -55,7 +55,7 @@ There is a thick layer of dust on everything within the cottage. Very little lig
|
|||||||
<<if not $events["krowbar-cottageOpenWindows"]>>The [[window frames|krowbar-CottageOpenWindows]] have been boarded up.
|
<<if not $events["krowbar-cottageOpenWindows"]>>The [[window frames|krowbar-CottageOpenWindows]] have been boarded up.
|
||||||
<<if not $items["crowbar"]>> If you had the right tool, you could probably remove them.
|
<<if not $items["crowbar"]>> If you had the right tool, you could probably remove them.
|
||||||
<<else>>[[Open windows with crowbar|krowbar-CottageOpenWindows]]<<endif>>
|
<<else>>[[Open windows with crowbar|krowbar-CottageOpenWindows]]<<endif>>
|
||||||
<<else>>The windows are now letting in enough light to let you see [[some cubbards|krowbar-CottageSearchCubbards]].<<endif>>
|
<<else>>The windows are now letting in enough light to let you see [[some cupboards|krowbar-CottageSearchcupboards]].<<endif>>
|
||||||
[[Leave cottage|krowbar-FollowPath2]]
|
[[Leave cottage|krowbar-FollowPath2]]
|
||||||
|
|
||||||
:: krowbar-CottageOpenWindows
|
:: krowbar-CottageOpenWindows
|
||||||
@@ -63,13 +63,13 @@ After a few minutes of effort, you manage to use the crowbar to remove the board
|
|||||||
[[Return|previous()]]
|
[[Return|previous()]]
|
||||||
<<set $events["krowbar-cottageOpenWindows"] to true>>
|
<<set $events["krowbar-cottageOpenWindows"] to true>>
|
||||||
|
|
||||||
:: krowbar-CottageSearchCubbards
|
:: krowbar-CottageSearchCupboards
|
||||||
<<if visited("krowbar-CottageSearchCubbards") lte 1>>
|
<<if visited("krowbar-CottageSearchCupboards") lte 1>>
|
||||||
After rummaging around the cubbards, you find a rusty cleaver and <<$krowbar_temp1 to random(2,5)>> coins.
|
After rummaging around the cupboards, you find a rusty cleaver and <<$krowbar_temp1 to random(2,5)>> coins.
|
||||||
[[Return|previous()]]
|
[[Return|previous()]]
|
||||||
<<set $items['cleaver'] to true>>
|
<<set $items['cleaver'] to true>>
|
||||||
<<set $items['gold'] += $krowbar_temp1>>
|
<<set $items['gold'] += $krowbar_temp1>>
|
||||||
<<else>>You don't find anything else of value in the cubbards.
|
<<else>>You don't find anything else of value in the cupboards.
|
||||||
[[Return|previous()]]
|
[[Return|previous()]]
|
||||||
<<endif>>
|
<<endif>>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user