You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Grinch_ edited this page Mar 25, 2022
·
2 revisions
Events are a form of a callback function. When a certain event is triggered ( game start, script termination, etc ) the appropriate function for that gets called.
A common example would be the script termination event. Whenever your script is terminated ( error or exit ), this event is triggered. You can handle any necessary cleanup from there.
importlibstd.commonascommon# Can be used for necessary cleanupdefon_script_terminate(error_occured: bool):
iferror_occured:
print("Script terminated")
else:
print("Script exited")
whileTrue:
ifcommon.key_pressed(0x09):
breakcommon.wait(0)