User:Thurallor-bot
Description
This bot account has been disabled as the user owning the bot is no longer contributing to the wiki.
This is a bot account owned by Thurallor.
Projects
Here is a list of the pages that I maintain with this bot:
- Generated with generate_vxp_quest_index.py
- Generated with generate_vxp_deed_index.py
Here are the major batch-editing operations I've done with this bot:
- Updated all pages that reference the Deed template, replacing some outdated parameters (Virtue, Virtue-value, Virtue2, Virtue2-value) with a new one (VXP-reward)
- Performed with update_vxp_deeds.py
Setup
Here are the steps I took to create this bot (on my Windows 10 setup):
Account setup
- Created this Thurallor-bot account.
- Got a Bureaucrat to give the account "bot memberships".
Installing Pywikibot
- Installed Python 3.8 using the Microsoft Store.
- Opened a Windows command prompt. (Press Windows+R and enter 'cmd'.)
- Upgraded the 'pip' package:
- > pip install --upgrade pip
- Downloaded the latest stable version of Pywikibot:
- Unzipped it into a new directory.
- For convenience, defined an environment variable pointing to that location:
- Windows +R, type "SystemPropertiesAdvanced"
- Click "Environment Variables..."
- Add a variable called PYWIKIBOT with the pywikibot root directory in it.
- Opened cmd.exe, navigated to the pywikibot directory:
- > cd %PYWIKIBOT%
- Created a "family file":
- > python pwb.py generate_family_file https://lotro-wiki.com lotrowiki
- Do you want to generate interwiki links? This might take a long time. ([y]es/[N]o/[e]dit)n
- Created a user_config.py file:
- > python pwb.py generate_user_files
- family = lotrowiki
- language = en
- username = Thurallor-bot
- add any other projects = n
- add a BotPassword = n
- Logged in:
- > python pwb.py login
- WARNING: No user is logged in on site lotrowiki:en
- Password for user Thurallor-bot on lotrowiki:en (no characters will be shown):
- Logging in to lotrowiki:en as Thurallor-bot
- Logged in on lotrowiki:en as Thurallor-bot.
- Verified that I can run a script:
- > python pwb.py listpages -cat:Cosmetic_Pets
Installing Python Libraries
- > pip install mwparserfromhell
Running Scripts
To run a script, you simply need to save it in your %PYWIKIBOT%/scripts/userscripts directory, and start the bot using a command such as:
- > cd %PYWIKIBOT%
- > python pwb.py script-name
Optionally, you may save the output into a text file (to be pasted into the wiki):
- > python pwb.py script-name > output.txt
Scripts
Here are the scripts I have created for this bot.
None of these directly modify the wiki; I just save the output into a text file and manually paste that into the wiki:
- Generates a table of quests that award VXP
- > python pwb.py generate_vxp_quest_index > output.txt
- Generates a table of quests that award VXP
- > python pwb.py generate_vxp_deed_index > output.txt
- Finds all deeds that use a multi-line value for the 'Extra' parameter in the deed template
- > python pwb.py find_deed_extra_multiline > output.txt
- Finds all pages with a certain template, and generates an XML file with the templates parsed
- > python pwb.py template_to_xml
These directly modify the wiki:
- In {{Deed}} templates, replace some outdated parameters (Virtue, Virtue-value, Virtue2, Virtue2-value) with a new one (VXP-reward)
- > python pwb.py update_vxp_deeds
References
Installation
- User:Magill-bot
- https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation
- https://www.mediawiki.org/wiki/Manual:Pywikibot/Scripts