Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GreaterGood-CTG-AutoClicker
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gohrbandt, Jan
GreaterGood-CTG-AutoClicker
Commits
94853ca6
Unverified
Commit
94853ca6
authored
2 months ago
by
Jan
Committed by
GitHub
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Updated script for new GG layout
Fixes #4. (Or at least should, I hope.)
parent
c99d348c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
GreaterGood CTG AutoClicker.js
+46
-46
46 additions, 46 deletions
GreaterGood CTG AutoClicker.js
with
46 additions
and
46 deletions
GreaterGood CTG AutoClicker.js
+
46
−
46
View file @
94853ca6
...
...
@@ -5,7 +5,7 @@
// @description Automatically clicks through all the buttons on all subsites of the GreaterGood ClickToGive program every two hours.
// @description:de Klickt sich automatisch alle zwei Std. durch alle Buttons auf allen Seiten des GreaterGood-ClickToGive-Programms.
// @version
2.1.1
// @version
3.0.0
// @copyright 2023+, Jan G. (Rsge)
// @license Mozilla Public License 2.0
// @icon https://http-aws.greatergood.com/img/ggc/favicon-96x96.png
...
...
@@ -13,66 +13,66 @@
// @namespace https://github.com/Rsge
// @homepageURL https://github.com/Rsge/GreaterGood-CTG-AutoClicker
// @supportURL https://github.com/Rsge/GreaterGood-CTG-AutoClicker/issues
// @updateURL https://greasyfork.org/scripts/433055-greatergood-ctg-autoclicker/code/GreaterGood%20CTG%20AutoClicker.user.js
// @downloadURL https://greasyfork.org/scripts/433055-greatergood-ctg-autoclicker/code/GreaterGood%20CTG%20AutoClicker.user.js
// @match https://greatergood.com/clicktogive/*
// @match https://greatergood.com/clickToGive/*
// @match https://*.greatergood.com/clicktogive/*
// @match https://*.greatergood.com/clickToGive/*
// @match https://greatergood.com/*
// @match https://theanimalrescuesite.com/*
// @run-at document-idle
// @grant none
// ==/UserScript==
(
function
()
{
(
async
function
()
{
'
use strict
'
;
// Max amount of seconds to wait before clicking button
const
MAX_RANDOM_TO_CLICK_SECONDS
=
3
;
const
MAX_RANDOM_TO_CLICK_SECONDS
=
4
;
// Amount of seconds to wait for site to load after click
const
WAIT_SECONDS
=
3
// Minutes between possible click-throughs
const
INTERVAL_MINUTES
=
120
;
// Basic function
function
sleep
(
ms
)
{
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
ms
));
}
//
On button site, click button.
//
Vars
let
i
;
let
buttons
=
document
.
getElementsByTagName
(
"
BUTTON
"
);
let
buttonFound
=
false
;
for
(
i
=
0
;
i
<
buttons
.
length
;
i
++
)
{
let
buttonHTML
=
buttons
[
i
].
innerHTML
;
//console.log(buttonHTML);
if
(
buttonHTML
==
"
Click to Give - it's FREE!
"
)
{
buttonFound
=
true
;
break
;
}
}
if
(
buttonFound
)
{
let
progButtonsLeft
=
true
;
do
{
// On button site, click button.
let
ctgButton
=
document
.
getElementById
(
"
ctg-click-box-button
"
);
if
(
ctgButton
!==
null
)
{
let
millisecondsToClick
=
(
Math
.
floor
(
Math
.
random
()
*
MAX_RANDOM_TO_CLICK_SECONDS
)
+
1
)
*
1000
;
setTimeout
(
function
(){
buttons
[
i
].
click
()},
millisecondsToClick
);
return
;
await
sleep
(
millisecondsToClick
);
ctgButton
.
click
()
;
}
let
progButtons
=
[];
// Wait for buttons to load.
do
{
await
sleep
(
WAIT_SECONDS
*
1000
)
progButtonsLeft
=
true
;
// On thanks site, choose new site if not all are already clicked.
let
links
=
document
.
getElementsByTagName
(
"
A
"
);
for
(
i
=
0
;
i
<
links
.
length
;
i
++
)
{
let
linkClass
=
links
[
i
].
className
;
//console.log(linkClass);
let
linkAttributes
=
links
[
i
].
attributes
[
0
]
//console.log(linkAttributes);
if
(
linkAttributes
===
undefined
)
{
continue
;
progButtons
=
document
.
getElementsByClassName
(
"
ctg-click-grid-button
"
);
let
foundButton
=
false
;
for
(
i
=
0
;
i
<
progButtons
.
length
;
i
++
)
{
let
progButtonClass
=
progButtons
[
i
].
className
;
//console.log(progButtonClass);
let
progButtonValue
=
progButtons
[
i
].
attributes
[
0
].
value
;
//console.log(progButtonValue);
if
(
!
progButtonClass
.
includes
(
"
click-attempted
"
)
// Button clicked already
&&
!
progButtonValue
.
startsWith
(
"
http
"
))
{
// Is external site
progButtons
[
i
].
click
();
foundButton
=
true
;
break
;
}
let
linkValue
=
linkAttributes
.
value
;
//console.log(linkValue);
if
(
linkClass
.
includes
(
"
-site col-4 button-to-count
"
)
&&
!
linkClass
.
includes
(
"
click-more-clickAttempted
"
)
&&
linkValue
.
startsWith
(
"
/clicktogive/
"
))
{
let
link
=
links
[
i
].
href
;
//console.log(link);
window
.
open
(
link
,
"
_top
"
);
return
;
}
if
(
foundButton
)
{
break
;
}
progButtonsLeft
=
false
;
}
while
(
progButtons
.
length
==
0
)
}
while
(
progButtonsLeft
)
// Wait for specified time, then reload page to click through again.
let
intervalMilliseconds
=
(
INTERVAL_MINUTES
+
1
)
*
60
*
1000
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment