Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin): Quests completer #2393

Closed
wants to merge 4 commits into from

Conversation

wavedevgit
Copy link
Contributor

This plugin completes quests without having the game. this is useful for quests that rewards you avatar decorations

The "Complete Quest" button is enabled only if:

  • You have uncompleted quests
  • You are streaming something
  • Someone is watching your stream (your alt or your friend.)

For Web, this requires to install an extension (only for chrome)

Screenshots:

image
image
image

Copy link
Contributor

@MrDiamondDog MrDiamondDog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik you don't need someone else watching for it to work as the js snippet works if no one else is there

@@ -0,0 +1,201 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the new header

{
find: `"invite-button"`,
replacement: {
match: /(function .+?\(.+?\){let{inPopout:.+allowIdle.+?}=.+?\.usePreventIdle\)\("popup"\),(.+?)=\[\];if\(.+?\){.+"chat-spacer"\)\)\),\(\d,.+?\.jsx\)\(.+?,{children:).+?}}/,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use \i for variable names

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\i on my case, didnt work.

</>);
},
start() {
const currentUserId: string = findByProps("getCurrentUser").getCurrentUser().id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const currentUserId: string = findByProps("getCurrentUser").getCurrentUser().id;
const currentUserId: string = UserStore.getCurrentUser().id;

},
start() {
const currentUserId: string = findByProps("getCurrentUser").getCurrentUser().id;
window.currentUserId = currentUserId; // this is here because discord will lag if we get the current user id every time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't pollute the window object like this. If you do what the above comment says then it shouldn't lag

window.currentUserId = currentUserId; // this is here because discord will lag if we get the current user id every time
},
renderQuestButton() {
const currentStream: Stream | null = findByProps("getCurrentUserActiveStream").getCurrentUserActiveStream();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findByProps calls should be put into a variable instead of calling it every time you need something from it. This would call every time the quest button is rendered and that would be very laggy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, i get your idea, because of react re rendering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lemme make it a variable

@verticalsync
Copy link
Contributor

verticalsync commented Apr 27, 2024

Afaik you don't need someone else watching for it to work as the js snippet works if no one else is there

As far from what I've heard and experienced myself, you now DO need to have someone watching. Probably some "anti-fraud" type of precaution.

@SerStars
Copy link
Contributor

Afaik you don't need someone else watching for it to work as the js snippet works if no one else is there

It doesn't work since yesterday or 2 days ago, they patched so it only works in the desktop app.
By checking the user agent if it has the "Electron/" string and they also started checking how many people are in the VC, I'm pretty they will add "how many people are watching your stream" soon.




const ToolTipButton = findByProps("CenterControlButton").default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have many more instances of constant findByProps calls you should probably fix also

@Vendicated
Copy link
Owner

i don't think having this is a good idea

discord is very clearly cracking down on quest scripts, aamia had to change her script multiple times. so this plugin would possibly require frequent changes and unnecessarily upset discord

this is also more of a one time use thing than something you'd actually need as a plugin. just using the snippet that's floating around makes more sense

@Vendicated Vendicated closed this Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants