-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
There was a problem hiding this 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 @@ | |||
/* |
There was a problem hiding this comment.
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:).+?}}/, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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
src/plugins/QuestCompleter/index.tsx
Outdated
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(); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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. |
It doesn't work since yesterday or 2 days ago, they patched so it only works in the desktop app. |
|
||
|
||
|
||
const ToolTipButton = findByProps("CenterControlButton").default; |
There was a problem hiding this comment.
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
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 |
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:
For Web, this requires to install an extension (only for chrome)
Screenshots: