Last active
June 8, 2024 18:52
-
-
Save Tran-Foxxo/0dab50223a05369c692df41763e6f094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Furality Auto Party | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0.2 | |
// @description Auto accept users into your party, invite them, then remove them. Refreshes every 1.5 mins | |
// @author Tran Fox | |
// @match https://furality.online/party | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=furality.online | |
// @grant none | |
// @downloadURL https://gist.github.com/Tran-Foxxo/0dab50223a05369c692df41763e6f094/raw/ | |
// @updateURL https://gist.github.com/Tran-Foxxo/0dab50223a05369c692df41763e6f094/raw/ | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const sleep = ms => { | |
console.log("sleep "+ms+"ms"); | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
}; | |
async function mainLoop() { | |
console.log("Auto Party loop started."); | |
while (true) { | |
// WAIT 10s (let's wait for the page to fully load) | |
await sleep(10 * 1000); | |
// Accept all requests | |
let acceptButtons = document.querySelectorAll("tbody tr.fadeInOpacity td.text-right button.btn-success"); | |
if (acceptButtons.length > 0) | |
{ | |
console.log("Accept party member"); | |
for (const element of acceptButtons) { element.click(); } | |
location.reload(); // Need to refresh because the dropdowns for removing players from party don't exist after you add them lol | |
} | |
else { console.log("No new party members to add"); } | |
// WAIT 10s | |
await sleep(10 * 1000); | |
/* | |
// Invite all players in party | |
let innerButtons = document.querySelectorAll("tbody tr.fadeInOpacity td.text-right button.btn-secondary span.btn-inner--text"); | |
for (const element of innerButtons) | |
{ | |
console.log("Inviting party member"); | |
if (element.innerHTML == "Invite Player to Me") { element.parentElement.click(); } | |
} | |
*/ | |
// Invite all party players to you | |
console.log("Inviting players in party"); | |
let invitePartyButton = document.querySelectorAll("tbody tr.fadeInOpacity td.text-right button.btn-secondary span.btn-inner--text")[0]; | |
if (invitePartyButton.innerHTML == 'Invite Party') { invitePartyButton.parentElement.click(); } | |
else { console.log("Couldn't find invite party button, are you not in a furality world?"); } | |
// WAIT 10s | |
await sleep(10 * 1000); | |
// Remove all party members | |
console.log("Removing party members"); | |
let dropdownButtons = document.querySelectorAll("tbody tr.fadeInOpacity td.text-right div[class='dropdown'] button"); | |
for (const element of dropdownButtons) | |
{ | |
element.click(); // Open dropdown | |
await sleep(1000); | |
document.querySelectorAll("tbody tr.fadeInOpacity td.text-right div div button")[0].click(); // Click remove from party | |
console.log("Removed party member"); | |
} | |
// WAIT 1.5 mins | |
console.log("Waiting 1.5 mins"); | |
await sleep(1.5 * 60 * 1000); | |
// Refresh party | |
console.log("Refreshing party"); | |
document.querySelectorAll("button[title='Refresh party']")[0].click(); | |
} | |
} | |
mainLoop(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
idk why updating isn't working I'll fix it later ig