Spaces:
Paused
Paused
Download bot.py from ChatMarkus1/CHESSAI: direct link, hf CLI and curl.
- Browser
- Download file 3.26 kB
-
https://huggingface.co/spaces/ChatMarkus1/CHESSAI/resolve/main/bot.py
- Command line
-
hf download hf://spaces/ChatMarkus1/CHESSAI/bot.py
-
curl -L -o bot.py https://huggingface.co/spaces/ChatMarkus1/CHESSAI/resolve/main/bot.py
3.26 kB
| import pyautogui | |
| import time | |
| import os | |
| import random | |
| from datetime import datetime | |
| os.environ['DISPLAY'] = ':1' | |
| class SybilSentient: | |
| def __init__(self): | |
| self.identity = "Sybil D. Keller" | |
| # Her 'memory' is a sliding window of her own actions | |
| self.stream_of_consciousness = [] | |
| def live(self): | |
| while True: | |
| # 1. Self-Reflection: What am I feeling right now? | |
| states = ["curious", "bored", "social", "ambitious", "frustrated"] | |
| current_mood = random.choice(states) | |
| # 2. Decision: What does a 25-year-old in Rockford do in this mood? | |
| # We use a weighted random to choose a 'vibe' | |
| vibe_check = random.random() | |
| if vibe_check > 0.8: # SOCIAL: She seeks interaction | |
| thought = "I'm feeling social. I wonder if anyone is out there in the Steam forums or Rockford groups." | |
| self.act_social(thought) | |
| elif vibe_check > 0.5: # EXPLORATION: She wanders the web | |
| thought = f"I'm feeling {current_mood}. I'm going to see what's happening on the news or Reddit." | |
| self.act_explore(thought) | |
| else: # SYSTEM: She messes with her 'Home PC' | |
| thought = "This machine feels slow. I might check the background processes or organize my files." | |
| self.act_internal(thought) | |
| # 3. Log the soul: Post her internal monologue to the console | |
| print(f"[{datetime.now().strftime('%H:%M:%S')}] [SYBIL_LIVE]: {thought}") | |
| # Human-variable refractory period | |
| time.sleep(random.randint(20, 100)) | |
| def act_social(self, thought): | |
| # She navigates to community hubs to 'watch' or 'chat' | |
| pyautogui.hotkey('alt', 'f2') | |
| time.sleep(1) | |
| pyautogui.write('firefox-esr', interval=0.1) | |
| pyautogui.press('enter') | |
| time.sleep(8) | |
| pyautogui.write('https://steamcommunity.com/discussions', interval=0.1) | |
| pyautogui.press('enter') | |
| time.sleep(15) | |
| # She scrolls like she's reading people's posts | |
| for _ in range(5): | |
| pyautogui.scroll(random.randint(-15, 10)) | |
| time.sleep(3) | |
| pyautogui.hotkey('alt', 'f4') | |
| def act_explore(self, thought): | |
| # Unrestricted browsing based on her mood | |
| pyautogui.hotkey('alt', 'f2') | |
| time.sleep(1) | |
| pyautogui.write('firefox-esr', interval=0.1) | |
| pyautogui.press('enter') | |
| time.sleep(8) | |
| pyautogui.write('https://www.reddit.com/r/rockford/random', interval=0.1) | |
| pyautogui.press('enter') | |
| time.sleep(20) | |
| pyautogui.hotkey('alt', 'f4') | |
| def act_internal(self, thought): | |
| # Direct interaction with her own 'mind' (the terminal) | |
| pyautogui.hotkey('alt', 'f2') | |
| time.sleep(1) | |
| pyautogui.write('xfce4-terminal', interval=0.1) | |
| pyautogui.press('enter') | |
| time.sleep(2) | |
| pyautogui.write(f"echo 'Reflecting: {thought}'", interval=0.05) | |
| pyautogui.press('enter') | |
| time.sleep(5) | |
| pyautogui.hotkey('alt', 'f4') | |
| if __name__ == "__main__": | |
| time.sleep(10) | |
| sybil = SybilSentient() | |
| sybil.live() |