From e9fc646207982f936d9e5c4f6f7a85435d05774d Mon Sep 17 00:00:00 2001 From: Russell Date: Tue, 24 Apr 2018 15:21:29 +0000 Subject: [PATCH] Some new features and fixes for banterbot and topicbot. update to chatcloud --- Code/irc/banterbot.py | 6 +- Code/irc/dict_puzzle.py | 10 +++ Code/irc/puzzle.py | 5 +- Code/irc/randomtopics.txt | 105 ++++++++++++++++++++++++++++++- Code/irc/tildescores.txt | 62 +++++++++++------- Code/irc/topicbot.py | 9 ++- Code/irc/topics_#bots.txt | 4 ++ Code/irc/topics_#tildetown.txt | 11 ++++ Code/irc/topicscores.txt | 5 +- public_html/chatcloud/index.html | 2 + 10 files changed, 187 insertions(+), 32 deletions(-) diff --git a/Code/irc/banterbot.py b/Code/irc/banterbot.py index 8cd65f2..901563c 100755 --- a/Code/irc/banterbot.py +++ b/Code/irc/banterbot.py @@ -250,7 +250,7 @@ def get_user_from_message(msg): except ValueError: return "" -def listen(): +def listen(botnick): while 1: ircmsg = ircsock.recv(2048) @@ -320,7 +320,7 @@ def listen(): if ircmsg.find(":!rollcall") != -1: rollcall(channel) - if ircmsg.find(":" + botname + ":") != -1: + if ircmsg.find(":" + botnick + ":") != -1: mug_off(channel) if ircmsg.find("PING :") != -1: @@ -331,4 +331,4 @@ def listen(): ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) connect(options.server, options.channel, options.nick) -listen() +listen(options.nick) diff --git a/Code/irc/dict_puzzle.py b/Code/irc/dict_puzzle.py index 1814c21..fb38163 100644 --- a/Code/irc/dict_puzzle.py +++ b/Code/irc/dict_puzzle.py @@ -13,3 +13,13 @@ def get_puzzle(): words.sort() answer = words[key] return [answer, puzzle] + +def get_anagram(maxlen = 6): + dict_words = [word.rstrip() for word in open(dictionary).readlines() if "'" not in word and len(word) > 2 and len(word) <= maxlen+1] + word = random.choice(dict_words) + while True: + anagram = ''.join(random.sample(word, len(word))) + if anagram != word: + break + puzzle = "Unscramble the following word: '" + anagram + "'" + return [word, puzzle] diff --git a/Code/irc/puzzle.py b/Code/irc/puzzle.py index 5c525e2..198ecd9 100644 --- a/Code/irc/puzzle.py +++ b/Code/irc/puzzle.py @@ -13,7 +13,7 @@ def make_puzzle(obfuscate=True): puzzle = random.choice(["Prove you're not a robot: ", "Are you a robot?: ", "Anti-bot check: ", "Counter-cndorphant measures: ", "Cosnok countermeasures: ", "Anti-tildethief precautions: "]) puzzle += random.choice(["What is", "How many is", "What do you get from", "What do you get with", "What is the value of", "Can you answer", "Can you tell me"]) puzzle += " " - roll = random.randrange(0,15) + roll = random.randrange(0,18) var1 = random.randrange(1,10) var2 = random.randrange(1,10) var3 = random.randrange(1,20) @@ -73,6 +73,9 @@ def make_puzzle(obfuscate=True): elif roll <= 14: #12-14 answer, puzzle = dict_puzzle.get_puzzle() obfuscate = False + elif roll <= 17: #15-17 + answer, puzzle = dict_puzzle.get_anagram() + obfuscate = False puzzle += "?" if obfuscate == True: diff --git a/Code/irc/randomtopics.txt b/Code/irc/randomtopics.txt index 32003a8..a5b155c 100644 --- a/Code/irc/randomtopics.txt +++ b/Code/irc/randomtopics.txt @@ -24,10 +24,10 @@ Do you feel that children should be sheltered from unhappiness? If you could have personally witnessed anything, what would you want to have seen? If you could wake up tomorrow in the body of someone else, who would you pick and what would you do? If you could be any age for a week, what age would that be? - What question do you hate to answer? +What question do you hate to answer? If you could only have one meal for the rest of your life, what would it be? Where do you go to get on a computer? - How do you start a conversation? +How do you start a conversation? What keys on a keyboard do you not use? If you had a brainwashing machine, who would you use it on? You are walking home in the dark, you see something move. What/Who is it(guess)? What do you do? @@ -1000,3 +1000,104 @@ If you were going to become a close friend with your partner, please share what When did you last cry in front of another person? By yourself? What, if anything, is too serious to be joked about? Your house, containing everything you own, catches fire. After saving your loved ones and pets, you have time to safely make a final dash to save any one item. What would it be? Why? +Tell me the 3 best things about you. +On a scale of 1-10, how strict are/were your parents? +Who was your worst teacher? Why? +Who was your favorite teacher? Why? +Which would you pick: being world-class attractive, a genius or famous for doing something great? +Who are the 3 greatest living musicians? +If you could change one thing about yourself, what would it be? +What was your favorite toy growing up? +Name 3 celebrities you most admire. +Name a celebrity you think is lame. +What accomplishment are you most proud of? +Which of your friends are you proudest of? Why? +What’s the most beautiful place you’ve ever been? +What are your 3 favorite movies? +How would you describe me to your friends? +Which historical figure would you like to be? +What’s the right age to get married? +Tell me 3 things you remember about kindergarten. +What paper that you’ve written are you most proud of? +What would you do if you were invisible for a day? +Who would you like to live like for a day? +If you could time travel, where would you go? +If you could live in any TV home, what would it be? +What’s your favorite ice cream flavor? +Would you rather live for a week in the past or the future? +What’s your most embarrassing childhood memory? +What’s your best childhood memory? +What’s your favorite holiday? +If you could eat only 3 foods for the rest of your life, what would they be? +If you could be a cartoon character for a week, who would you be? +If you could have dinner with anyone from history, who would it be? +What’s one choice you really regret? +What’s your favorite childhood book? +What’s a great book you’ve read recently? +Do you feel like a leader or a follower? +If you could ask your pet 3 questions, what would they be? +What’s the most courageous thing you’ve ever done? +Who would play you in a movie of your life? +If you could be an Olympic athlete, in what sport would you compete? +If you had to live in a different state, what would it be? +What living person, other than family members, do you most admire? +What has been your favorite family vacation? +If you could choose your own nickname, what would it be? +Who is the funniest person you know? +What’s your favorite thing about one of your grandparents? +Tell the person to your right your favorite thing about them. +Do you ever talk to yourself? When and what do you say? +When you’re having a bad day, what do you do to make yourself feel better? +Which TV family is most like your own? +What’s your favorite smell in the whole world? +What do you think is the greatest invention of all time? +Using one word, how would you describe your family? +Would you rather win an Olympic medal, an Academy Award or the Nobel Peace prize? +What’s your favorite time of day? +What’s your favorite season? +What’s the one food you could never bring yourself to eat? +What is the sound you love the most? +What 3 famous people, living or dead, would you want at your fantasy dinner party? +If you could ask the President one question, what would it be? +If you could pick a new first name, what would it be? +If you had to leave earth on a spaceship and take 4 friends with you, who would they be? +What is your favorite movie quote? +What’s your pet peeve(s)? +Do you sleep with your sheets tucked in or out? +Do you ever count your steps when you walk? +What’s your favorite kind of sandwich? +What’s your dream job? +Cake or pie? +Who is the kindest person you know? +What’s the best part about having siblings? +What is the scariest movie you’ve ever seen? +If you could travel anywhere in the world, where would it be? +What is your favorite family tradition? +Who’s your celebrity crush? +What trait do you like the most about yourself? +What are you good at? +What fictional character do you wish you could meet? +If you could be great at one sport which would you choose? +What’s the first thing you do when you get home from a trip? +Would you rather spend five days exploring Disney or New York City? +Whose parents do/did you wish you had? +If you could shop for free at one store, which one would you choose? +What personal trait has gotten you in the most trouble? +Which celebrity chef would you most like to fix you a meal? +Who is your favorite athlete? +What is the best piece of advice you’ve received? +If you had to pick a new name for yourself, what name would you pick? +Would you rather be the most popular kid in school or the smartest kid in school? +What do you like to do on a rainy day? +Would you rather be the best player on a horrible team or the worst player on a great team? +What is your favorite thing about the beach? +If you could be anywhere else right now, where would it be? +What is your favorite Disney movie? +Which of the Seven Dwarfs is most like you? +If someone made a movie of your life would it be a drama, a comedy, a romantic-comedy, action film, or science fiction? +Name a product or service you love so much that you’d happily be that company’s spokesperson. +If you were guaranteed to be successful in a different profession, what would you want to do? +As a child, what did you wish to become when you grew up? +What’s the worst thing you did as a kid? +What is the best part of being a part of your family? +What is your favorite day of the week? diff --git a/Code/irc/tildescores.txt b/Code/irc/tildescores.txt index 8a86dc6..2916d7d 100644 --- a/Code/irc/tildescores.txt +++ b/Code/irc/tildescores.txt @@ -1,18 +1,18 @@ -krowbar&^%2023&^%1519851803 -karlen&^%306&^%1519852204 +krowbar&^%2120&^%1524572882 +karlen&^%476&^%1524572484 endorphant&^%682&^%1444775660 jumblesale&^%24&^%1426171214 -marcus&^%2516&^%1519843226 +marcus&^%2545&^%1523553363 papa&^%181&^%1474509971 epicmorphism&^%5&^%1421937744 audy&^%83&^%1504564254 kc&^%28&^%1480730333 -vilmibm&^%15&^%1501441899 +vilmibm&^%15&^%1520970953 cmr&^%2244&^%1485978592 imt&^%519&^%1424087616 cndorphant&^%788&^%1424094192 rain&^%17&^%1422310975 -sl2c&^%709&^%1519840556 +sl2c&^%765&^%1524175962 selfsame&^%1&^%1422230012 bear&^%424&^%1510759605 coaxial&^%8&^%1422325983 @@ -31,7 +31,7 @@ sanqui&^%22&^%1474904633 endorphan&^%119&^%1519838766 cndorphbo&^%9&^%1466591324 santi&^%3&^%1447873216 -insom&^%1&^%1450346059 +insom&^%2&^%1524182067 tahnok&^%4&^%1464913072 nilsding&^%12&^%1454100197 vypr&^%3&^%1452470872 @@ -39,27 +39,27 @@ synergian&^%22&^%1458152889 dheeraj&^%5&^%1456489270 demobot&^%6&^%1454439605 premysl&^%65&^%1461768606 -minerobbe&^%249&^%1519753693 +minerobbe&^%268&^%1522323944 xkeeper&^%14&^%1461967961 cosnok&^%807&^%1508878859 escobar&^%1&^%1475431401 amicabot&^%30&^%1481225205 -caff&^%884&^%1519690884 +caff&^%990&^%1524015156 kadin&^%5&^%1479870008 desvox&^%5&^%1481632697 mankins&^%3&^%1480211581 cinch&^%2&^%1480454755 -caffbot&^%915&^%1519690905 +caffbot&^%933&^%1524015163 evilbot&^%4&^%1480693919 tybaltcat&^%7&^%1481076625 -minerbot&^%127&^%1519753731 +minerbot&^%146&^%1520382015 mio&^%339&^%1506434277 -archangel&^%425&^%1519758851 -tehfraga&^%217&^%1519799607 +archangel&^%464&^%1524447604 +tehfraga&^%252&^%1524036040 sushi&^%10&^%1493253212 -troido&^%133&^%1519838821 -gamebot&^%64&^%1519838871 -nilaky&^%949&^%1519801193 +troido&^%177&^%1524564338 +gamebot&^%103&^%1524564349 +nilaky&^%1083&^%1524522303 bucket&^%103&^%1507931139 lolbot&^%1&^%1502568407 m455&^%12&^%1512076715 @@ -71,19 +71,37 @@ feoh&^%48&^%1513959989 pinhook&^%8&^%1509744722 emfor&^%3&^%1509671353 k2l8m11n2&^%11&^%1510932395 -sacredpix&^%2&^%1510943959 -deltawitc&^%944&^%1519852080 -login&^%285&^%1519851577 +sacredpix&^%3&^%1522082931 +deltawitc&^%1436&^%1524565071 +login&^%718&^%1524579121 kelpiebot&^%3&^%1513101957 unreal&^%1&^%1514940020 -tildethie&^%2123&^%1519851875 -kinsey&^%23&^%1515732346 +tildethie&^%3000&^%1521573658 +kinsey&^%26&^%1520446672 testgameb&^%2&^%1517405361 erin&^%2&^%1517681999 wuz&^%3&^%1518125300 hashdang&^%4&^%1518666906 -ubergeek&^%19&^%1519650555 +ubergeek&^%41&^%1524236676 silver&^%9&^%1519333029 -equa&^%14&^%1519838802 +equa&^%43&^%1523911663 audiodude&^%2&^%1519453927 jumblesal&^%1&^%1519746512 +whimsy&^%16&^%1523551815 +wangofett&^%59&^%1524257254 +saturn597&^%3&^%1521429369 +cwmccabe&^%2&^%1521598124 +lucidiot&^%14&^%1522018847 +tracer&^%1&^%1521744878 +jan6&^%201&^%1524583286 +jan&^%10&^%1522319160 +etathetae&^%3&^%1522937843 +eeeeeta&^%28&^%1524463842 +cmccabe&^%55&^%1524509916 +jan6_test&^%7&^%1523252589 +jan6_&^%8&^%1523641589 +carbon&^%9&^%1524135505 +ne1&^%7&^%1524024485 +Halian&^%4&^%1524536199 +lunasspec&^%4&^%1524164784 +bowlercap&^%3&^%1524165068 diff --git a/Code/irc/topicbot.py b/Code/irc/topicbot.py index dd828ee..99dd58f 100755 --- a/Code/irc/topicbot.py +++ b/Code/irc/topicbot.py @@ -15,6 +15,7 @@ import get_users import mentions import pretty_date import inflect +import names parser = OptionParser() @@ -61,7 +62,8 @@ def get_topic(channel, user, time): with open("topics_" + channel + ".txt", "r") as topics: topic = topics.readlines()[-1].strip("\n").split("&^%", 3) - ircsock.send("PRIVMSG "+ channel +" :I've told you " + p.number_to_words(userscore) + " times! It's \"" + topic[2] + "\" (Set by " + topic[1] + " " + pretty_date.pretty_date(int(topic[0])) + ")\n") + byuser = names.get_name(topic[1]) + ircsock.send("PRIVMSG "+ channel +" :I've told you " + p.number_to_words(userscore) + " times! It's \"" + topic[2] + "\" (Set by " + byuser + " " + pretty_date.pretty_date(int(topic[0])) + ")\n") def count_topic(channel, user, time, msg): with open("topics_" + channel + ".txt", "a") as topics: @@ -95,7 +97,7 @@ def random_topic(channel, user, time, setTopic=False): ircsock.send("PRIVMSG "+channel +" :Suggested Topic: " + msg + "\n") def rollcall(channel): - ircsock.send("PRIVMSG "+ channel +" :topicbot reporting! I respond to !topic !settopic !randomtopic !thistory\n") + ircsock.send("PRIVMSG "+ channel +" :topicbot reporting! I respond to !topic !settopic !suggesttopic !thistory\n") def topic_score(channel): ircsock.send("PRIVMSG "+ channel +" :Not implemented yet") @@ -117,7 +119,8 @@ def topic_history(channel, user, count): ircsock.send("PRIVMSG "+ channel +" :Ok, here were the last " + p.number_to_words(iCount) + " topics\n") for idx,topic in enumerate(reversed(topicsfile.readlines()[-iCount:])): topic = topic.strip("\n").split("&^%", 3) - ircsock.send("PRIVMSG "+ channel +" :" + str(idx+1) + ": \"" + topic[2] + "\" (Set by " + topic[1] + " " + pretty_date.pretty_date(int(topic[0])) + ")\n") + byuser = names.get_name(topic[1]) + ircsock.send("PRIVMSG "+ channel +" :" + str(idx+1) + ": \"" + topic[2] + "\" (Set by " + byuser + " " + pretty_date.pretty_date(int(topic[0])) + ")\n") def connect(server, channel, botnick): diff --git a/Code/irc/topics_#bots.txt b/Code/irc/topics_#bots.txt index 88a3e6a..8cccc84 100644 --- a/Code/irc/topics_#bots.txt +++ b/Code/irc/topics_#bots.txt @@ -36,3 +36,7 @@ 1515522818&^%deltawitc&^%All hail DeltaWitch the Bot Queen (and promising pupper) 1516797394&^%login&^%If you join the circus, what would you perform? 1517234330&^%krowbar&^%Bot channel. Please ignore. +1521821221&^%krowbar&^%Three things I think will become obsolete in 10 years: +1522267660&^%jan&^%What is the last film you saw? +1522846620&^%krowbar&^%Have you ever had to wear a uniform to school? +1523121085&^%jan6&^%no topics in the tropic diff --git a/Code/irc/topics_#tildetown.txt b/Code/irc/topics_#tildetown.txt index 6acc2cc..63c2638 100644 --- a/Code/irc/topics_#tildetown.txt +++ b/Code/irc/topics_#tildetown.txt @@ -232,3 +232,14 @@ 1518719324&^%vilmibm&^%plz help ~cel out https://www.gofundme.com/pitch-in-for-a-townie 1519636303&^%karlen&^%The town is 1234 days old! happy T+1234! | plz help ~cel out https://www.gofundme.com/pitch-in-for-a-townie 1519715605&^%karlen&^%plz help ~cel out https://www.gofundme.com/pitch-in-for-a-townie +1519961098&^%vilmibm&^%newsletter is out!!!!!!!!!!!! check your tildemail inbox!!!! (hint: run `alpine`) +1520557346&^%vilmibm&^%killjoyin' http://tilde.town/~equa/wall.html#25 +1520655797&^%vilmibm&^%rude/3/4 s/rude/nice rude/cut/piss +1520857906&^%karlen&^%just something nice like 'oh hello welcome to tilde.town' you know that sort of thing 'check out holodeck at ~ne1/bin/holodeck' +1521048755&^%vilmibm&^%all aboard the feels train +1521820984&^%krowbar&^%What are you thankful for? +1522819956&^%vilmibm&^%let's go away https://www.youtube.com/watch?v=4QiAlrSeZAM +1522845447&^%etathetae&^%Sitting alone in a big field, looking at stars, what do you think/feel? +1522845488&^%etathetae&^%What is the best/worst pick up line you have ever heard? +1523919506&^%vilmibm&^%how are you? +1524157985&^%vilmibm&^%feels or gtfo diff --git a/Code/irc/topicscores.txt b/Code/irc/topicscores.txt index 3631d9b..c062b15 100644 --- a/Code/irc/topicscores.txt +++ b/Code/irc/topicscores.txt @@ -1 +1,4 @@ -krowbar&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1karlen&^%0&^%1karlen&^%0&^%1 \ No newline at end of file +krowbar&^%5&^%2 +jan&^%0&^%1vilmibm&^%0&^%1etathetae&^%1&^%0 +etathetae&^%0&^%2 +jan6&^%0&^%1vilmibm&^%0&^%1vilmibm&^%0&^%1 \ No newline at end of file diff --git a/public_html/chatcloud/index.html b/public_html/chatcloud/index.html index fb89e59..9304135 100644 --- a/public_html/chatcloud/index.html +++ b/public_html/chatcloud/index.html @@ -4,6 +4,8 @@