"""Reviewed normal Asylum key/story interactions; stop before final gauntlet.""" import subprocess,sys,json,time from pathlib import Path steps=[('eventq', 898, 160, 'talk'), ('checkpoint', 'Asylum392-LunaDoor'), ('eventq', 898, 264, 'talk'), ('linear_dialog', 898, 264, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Gold2'), ('eventq', 898, 3, 'talk'), ('checkpoint', 'Asylum392-GoldDoor1'), ('eventq', 898, 260, 'talk'), ('linear_dialog', 898, 260, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Radomus'), ('eventq', 898, 5, 'talk'), ('checkpoint', 'Asylum392-GoldDoor2'), ('eventq', 898, 253, 'talk'), ('linear_dialog', 898, 253, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Sigmund'), ('eventq', 898, 12, 'talk'), ('linear_dialog', 898, 12, '--source-page', 1, '--burst'), ('checkpoint', 'Asylum392-Chain1'), ('eventq', 898, 9, 'talk'), ('checkpoint', 'Asylum392-WestPassage'), ('eventq', 898, 25, 'talk'), ('checkpoint', 'Asylum392-WestLadder'), ('eventq', 898, 177, 'talk'), ('checkpoint', 'Asylum392-LauraDoor'), ('eventq', 898, 270, 'talk'), ('linear_dialog', 898, 270, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Ivory1'), ('eventq', 898, 11, 'talk'), ('checkpoint', 'Asylum392-EastPassage'), ('eventq', 898, 181, 'talk'), ('checkpoint', 'Asylum392-EastLadder'), ('eventq', 898, 23, 'talk'), ('checkpoint', 'Asylum392-SaphiraDoor'), ('eventq', 898, 275, 'talk'), ('linear_dialog', 898, 275, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Ivory2'), ('eventq', 898, 6, 'talk'), ('checkpoint', 'Asylum392-IvoryDoor1'), ('eventq', 898, 285, 'talk'), ('linear_dialog', 898, 285, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Noel'), ('eventq', 898, 7, 'talk'), ('checkpoint', 'Asylum392-IvoryDoor2'), ('eventq', 898, 286, 'talk'), ('linear_dialog', 898, 286, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Lin'), ('eventq', 898, 13, 'talk'), ('linear_dialog', 898, 13, '--source-page', 1, '--burst'), ('checkpoint', 'Asylum392-Chain2'), ('eventq', 898, 16, 'talk'), ('checkpoint', 'Asylum392-ShellyDoor'), ('eventq', 898, 19, 'talk'), ('checkpoint', 'Asylum392-TerraDoor'), ('eventq', 898, 278, 'talk'), ('checkpoint', 'Asylum392-TerraClear'), ('eventq', 898, 114, 'talk'), ('checkpoint', 'Asylum392-UpperDoor'), ('eventq', 898, 280, 'talk'), ('checkpoint', 'Asylum392-UpperClear'), ('eventq', 898, 191, 'talk'), ('checkpoint', 'Asylum392-SamsonDoor'), ('eventq', 898, 295, 'talk'), ('checkpoint', 'Asylum392-SamsonClear'), ('eventq', 898, 18, 'talk'), ('checkpoint', 'Asylum392-NostraDoor'), ('eventq', 898, 283, 'talk'), ('linear_dialog', 898, 283, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-Ebony'), ('eventq', 898, 17, 'talk'), ('checkpoint', 'Asylum392-EbonyDoor'), ('eventq', 898, 281, 'talk'), ('linear_dialog', 898, 281, '--source-page', 0, '--burst'), ('checkpoint', 'Asylum392-ShadeMemory'), ('eventq', 898, 14, 'talk'), ('linear_dialog', 898, 14, '--source-page', 1, '--burst'), ('checkpoint', 'Asylum392-Chain3')] p=Path('work/392-asylum-keys-queue.json');j=json.loads(p.read_text())if p.exists()else dict(done=0,steps=steps) assert not j.get('pending'),'Inspect interrupted action before resuming' for i in range(j['done'],len(steps)): cmd=steps[i];j['pending']=dict(index=i,command=cmd,epoch=time.time());p.write_text(json.dumps(j,indent=2));print(cmd,flush=True) subprocess.run([sys.executable,'scripts/'+cmd[0]+'.py',*map(str,cmd[1:])],check=True) j.update(done=i+1,pending=None);p.write_text(json.dumps(j,indent=2))