akioweh / EducationPerfected

JS script to automatically answer Education Perfect tasks
33 stars 38 forks source link

script+ issues #12

Closed garv-shah closed 2 years ago

garv-shah commented 3 years ago

Bug

The new script doesn't really seem to work for me. Instead, every single time it actually works, it gives me the error from here: https://github.com/KEN-2000l/EducationPerfected/issues/10

The algorithm for automatically going through pages seems to work, but ends up giving the error above. A lot of the time, it doesn't even manage to do the tasks. For example, if I'm on a task starter page that it should be able to complete, a lot of the time it just logs "Completed one task." to the console and does nothing else.

Enhancement

Also, macOS support doesn't work at all, but that's expected and I can fix that later. Also, later once I have the website for settings working, we can merge both the scripts into one and then have it as a mode on the settings page. Just a suggestion for when I'm not lazy :P So I can create the website in a place where you can manage it, would you be able to turn the repo into a GitHub Pages site?

akioweh commented 3 years ago

Idk about safari on macos... As for script+ not correctly answering questions... Seems a bit weird given the auto answer code should be copied over but I can fix some answer text parsing.

Website for settings? What do you mean..?

garv-shah commented 3 years ago

So imagine you hit a hotkey (alt + z) for example. It'll open up this website (it's not done yet but that's probably what it'll look like) that utilises browser local storage to save settings so it's persistent across websites. It was a thing I worked on a few months ago so I thought I'd re-use it here.

Basically, since asking about a time interval such a salter or getting people to switch which script they're using by use-case is a bit inconvenient, all of that stuff could be lumped into the one settings page. So by default the salter would be 0, but then you could change that to increase how long it takes. Similarly, by default the mode would be that of script.js but there'd be a toggle to change it to script+.js as well. Stuff like that.

And then when the script loads, it just reads from the settings if they're there) and works accordingly!

Jackroser123 commented 3 years ago

What is it meant to look like when it works? Like are you meant to be able to just start it in a random folder and it just does it? Could someone attach a video cause I am really interested. Thanks.

Jackroser123 commented 3 years ago

image image I don't know if this will help or not but these are the errors that I get after a task is completed.

garv-shah commented 3 years ago

Yeah that's exactly what it's meant to do, I can't get it to work consistently, but it's meant to just go through each an ever folder inside the folder and when it sees a task, it goes in, and completes it, then rinse and repeat i'll send a video once i can get it to work consistently, but as is evident, i haven't been working too much on the project recently :P ~hopefully i get a burst of motivation soon~

suryasingh1 commented 2 years ago

Is there any way to make it wait 1 to 2 seconds at every question it would make it much less sus for ep

garv-shah commented 2 years ago

yup, just use the script from this comment here It prompts you at the start, in milliseconds, so if you want a 1 second delay, you'd just type in 1000, and it won't be as sus

suryasingh1 commented 2 years ago

Is there any way to make it wait 1 to 2 seconds on each question to make it less sus for ep

suryasingh1 commented 2 years ago

Sorry for commenting again it was a lag

garv-shah commented 2 years ago

all g

suryasingh1 commented 2 years ago

Thanks that is goated. You are a legend

suryasingh1 commented 2 years ago

Is there any way to do the same on script+.js as well because this one gets a lot of answers wrong even if you do alt+r

garv-shah commented 2 years ago

i'm not sure, since ken's mostly worked on script+ i doubt that script+ will make it more accurate though, since iirc they work on the same algorithm @KEN-2000l any chance you could drop an edited version of script+ with a delay?

garv-shah commented 2 years ago

also next time, probably open a new issue, since the delay's pretty unrelated to the script+ issues

akioweh commented 2 years ago

i'm not sure, since ken's mostly worked on script+ i doubt that script+ will make it more accurate though, since iirc they work on the same algorithm @KEN-2000l any chance you could drop an edited version of script+ with a delay?

um script+ is a pile of idk that is device/platform-dependent and I only made it to afk some points even script.js has few issues and im just really lazy so basically many times it is more than the answer delay

suryasingh1 commented 2 years ago

The auto answer is not working

The semi auto is but auto answer is not. Did ep change something?

suryasingh1 commented 2 years ago

The auto run script has just stopped is there a way to get it going again. I think ep has just tweaked little display or button variable setting and stuff. Cause the semi auto works but the auto isn’t working at all it does nothing

suryasingh1 commented 2 years ago

Is there a way you can fix it also sorry about posting the issue in the wrong area

suryasingh1 commented 2 years ago

My theory was right they have changed they names or something because the console returns could not find had button. Also sorry for all these comments I am really stressed for some reason.

suryasingh1 commented 2 years ago

Never mind it was a trap

If you change tweak the scrip to work. It notifies ep that you have been using hacks.

garv-shah commented 2 years ago

wait actually, how do you know it notified them?

garv-shah commented 2 years ago

The auto run script has just stopped is there a way to get it going again. I think ep has just tweaked little display or button variable setting and stuff. Cause the semi auto works but the auto isn’t working at all it does nothing

