User:A proofbot/Source

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search

This page links to the source code files for the tasks performed by A proofbot.

MediaWiki.java[edit | edit source]

MediaWiki.java is the wiki bot framework for Java written by User:A proofreader and required by all tasks to function. It is released under the GPLv3.

The package for this file is org.mediawiki. Make sure you save this file to org/mediawiki/MediaWiki.java on your local filesystem if you download it. (That is, create the folder 'org', then 'mediawiki' inside it, then save the file in 'mediawiki').

ClanExpGainScraper.java[edit | edit source]

ClanExpGainScraper.java is the main code file for the task to update RuneScape:Clan Chat/hiscores, written by A proofreader and 122.58.38.62, also known as Cursed Pyres. It is released under the GPLv3.

The package for this file is com.wikia.runescape. Make sure you save this file to com/wikia/runescape/ClanExpGainScraper.java on your local filesystem if you download it.

VisualEditorFailFixer.java[edit | edit source]

VisualEditorFailFixer.java is the main code file for the task to fix Visual Editor glitches, written by A proofreader. It is released under the GPLv3.

The package for this file is com.wikia.runescape. Make sure you save this file to com/wikia/runescape/VisualEditorFailFixer.java on your local filesystem if you download it.

Tools required[edit | edit source]

In addition to the two compiled Java source files, the following tool is required:

Installation instructions are found on the project's page. Please make sure that the tool is in the PATH before running the bot.

Compiling[edit | edit source]

As this bot has 1 common file and 1 file for each task, you can use your favourite Java IDE to import and compile the files, or you can use javac on the files' paths:

javac org/mediawiki/MediaWiki.java path/to/task/Program.java

If using the javac command, it needs to be used in the folder containing 'org'. For example, if you saved the two files as

/home/me/wikibots/proofbot/org/mediawiki/MediaWiki.java
/home/me/wikibots/proofbot/path/to/task/Program.java

you would use this command before javac to change to the correct directory:

cd /home/me/wikibots/proofbot

Configuration[edit | edit source]

Clan highscores update task[edit | edit source]

This task uses a configuration file to do its work. Its location is $HOME/.clanscraper.conf by default, but can be modified (see Running, below). ($HOME is going to be /home/youruser on Unix, /Users/You on Mac OS, and C:\Documents and Settings\You or C:\Users\You on Windows.) Here is a brief description of each configuration directive:

  • Wiki=runescape.wikia.com (this is the domain of the wiki to work on)
  • OutputPage=RuneScape:Clan Chat/hiscores (this is the name of the output page under the wiki's domain)
  • LogPage=RuneScape talk:Clan Chat/hiscores (this is the name of the log page under the wiki's domain, which is updated with joining and quitting users in the clan as well as errors)
  • LoginName=A proofbot
  • LoginPassword=NotWritingItHere
  • Clan=RSW (this is the name of the clan on the Jagex clan home)

Visual Editor glitch fixer task[edit | edit source]

This task uses a configuration file to do its work. Its location is $HOME/.rtefixer.conf. ($HOME is going to be /home/youruser on Unix, /Users/You on Mac OS, and C:\Documents and Settings\You or C:\Users\You on Windows.) Here is a brief description of each configuration directive:

  • Wiki=runescape.wikia.com (this is the domain of the wiki to work on)
  • LoginName=A proofbot
  • LoginPassword=NotWritingItHere

Running[edit | edit source]

A task can then be launched from the command line, using this command in the correct directory:

java path.to.task.Program

You can also tell the clan highscores update task to use a different configuration file, used most powerfully if running multiple tasks on a schedule, by using the --config-file command line argument:

java path.to.task.Program --config-file /home/youruser/alternate-config-file.txt

Logging to a file[edit | edit source]

If you wish to log to a file, and are running Windows XP, Unix, Linux or Mac OS X, you can start the bot with this command instead:

java path.to.task.Program 2>> log.log

Starting the ClanExpGainScraper task weekly[edit | edit source]

On Unix and Linux, the crontab mechanism can be used to start the bot once a week. Use a line like the following:

0 19   * * 6   youruser  /usr/bin/java -classpath /home/youruser/botfiles com.wikia.runescape.ClanExpGainScraper

Make sure that ClanExpGainScraper.class and MediaWiki.class are in the correct places. These are the compiled versions of the bot files. For example, in /home/youruser/botfiles:

  • /home/youruser/botfiles/org/mediawiki/MediaWiki.class
  • /home/youruser/botfiles/com/wikia/runescape/ClanExpGainScraper.class

Starting the ClanExpGainScraper task on multiple schedules[edit | edit source]

Using the --config-file argument on the command-line, one may start multiple concurrent tasks. Use crontab lines like the following:

0 19   * * 6   youruser  /usr/bin/java -classpath /home/youruser/botfiles com.wikia.runescape.ClanExpGainScraper --config-file /home/youruser/clanscraper-weekly.conf
0 0    1 * *   youruser  /usr/bin/java -classpath /home/youruser/botfiles com.wikia.runescape.ClanExpGainScraper --config-file /home/youruser/clanscraper-monthly.conf

This would run the bot on day 6 (Saturday) at 19:00 your local time every week, and on day 1 (the 1st) at midnight your local time every month, using different configurations for possibly different output pages.