From 02ad624dda1d8148344d5017fde331dd5bf46ea5 Mon Sep 17 00:00:00 2001
From: Abhorrent_Anger <abhorrentanger@cock.li>
Date: Sat, 15 Feb 2025 22:10:27 +0200
Subject: [PATCH] Auto refresh, page wait

---
 ManncoStoreGiveawayAutojoiner.user.js | 34 +++++++++++++++------------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/ManncoStoreGiveawayAutojoiner.user.js b/ManncoStoreGiveawayAutojoiner.user.js
index 28cb8e4..b78e715 100644
--- a/ManncoStoreGiveawayAutojoiner.user.js
+++ b/ManncoStoreGiveawayAutojoiner.user.js
@@ -1,7 +1,7 @@
 // ==UserScript==
 // @name         Mann Co. Store Giveaway Autojoiner
 // @namespace    http://tampermonkey.net/
-// @version      2025-01-29
+// @version      2025-02-15
 // @description  Tries to join giveaways on page load
 // @author       Abhorrent_Anger
 // @include      /^https?:\/\/mannco\.store\/giveaways.?$/
@@ -12,20 +12,24 @@
 // @run-at document-end
 // ==/UserScript==
 
+setTimeout(function () { location.reload(); }, 90 * 60 * 1000);
+
 waitForKeyElements('a.raffle-list__item.list-group-item.list-group-item-action.raffleitem.isv.first', () => {
-    $('span[data-bs-title="Joined"][style*="display: none"]').each(function() {
-        let raffle = $(this).attr('url');
-        let raffleJoinURL = 'https://mannco.store/requests/raffle.php?mode=join&url=' + raffle;
-        $.ajax({
-            method: "GET",
-            xhrFields: {
-                withCredentials: true
-            },
-            url:raffleJoinURL,
-            success: function(data){
-                console.log('Tried to join '+raffle+' raffle, output: ' + data);
-            }
+    setTimeout(function () {
+        $('span[data-bs-title="Joined"][style*="display: none"]').each(function () {
+            let raffle = $(this).attr('url');
+            let raffleJoinURL = 'https://mannco.store/requests/raffle.php?mode=join&url=' + raffle;
+            $.ajax({
+                method: "GET",
+                xhrFields: {
+                    withCredentials: true
+                },
+                url: raffleJoinURL,
+                success: function (data) {
+                    console.log('Tried to join ' + raffle + ' raffle, output: ' + data);
+                }
+            });
         });
-    });
-    console.log('Done with raffle join attempts');
+        console.log('Done with raffle join attempts');
+    }, 2000);
 });
\ No newline at end of file