is this the auto answer for script+ or just normal script? normal script seems to be working fine for me

suryasingh1 commented 2 years ago

It’s the normal script and a pop came up saying using scripts is inapopriate and that the ep team will be notified

suryasingh1 commented 2 years ago

It might be to check if I personally was cheating. Who knows?

suryasingh1 commented 2 years ago

For me when I do inspect the button comes up as button#submit-button.ng-binding.ng-scope

garv-shah commented 2 years ago

yeah that was an issue created from before as well, they don't know, they just put that there as a safeguard to discourage users from doing so. also yeah, try to make new issues please, don't just stick to this one, it makes organisation hard.

I'll check the name changes in a bit

suryasingh1 commented 2 years ago

If you mean ‘[Not really an issue but this is funny] EP thinks I don't know what I'm doing’ that’s not what happened after tweaking the code it literally kicked me out of the task to homepage and it said that using console whatever bad and ep team will be notified

garv-shah commented 2 years ago

oh wait crap, actually?!? damn, is there any way u can provide a recording of that, I'll try and find a way to make the script not do that

suryasingh1 commented 2 years ago

I tried using macros and everything they are literally detecting for digital ways of the button being clicked. And as soon as it happens they go nope this guy cheated.

Here is a image

[](url ![Uploading IMG_1847.jpeg…]() )

garv-shah commented 2 years ago

i think you clicked "comment" before it actually uploaded, would you be able to send it again?

suryasingh1 commented 2 years ago

IMG_1847

garv-shah commented 2 years ago

OMG that's crazy that they've implemented that, damn imma try and fix that rn one sec

garv-shah commented 2 years ago

yeah you're right, it detects it immediately namely, it's this function which it can see

document.getElementById('submit-button').click()

well we'll see how far this goes, if there's a simple javascript way to bypass that, but as far as i'm concerned, that's my goal mostly reached, for them to implement proper anti-cheat i might see how much further i can take it, but in my opinion, this anti-cheat by EP should be sufficiently good to stop most people from using a script like this, hopefully competitions should be more fair now. thank you so much for informing me of this, semi-auto answer should still work for now, let's see if we can break that enough for them to stop that too

akioweh commented 2 years ago

okay it removed button#explanation-button when answering which was the only way we could get the script to trigger submission (by calling .click())

the normal button#submit-button whose .click() didn't use to do anything now "notifies security team"

suryasingh1 commented 2 years ago

Wait does that mean you can fix it? Also I built a physical robot that uses the same technique as your code but in real life. As in it uses a camera got track the question its pretty cool. It can type scroll whatever. Basically there is no way ep can find out now. Because it will work normally

akioweh commented 2 years ago

not sure if I can fix using Javascript that runs on the website level but if I use like python selenium it would work completely fine but just a lot slower (compared to previous speeds)

a physical robot sounds really cool and really hard to do at the same time 😂

suryasingh1 commented 2 years ago

I kinda made my dad do it. I didnt do crap

suryasingh1 commented 2 years ago

Ok I can finally say I actually contributed to this project in the slightest and not just ask for help. But basically if you use Autohotkey.com and create a hotkey with it which pastes clipboard and presses enter on keyboard. Ep doesn’t detect it. So you would run semi auto and this hotkey together and it works fine. Create a hotkey loop and there you go

garv-shah commented 2 years ago

yeah that's what i used to do on my old script lmao, but ideally there'd be a faster way for the enters to be on the correct time so it's faster

function callClickEvent(element){
    var evt = document.createEvent("HTMLEvents"); 
    evt.initEvent("click", true, true); 
    element.dispatchEvent(evt);
}

function callClickEvent2(element){
    var evt = document.createEvent("MouseEvents");
    evt.initMouseEvent("click", true, true, window,
    0, 0, 0, 0, 0, false, false, false, false, 0, null);
    element.dispatchEvent(evt);
}

callClickEvent(document.getElementById("myElement"))
callClickEvent2(document.getElementById("myElement"))

I think these javascript functions would work as well to simulate a human click, so we don't have to move the whole codebase

akioweh commented 2 years ago

events like that don't work and still triggers their anticheat

Susmaster64 commented 2 years ago

they actually made an anti-cheat? Good job EP I guess. Does this mean we have to go back to the stone ages and use python OCRs to detect the text in the image and compare it to the word list?

Susmaster64 commented 2 years ago

and to get around the button click problem can't you just make js simulate a enter press or make it call on an external script that presses the enter key?

akioweh commented 2 years ago

check the v2 folder i fixed it can't simulate a real press with a script running in the context of the website so I used a standalone script with puppeteer to control a browser

akioweh commented 2 years ago

imma close this because i will (s∞n™) rewrite script+ in a similar way to how I fixed the normal script and that approach should solve the existing issues here with better control over the browser plus many things in here are kinda off topic

CharlieBozy commented 2 years ago
Screenshot 2022-10-27 212322

Can someone help me with this!

CharlieBozy commented 2 years ago

https://pastebin.pl/view/fdb858db

Thats the full error