akioweh / EducationPerfected

JS script to automatically answer Education Perfect tasks
32 stars 35 forks source link

key strokes don't work #32

Closed garv-shah closed 2 years ago

garv-shah commented 2 years ago

i'm not too sure why this is, it might be another macos thing, but i'll do some additional testing and try and fix it later basically none of the keystrokes are detected, so the hotkeys don't work either

garv-shah commented 2 years ago

it might be better to simulate an enter keypress on the v1 script instead for ease of use, I'll try that tomorrow

akioweh commented 2 years ago

I have no idea why it doesn't work for you/macos in the code, I simply injected a eventListener into the site which triggers Puppeteer functions

but so far it has worked on multiple windows systems (me and other ppls')

and scripts running in the context of the page cannot replicate real human actions (a security limitation) and EP does check for this (as part of their anticheat). you can still try in case I missed something but I don't think it would work (and even if it did, it is possible for EP to fix), so I went straight with puppeteer

garv-shah commented 2 years ago

yeah, that makes sense, I hope there's a way to have it as easy to use as the previous script but also with elevated privileges

garv-shah commented 2 years ago

the issue seems to be with SSO, whenever you log in through your school, puppeteer stops being able to detect any keystrokes, which is probably because the injections are cleared it probably works fine with email and password logins in EP, but my account doesn't offer that, so that was probably the issue I'll try and find a way to log keystrokes after the login process has finished

garv-shah commented 2 years ago

fixed with https://github.com/KEN-2000l/EducationPerfected/commit/3256bd96a3371fd37d87213a2d41d2991b7615eb basically it just waits until the starting page loads to inject the js

akioweh commented 2 years ago

it does work with email and password as I assumed everyone used that

but if SSO causes some navigation or pop-up then the Injected event listeners will be cleared and break, which makes sense :D