Build a bot

Photo credit: Terminator 3 producers.

AndrewForson wrote:

Perhaps a kind person would publish a pointer to some build-your-own-bot code?

This guide will explain how to make a basic reprogrammable python bot similar to DysklyerBot, which has made over a million edits.

Basic bot with Python


  • A brain, eyes, and fingers.
  • The ability to read and count to ten.
  • A machine running Linux, preferably Ubuntu.
  • The ability to install Python.
  •  Knowledge of how to access the command line.

Start with creating an account on the wiki that needs your super helpful automated edits. Take note of the username and password.

Find the command line of your machine, you will be doing everything on the command line, therefore no GUI interface is needed. You can thus simply use a cloud machine if you don’t have linux on your local computer. It is possible to install this bot on Windows, but that is not detailed in this guide.

From this point the instructions are basically following the Pywikibot Installation Manual.

  • Install or upgrade Python to be version 2.7.4 or higher, or version 3.4 or higher.
  • Run $ pip install requests to install the pip package called “requests”
  • Download (this can be done with the “wget” command, e.g. $ wget
  • Unzip the package with $ tar -xzf core.tar.gz
  • Change directory with $ cd core/
  • Type $ python generate_user_files and follow the instructions that the program generates.
  • Don’t set a bot password unless you have bot permissions.


You should now have a working bot, capable of editing any wiki at immense speeds.

This is a list of scripts which are included in your new bot, you can use them as instructed, for example:

$ python -ns:0 -start:! -pt:31 -maxlag:10

Will make standard cosmetic changes to the markup of all mainspace pages on the wiki, starting alphabetically, making one edit every 31 seconds so as not to show up on the botwatch monitor. Or;

$ python add_text -ns:0 -start:! -text:"Crizur crusing" -pt:0 -maxlag:5

To add the text “Crizur crusing” to every article on the wiki as fast as possible. Or;

$ python add_text -ns:2 -start:! -regex "admin" "sysop" -pt:10 -maxlag:5

To change all mentions of “admin” to “sysop” in the talk namespace, making one edit every ten seconds.

The bot does not need a bot password, will work without a bot flag, and does not need any special user groups.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.