Skip to content

Commit

Permalink
Final Pushes (Hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTrustyPwo committed Feb 20, 2023
1 parent 7ead7d6 commit 7b731eb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,14 @@

This is a rather simple Python script which makes use of Selenium's ability
to interact with the web browser to create a sophisticated bot capable of solving
most questions with absolute precision. With this implementation, an article would be
solved in roughly 3.5 seconds, and after some benchmarking, it was found that 4 million
points could be obtained within the timespan of 24 hours, if the script is continuously
running of course.
most questions with absolute precision.

Some awesome features:
* Lightweight
* Runs in the background
* Solves nearly all questions
* Gain 4 million points per day
* Multi threaded
* Gain 12 million points per day (On 6 Threads)
* Instant setup and configurable

### Disclaimer
Expand All @@ -83,7 +81,7 @@ Prerequisites: Cookie Editor browser extension, Chrome version 110 (Latest as of
3. In the extracted folder, you should see 3 files, namely `main.exe`, `config.json` and `cookies.json`
4. Go to <a href="https://www.zbschools.sg/">ZBSchools</a> and sign in
5. Using the <a href="https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm?hl=en">Cookie Editor</a> extension, export your cookies which should copy them to your clipboard
6. Open cookies.json and clear all the text in the file and paste your cookies in
6. Open `cookies.json` and clear all the text in the file and paste your cookies in
7. Note that you need to do this every time your cookies change (Which depends on your activity)
8. Modify `config.json` to your liking. Refer to the section below.
9. Finally, run main.exe which will open a terminal
Expand All @@ -96,11 +94,12 @@ Prerequisites: Cookie Editor browser extension, Chrome version 110 (Latest as of

This is a list of configurable options in the `config.json` file and what they mean.

| Configurable | Description | Default | Datatype |
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------|----------|
| `lastSolvedArticleID` | Saves the last solved article ID to prevent repeated solving. Do not modify this unless you know what you are doing. | 14 | int |
| `articlesPerSession` | Number of articles the script will solve every time you run it. Once it solves that many articles, it will stop and exit. | 100 | int |
| `headless` | If set to true, the browser will be invisible which increases performance. It is recommended to turn this on for quicker solving. | false | bool |
| Configurable | Description | Default | Datatype |
|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|---------|----------|
| `lastProcessedArticleID` | Saves the last processed article ID to prevent repeated processing. Do not modify this unless you know what you are doing. | 14 | int |
| `articlesPerSession` | Number of articles the script will process every time you run it. Once it processes that many articles, it will stop and exit. | 100 | int |
| `threads` | Number of threads to run. More threads means that the script will be able to solve more articles concurrently, but will also use more system resources. | 4 | int |
| `headless` | If set to true, the browser will be invisible which increases performance. It is recommended to turn this on for quicker solving. | false | bool |

<p align="right">(<a href="#top">back to top</a>)</p>

Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from webdriver_manager.chrome import ChromeDriverManager

# Initialize constants
VERSION = '1.3'
VERSION = '2.0'
MCQ_CHOICE = ('A', 'B', 'C', 'D')
PASSAGE_TEMPLATE_URL = 'https://www.zbschools.sg/stories-{id}'
QUESTION_TEMPLATE_URL = 'https://www.zbschools.sg/cos/o.x?c=/ca7_zbs/zbs&func=quiz&tid=1&rid={id}&litebox=0&popup=1'
Expand Down Expand Up @@ -262,9 +262,9 @@ def main():
start_id = CONFIG['lastProcessedArticleID'] + 1
amount = CONFIG['articlesPerSession']
pool.map(solve_article, range(start_id, start_id + amount))
time2 = time.perf_counter()
del threadLocal
pool.close()
time2 = time.perf_counter()

print(f'\nPROGRAM FINISHED\n'
f'{time2 - time1} seconds have elapsed\n'
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3
2.0

0 comments on commit 7b731eb

Please sign in to comment.