Created
July 23, 2020 21:31
-
-
Save Felk/d6dc76e6cfb7b3cc457113e34258f834 to your computer and use it in GitHub Desktop.
some example script for the experimental dolphin build with python scripting support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# test script for https://github.com/Felk/dolphin/tree/scripting | |
import dolphin_event as event | |
import dolphin_memory as memory | |
import dolphin_aevent as aevent | |
i = 0 | |
def onframeadvance(): | |
global i | |
coro = aevent.frameadvance() | |
print(f"frameadvance1: {coro.send(None)}") | |
#print(f"frameadvance2: {coro.send(123)}") | |
i += 1 | |
if i > 10: | |
event.onframeadvance(None) | |
memory.add_memcheck(0x8063fc2c) | |
value = memory.read_u32(0x8063fc2c) | |
print(f"framecount: {value}") | |
#with open("D:/framecount.txt", "w") as f: | |
# f.write(f"{value}\n") | |
async def main(): | |
while True: | |
await aevent.frameadvance() | |
frame += 1 | |
if frame % 60 == 0: | |
print(f"Second: {frame/60}") | |
event.onframeadvance(onframeadvance) | |
#event.onscriptstart(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment