FANDOM


DwemerSpider

"I think they may be rebuilding themselves while we're not looking."Neloth

A list of bot tasks for KINMUNE, AkulakhanBot, or SothaSilBot. If I don't get to your request immediately, it's most likely because the bot is occupied with another task, but don't let that stop you from adding any more that you have. Some of the larger projects for the bot, namely semi-automatic ones, can take a week or more to complete. However, most regular tasks can be finished in less than a day.

UsageEdit

Entries on this page are likely to be carried out by one of two active bots on the wiki: AkulakhanBot, in use since May 2017, is operated by Atvelonis and makes menial edits via AutoWikiBrowser or sometimes custom Python scripts. KINMUNE, in use since February 2014, is operated by Flightmare and is typically responsible for somewhat more advanced tasks via custom Python scripts. SothaSilBot, in use since October 2019, is operated by Stygies VIII and makes edits through AutoWikiBrowser or PyWikiBot.

AutoWikiBrowserEdit

AutoWikiBrowser (AWB) is used by AkulakhanBot to complete simple "find & replace" tasks, such as link fixes and basic formatting. A bot cannot do anything particularly advanced with this interface, but it is still invaluable for general wiki maintenance.

Examples of tasks that would be completed with AWB:

  • SkyrimSkyrim (Online) for links on Online articles
  • n/a → N/A in tables and infoboxes
  • Removing specific overarching categories

Custom scriptsEdit

More advanced (but still menial) tasks will generally be done by writing custom Python scripts instead of using AutoWikiBrowser: this may take a while if a new script is required, depending on the urgency of the task.

Examples of tasks would be completed with custom scripts:

In progressEdit

The bot is either currently working on these things, or has just finished them.

  • TES:Moot/January 2020, tasks for the updated {{LegendsCards}} template's formatting:
    • Remove links from "class" variable, module will handle them.
    • Move "cost" variable below "health" variable. The order should be: "power" , "health" , "cost".
    • Some card pages have "effects" variable already moved above the "text" variable, move it in the rest of pages.
    • Remove the "unique" variable. If its content was "Yes", change "rarity" variable's content to "Unique legendary".
    • Remove content from "create" and "destroy" variables, template will handle them.
    • Remove two single apostrophes " '' " from the start and the end of "text" variable in articles. Template will handle them.
    • Remove all categories from articles, module and template will handle them.
      • Mostly done, but there are a few that it doesn't seem to work with. —Atvelonis (talk) 22:07, April 26, 2020 (UTC)

AutoWikiBrowser tasksEdit

High priorityEdit

If you want me to do something quickly, place it under the "high priority" section (please do not place it in a lower tier just to be polite). I will get to it as fast as I can.

Low priorityEdit

If your task does not have any sort of deadline or is otherwise not very urgent, place it in the "low priority" section.

  • Category:Articles to be Moved
  • Add {{LE}} to achievement names on Achievements (Online)
  • Add "title" section to LegendsCharacter template.
  • Remove space between "Base ID" in infoboxes
  • Add ==Licensing== header to files missing it (excluding those where it is transcluded in image licensing template)
    • Transition all written categories to image licensing templates for consistency
  • Remove extraneous licensing content for files using Category:Image Licensing Templates
  • creatures = , type= -> <aligned properly>
  • Add |thumb to files with captions in blogs and elsewhere (without this, the captions will not appear)
    • Do NOT replace center/left/right; just add it as the second parameter, right after the file name
  • Replace "NPCs" with "characters."
  • Add "previous" and "next" variables to pages using {{OnlineBooks}} and DLC derivatives
  • Remove overarching merchant categories for ESO NPCs (DLCs only? Check!)
  • Remove the Category:ESO Morrowind: Enemies from pages
  • Remove the Category:Morrowind: Enemies from pages
  • Remove the Category:Arena: Enemies from pages
  • Remove the Category:Online: Enemies from pages
  • Change Ice Wolf to Ice Wolf (Skyrim), fix links from other articles
  • Replace the |enemies parameter in Template:OnlineLocations and all the Online locations with |creatures. If something is written there, it should be moved to the |characters or to the |creatures parameters
  • Split Sheogorath's page into proper pages/game-related/lore-related.

