SOURCE / PINNED RELEASE
Made of little things.
GRAV / RIFT
- Release
- 288aa261ce07…
- Author-recorded commit
- c549b5a4e17e…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-8a7361981e8
Archive hash verified: e52a01aff70810b3…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
// Follow the actual moving/crippled boss using only ordinary pointer and flight inputs.
export function bossPilot(page,frame){
return async ms=>{
for(let elapsed=0;elapsed<ms;elapsed+=100){
if(await frame.locator('#app').getAttribute('data-phase')!=='playing')break;
const {d,r}=await frame.locator('#game').evaluate(n=>({d:{...n.dataset},r:n.getBoundingClientRect().toJSON()}));
const boss=JSON.parse(d.rigs).find(r=>r.kind==='core');if(!boss)break;
const dx=boss.x-Number(d.shipX)-230,dy=boss.y-Number(d.shipY)-20;
for(const [key,held] of [['KeyD',dx>35],['KeyA',dx<-35],['KeyS',dy>35],['KeyW',dy<-35]])await page.keyboard[held?'down':'up'](key);
await page.mouse.move(r.left+(boss.x-Number(d.camera))*Number(d.viewScale),r.top+(boss.y-Number(d.cameraY))*Number(d.viewScale));
await page.clock.runFor(Math.min(100,ms-elapsed));
}
for(const key of ['KeyD','KeyA','KeyS','KeyW'])await page.keyboard.up(key);
};
}
