import schedule
import time
class Gate:
def reset(self):
print("resetting")
gate = Gate()
# 1. Schedule the method
# This returns a Job object. We store it in the variable `job`.
job = schedule.every().day.at("00:00").do(gate.reset)
# 2. Main loop (somewhere in your engine)...
import schedule
import time
class OncePerDayGate:
def __init__(self):
self.triggered_today = False
def reset(self):
print("Resetting daily gate")
self.triggered_today = False
gate = OncePerDayGate()
# Run the reset method every day at midnight...
import schedule
import time
class Greeter:
def __init__(self):
self.count = 0
def say_hello(self):
self.count += 1
print(f"Hello! Called {self.count} times")
# Create an instance
g = Greeter()
# Schedule the *method* (not a function)...
The shit is inside of the ass
import time
class OncePerDayGate:
def __init__(self):
self.last_yday = -1
self.triggered_today = False
def check(self, event_happened: bool) -> bool:
# Fast integer day-of-year check
yday = time.localtime().tm_yday...
import re
def extract_xy(text):
m = re.search(r'^\s*compare\s+(.*?)\s+vs\s+(.*)$', text, re.IGNORECASE)
return [m.group(1), m.group(2)] if m else []
@fukurou
Skill 🌲: railbot: interupt for sp cases
With sub skill trees.
Skill tree has atribute of skill tree list which are skill sub classes
Shit in the ass man!