From 2655a2cda2988e63cd03f886f1510fff4abcdd3c Mon Sep 17 00:00:00 2001 From: George Barrell <78610776+RogerGabeller-ml@users.noreply.github.com> Date: Sun, 17 Nov 2024 11:40:05 +0000 Subject: Update alcogotchi.py --- alcogotchi-server/alcogotchi.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'alcogotchi-server/alcogotchi.py') diff --git a/alcogotchi-server/alcogotchi.py b/alcogotchi-server/alcogotchi.py index 7402ff3..06f0fe6 100644 --- a/alcogotchi-server/alcogotchi.py +++ b/alcogotchi-server/alcogotchi.py @@ -172,7 +172,7 @@ class Alcogotchi: def drink(self, data): global terminated drink_choice = data["drink"] - if self.last_drunkentime + 8 < time.time() and self.items[drink_choice] > 0: + if self.last_drunkentime + 0 < time.time() and self.items[drink_choice] > 0: self.drunk += BEVERAGES[drink_choice] self.happiness += BEVERAGES[drink_choice] self.last_drunkentime = time.time() @@ -270,9 +270,13 @@ class Server: ap = network.WLAN(network.AP_IF) ap.active(True) -ap.config(essid="Cool Server1", password="password123") +ap.config(essid="Your mum", password="password123") print("Connection avalible on {0}".format(ap.ifconfig())) +CLUB = "c2:2 c d# c:1 f:2 c:1 f:2 f# g c c g c:1 f#:2 c:1 f#:2 f d# " +def the_club(): + buzzer.melody(CLUB) + server = Server() server.add_route("/", alcogotchi.get_alcogotchi) @@ -281,6 +285,7 @@ server.add_route("/gamble", alcogotchi.double_or_nothing) server.add_route("/buy", alcogotchi.buy_item) server.add_route("/drive", alcogotchi.drive) server.add_route("/mine", alcogotchi.mine) +server.add_route("/club", the_club) # _thread.start_new_thread(s, ()) s() server.start() -- cgit v1.2.3-70-g09d2