User:RSW image renamer/Source

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

This page links to the 2 source code files for RSW image renamer.[edit | edit source] is the wiki bot framework for Java written by User:A proofreader and required by the bot 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/ on your local filesystem if you download it. (That is, create the folder 'org', then 'mediawiki' inside it, then save the file in 'mediawiki').[edit | edit source] is the main code file for RSW image renamer, 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/ 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.

Compiling[edit | edit source]

As this bot has 2 files, you can use your favourite Java IDE to import and compile the files, or you can use javac on the two files' paths:

javac org/mediawiki/ com/wikia/runescape/

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


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

cd /home/me/wikibots/imagerenamer

Configuration[edit | edit source]

This bot uses a configuration file to do its work. Its location is $HOME/.imgmovebot.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:

  • (this is the domain of the wiki to work on)
  • RequestPage=User:RSW image renamer/Requests (this is the name of the request page under the wiki's domain)
  • LastRequestRevision=589252 (this is a variable that gets set by the bot; when transferring the bot to another user to run, this must be preserved to avoid spamming user talk pages with move errors for files that have already been moved long ago)
  • RunInterval=180 (this is the number of seconds to wait between reads of the RequestPage)
  • LoginName=RSW image renamer
  • LoginPassword=NotWritingItHere

This bot can be safely stopped using Ctrl+C, even in the middle of its processing. It saves a list of actions to the hard drive, at $HOME/.imgmovebot-leftover.ser, to be continued when it next starts. When empty, this file is 56 bytes, but it can grow to several megabytes.

Running[edit | edit source]

The bot can then be launched from the command line, using this command in the correct directory:

java com.wikia.runescape.ImageRenamerBot

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 com.wikia.runescape.ImageRenamerBot 2>> log.log