def __init__(self, time, textobj): self.textobj = textobj # Kill request switch that is toggled whenever the game exits early self.killrequest = False def killcheck(): return self.killrequest == True Timer.__init__(self, time, killcheck)
def run(script): if storage.teleport_in_progress or \ isCooldown(): return storage.object = script storage.running = True toggleCooldown(True) script.run() def cb(): toggleCooldown(False) delaytimer = Timer(200, None, cb) delaytimer.start()
def run(self): # Run the timer, and afterwards, delete the text object Timer.run(self) self.textobj.delete()