Help:Bots

PyWikiBot
For all of those who are interested in using PBW. Here's a step-by-step guide:


 * Download Python. Should be a python 3.x version.

To permanently modify the default environment variables, click Start and search for ‘edit environment variables’, or open System properties, Advanced system settings and click the Environment Variables button. In this dialog, you can add or modify User and System variables. To change System variables, you need non-restricted access to your machine (i.e. Administrator rights).
 * Check if Python was added to your windows path.


 * Download Request. This is a python module required for PWB.


 * From now on you need CMD, the windows command line. Install the "request" module via . You can change the directory with   to go whereever you unpacked the "request" setup.py.


 * Download PWB and unpack it somewhere (e.g. under C:/Programs/PWB)


 * Create an emtpy file called "dota2_family.py" in C:/Programs/PWB/pywikibot/families/ and paste in the following content:


 * 1) -*- coding: utf-8 -*-

from pywikibot import family from pywikibot.tools import deprecated

class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'dota2' self.langs = { 'de': 'dota2-de.gamepedia.com', 'en': 'dota2.gamepedia.com', 'pt': 'dota2-pt.gamepedia.com', 'ru': 'dota2-ru.gamepedia.com', 'zh': 'dota2-zh.gamepedia.com', }

def scriptpath(self, code): return { 'de': '', 'en': '', 'pt': '', 'ru': '', 'zh': '', }[code]

def protocol(self, code): return 'HTTPS'


 * Run  from your PWB folder via CMD. Follow the instructions.


 * Optionally delete the two example files.

family = 'dota2'
 * Open the user-config.py and do some modifications: These were my modifications. Of course you are neither admin (sysop) on every page, nor do you have a need for listing all of languages. Just take what you need.
 * 1) If you use either of these functions to define the family to work on by
 * 2) default (the ‘family’ variable below), you must place the function call
 * 3) before the definition of the ‘family’ variable.

mylang = 'en'
 * 1) The language code of the site we're working on.


 * 1) The dictionary usernames should contain a username for each site where you
 * 2) have a bot account. If you have a unique username for all languages of a
 * 3) family, you can use '*'

password_file = "user-password.py"

usernames['dota2']['en'] = u'Username' usernames['dota2']['de'] = u'Username' usernames['dota2']['pt'] = u'Username' usernames['dota2']['ru'] = u'Username' usernames['dota2']['zh'] = u'Username' sysopnames['dota2']['en'] = u'Username' sysopnames['dota2']['de'] = u'Username' sysopnames['dota2']['pt'] = u'Username' sysopnames['dota2']['ru'] = u'Username' sysopnames['dota2']['zh'] = u'Username'


 * Set up a new bot access here: Special:BotPasswords


 * Create a new password file called  in the folder with the following content. Replace  with the details you defined for the bot access:

("", BotPassword("", ""))


 * Done, you can make a checkrun with such a command. It will list all pages that contain "Slar" (e.g. Slark and Slardar):