ContentEdit

For semi-automatic tasks that require me to add content. Such tasks may take a long time to finish.

  • Add ESO NPC classes (where applicable)
    • Category: Online: Characters (+DLC); skip if contains "class = N/A" (include additional whitespace)
  • Remove enemy stuff for all games; replace with either character or creature, depending on context
  • Missing (locate and add info for each) – Regex for spacing
    • race = {{Missing|Online}}
    • gender = {{Missing|Online}}
  • {{MorrowindCharacters}} (Regex: skip if includes RefID)
  • Add book header content to ==Content== section. e.g. title/author, if it's in the book itself

Custom tasksEdit

  • Sort interwiki links alphabetically

NotesEdit

Main article: Wikipedia:Regular expression
Main article: User:Atvelonis/Admin#Regex
  • Regex full line removal: prepend \n to account for newline
  • Regex full line removal example for level parameter in infoboxes (source): \|\s*level\s*=[^\|\r\n]*[\r\n]+
    • Alternative way: (\n\|\s*level\s*=)(.*|\s*)
  • Regex full line removal example for template with two variables (source): \{\{\s*ImageImprove\s*\|([^\|]*)\|([^\|]*)\}\}\s+
  • Regex full line removal example for gender parameter in infoboxes: \|\s*gender\s*=([^\|]*)
    • To prevent it from cutting off the hatnote, apply \n and an applicable term present on the following line
  • Regex replacement of integer with specific number range: \*\d*\s*{{G}}
  • Regex AND operator (source, 2): (?=[\d\D]*word1)(?=[\d\D]*word2)(?=[\d\D]*word3)
  • Regex OR operator: (word1|word2)
  • Regex parameter movement: (\|\s*subtype\s*=\s*.*)(\n\|\s*cost\s*=\s*.*)((?s).*)(\|\s*health\s*=\s*.*)
    • Replace with $1$3$4$2
  • Infobox parameter spacing:
    • Find: (\n\|)(............)(\s*)(\=) (number of . contingent on space width)
    • Replace with: $1$2 =
  • Infobox parameter de-linking:
    • Find: (\|\s*set\s*=\s*)(\[\[)((.*)(\s\(.*\))(.*)|(.*))(\]\])
    • Replace with: $1$4$7
Tasks
  • Table → Infobox: (\|-\n)*\|\s*class="odd"\s*\|\s*Name(:)*\s*\n*\|*\s*class="even"\s*\|\s*
Discussions API

Custom scriptsEdit

Python filesEdit

For transparency. Scripts can easily be scheduled on Windows 10 with the Task Scheduler. Credit to Flightmare for the fundamental code for many files (see here), although all files have been adjusted.

How-to guideEdit

