From f2752967d35d17d13694b39fc6b543da497bd4b4 Mon Sep 17 00:00:00 2001 From: Sakimori Date: Sat, 8 Jan 2022 00:00:22 -0500 Subject: [PATCH] Got twitter bot working, have player attribute responses --- .gitignore | 5 ++- SimHoc.py | 22 ++++++++++ SimHoc.pyproj | 17 ++++++++ attributes.py | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ db.py | 19 ++++++++ player.py | 44 +++++++++++++++++++ twitHandler.py | 45 +++++++++++++++++++ 7 files changed, 266 insertions(+), 1 deletion(-) create mode 100644 attributes.py create mode 100644 db.py create mode 100644 player.py create mode 100644 twitHandler.py diff --git a/.gitignore b/.gitignore index 2813ce2..6d23af2 100644 --- a/.gitignore +++ b/.gitignore @@ -363,4 +363,7 @@ MigrationBackup/ FodyWeavers.xsd # Venv files -Hockey/ \ No newline at end of file +Hockey/ + +# Data directiory +Data/ \ No newline at end of file diff --git a/SimHoc.py b/SimHoc.py index 8b13789..d8b52ac 100644 --- a/SimHoc.py +++ b/SimHoc.py @@ -1 +1,23 @@ +import os, pygame, player, tweepy, twitHandler, time +if __name__ == "__main__": + #for name in ["Vivi", "Artemis", "Laika", "Sharks", "Dragons", "Melua", "Sabriina", "Jorts (Buttered)", "Jorts (Unbuttered)"]: + # plyr = player.Player(name) + # print(f"{name}:") + # for atr in plyr.attributes: + # print(atr) + # print("----------") + + twitter = twitHandler.TwitHandler() + if os.path.exists(os.path.join("Data", "lastID.twt")): + with open(os.path.join("Data", "lastID.twt")) as idFile: + lastID = idFile.readline().strip() + else: + lastID = 0 + + while True: + twitter.scanForMention(lastID) + time.sleep(30) + with open(os.path.join("Data", "lastID.twt")) as idFile: + lastID = idFile.readline().strip() + #twitter.sendTextTweet(player.Player("Amogus").twitterString()) \ No newline at end of file diff --git a/SimHoc.pyproj b/SimHoc.pyproj index c18bf7b..e3fa69d 100644 --- a/SimHoc.pyproj +++ b/SimHoc.pyproj @@ -22,6 +22,16 @@ false + + + Code + + + Code + + + Code + @@ -35,6 +45,13 @@ X86 + + + + + + +