Grease/Tamper Monkey Script to automatically register for courses in the WU LPIS
- Install either the TamperMonkey or GreaseMonkey extension for your browser.
- Click on the extension icon.
- Create a new user script.
- Copy or download the entirety of the script from here.
- Paste the script into text field of your new userscript. (Remove any example code that was previously there!)
- Save and you are done.
If you want to update your version of the script to the most current one, you can either completely delete the user script and then repeat the steps above like on first installation. Alternatively, you can edit the userscript by overriding its contents with the new one.
Be aware, that after updating the script your configuration such as reload time and latency correction might be lost.
- Enable the script
- Go to the course's registration page
- The UI of the bot should appear on top of the table of courses
- Click
Select course
- Select the course in the table by clicking on it
- Now the course id and registration time should appear in the table of scheduled registrations (If not you can always manually enter the data)
- Click
Go!
to start the registration - The bot then automatically opens a browser tab for each scheduled registration
- When the clock reaches
00:00:00
the tabs will automatically reload the page repeatedly until it can click theanmelden
button - The color of the button should change to yellow and the page reloads another time.
- When the registration was successful you should see a message shown by the bot.
You can reload the page or close and reopen the browser tab, the bot will store
your settings. But the page has to be open (and the bot active) during the registration!
The bot also only opens the registration tabs once when you click 'Go!'. If you
were to accidentally close a tab (a ❌
will appear in the Bot tabs
column)
simply click Stop
and then Go!
again to restart the system.
Warning The bot only reloads the page and clicks the
anmelden
button. You have to configure and start the bot yourself, plus keep the tab open! Do not close your laptop or let your computer go to sleep!Some browsers will suspend tabs in the background after a few minutes (Chrome ~5 minutes). Therefore, you should start (
Go!
) the bot only shortly before the registration begins, for example 2 minutes.
The script reads the source code of the LPIS page and allows you to select a course
to register for. Each scheduled course registration is added to the table shown in
the UI of the bot. By clicking the Go!
button the bot automatically opens as many
browser tabs as there are scheduled registrations. The main browser tab communicates
with the other ones, which each start a timer. When the timer finishes the page is
reloaded and the script clicks the anmelden
button as fast as possible. If a tab
is able to complete the registration or encounters an error it sends a message back
to the main tab.
The bot/script only runs on your computer inside your browser. There is no communication with other servers involved other than LPIS and none of your Information leaves your browser. The whole system is intended to emulate a user with superhuman reflexes and mouse clicking speed, somewhat like a "fancy" autoclicker. However, it does not take control of your input devices such as your mouse or keyboard to simulate a use, instead the bot interacts with the browser's internal representation of the website (called the DOM) directly.
The bot does not...
- ... automatically start your browser, or does anything outside of LPIS.
- ... interact with other open tabs in your browser except LPIS.
- ... start your computer or wake it from sleep.
- ... use the LPIS API or any endpoints, it simply interacts with the user-interface like a regular user would.
- ... detect changed registration times. If you notice that the time for registration changed, you have to re-select the course. Check the clock that the remaining time matches your expectation!
- ... take control of your input devices, like automatically moving the mouse.
If you suffer from bad internet latency you can let the script send the request to reload the page some time early. By default the script prefetches by 60ms. To adjust this value for your personal internet connection open the advanced settings and enter a new value in milliseconds.
Contributions are always welcomed. Please open an issue or pull-request.
This project is licensed under the MIT license.