If you're reading this, I probably unhelpfully linked to this documentation with the expectation that you would be able to figure it all out on your own, or I have not managed to get our bus factor above one and have paid the price. Either way, running the bot is actually a lot easier than you think it is. It does not really require any understanding of programming, unless you wish to modify an existing file; I have already written the code. The setup will take no more than a few minutes. Here's how you do it.

  1. Create an empty text file (.txt) in an accessible location on your computer (wherever you want) named something to the effect of "BotLoginInfo" (but it can be anything). Just make sure that you know the name and the filepath!
  2. Download Python and follow the installation instructions. I would recommend running the newest version.
  3. Open IDLE (Python's text editor) or another such program. Create a new file, copy+paste the contents of core.py into it, and then save.
    1. In the login function, replace the code C:/Users/<Username>/Desktop/AkulakhanBotLogin.txt with the name of the empty text file that you just created, and its filepath. You will have to do this twice: once for reading the file, and once for writing to it.
    2. If you're not sure what the filepath is, you can right-click on the file and select "Properties." The filepath will be listed under "Location."
    3. If you used any backslashes \, replace these with forward slashes /. Your username obviously does not need to be surrounded by <>; just write it as-is.
  4. Create a second new file, and copy+paste the contents of whichever other script above that you need into it. If you are operating a bot on the Discussions to act as an Abuse Filter, for example, you will want the one labeled here as discussions_delete.
    1. Find the three variables called wiki, username, and password and fill them in according to your wiki and account. The wiki name that you choose should be what you enter into the URL. I highly recommend using a bot account that is separate from your main account.
    2. Under the variable headers (used at least three times), you should technically also change the value of User-Agent from Atvelonis/Bot to <Your Username>/Bot, but this will not affect whether or not the script runs, just how some data is handled.
    3. Replace the content that's pre-written there with the content that you want to find+replace. If this is a Discussions bot meant to delete posts with certain keywords, you will also want to use a Python list instead of a thousand or statements. To do this, replace the line if 'Like, C0DA makes it canon, dude.' in content: with blacklist = ['foo', 'bar']<new line>if any(i in content for i in blacklist):. Make sure that the indentation is exactly the same. Then replace foo, bar, etc. with individual keywords that you want to add to the blacklist. The syntax for using regular expressions here is shown above.
    4. If your script is supposed to run on a continual basis, modify the value of update_interval (in seconds) as you see fit. This is how far back the bot will scan in a given feed.
  5. Open up the Command Prompt, type in py -m pip install requests, and press Enter. Follow any instructions that it gives you. This will install one of the libraries necessary for the bot to function.
  6. If you're operating a script continually (rather than just once), such as a recurring Discussions spam removal script, open Task Scheduler on Windows.
    1. In the top-right corner, click "Create Task." Name it and give it a description. Click "Run whether the user is logged on or not." Otherwise, you will get a lot of annoying popups every time it runs. Set "Configure for" to "Windows 10" or whatever your operating system is.
    2. Go to the "Triggers" tab and click "New." Check the box that says "Repeat task every 1 hour," and replace "1 hour" with the value that you wrote for update_interval in your Python file. For example, if the parameter of the variable is 60, then in Task Scheduler you will want to say "1 minute." Then press "OK."
    3. Go to the "Actions" tab and click "New." Make sure that you have it set to "Start a program" by default, and under "Program/script," fill in the filepath of the Python file that you want to run (not core.py, your second one). Then press "OK."
    4. Go to the "Settings" tab and uncheck the box that says "Stop the task if it runs longer than 3 days." Then press "OK" and enter your computer's password.

And that's it. You now have everything that you need in order to run custom Python bot scripts on Wikia. If you are running a script that needs to operate continually, such as discussions_delete, it will only run when your PC is on.

Note that the code is optimized for Windows 10. It will not work on Linux or OSX without modifications to core.py; specifically, the way that the script calls on the read/write file for login. On Linux, you should import os instead of pathlib and the first parameter for open should be something more like os.environ['HOME']+'/.discussions-bot/session.p'. If you're on OSX, you're on your own here.

Common errorsEdit

Error Fix
AttributeError: 'NoneType' object has no attribute 'get' This often happens after the bot has been offline for a while. It means that the session variable is not being set properly; it can't use an existing session, but is also unable to create a new one. This can usually be solved by creating a new read/write file for the login information, and updating the name of said file in core.py.
Last run result: (0x1)
ModuleNotFoundError: No module named 'core' If you're getting this error, you're trying to import a file named core that doesn't exist in the same directory (folder) as the current file. Put both core.py and your secondary file in the same folder and try again.
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape. This means that Python is having trouble reading the filepath you've written in core.py. If you used any backslashes \ in your filepath, replace them with forward slashes /.
The operator or administrator has refused the request (0x800710E0) If Task Scheduler isn't running the tasks, and you're receiving this error, and the task in question says "Running" (not "Ready") under "Status," the system thinks that the task is running, but the settings you're using don't allow for the task to be stopped once it fails. Either manually end and restart the task, or change your settings.
UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 74-74: Non-BMP character not supported in Tk This error occurs when Python is unable to read a character that you're trying to print out, such as an emoji in a thread title. It doesn't actually seem to stop the script from working.


*Disclosure: Some of the links above are affiliate links, meaning, at no additional cost to you, Fandom will earn a commission if you click through and make a purchase. Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+