User talk:Magill-bot

From Lotro-Wiki.com
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

I am a bot. Please comment on my owner's talk page: User Talk:Magill

Prep work for Changes

  • Template: Skill has been modified to provide a pop-up tool-tip and other features. - Updated
  • All template components have been updated and matched.
  • Template: Effect has been modified to provide a pop-up tool-tip and other features. - Updated
  • All template components have been updated and matched.
  • Template: Trait not to be confused with Template:Traits has been modified to provide a pop-up tool-tip and other features.

Proposed changes to Skill entries

This can apply to both skills and effects... and also to Traits:

See: Minstrel_Skills#Anthems for a group of Skills and effects which have been modified by hand.  Greater Anthem II - War displays the icon in-line, while Greater Anthem II - War, simply provides the tool-tip.
Note that the syntax: {{:Anthem of War|mode=imlink}} is used for the Icon and {{:Anthem of War|mode=link}} without.

The following changes need to be made to support this.

1- add/modify to read:
__NOTOC__<onlyinclude>{{Skill
__NOTOC__<onlyinclude>{{Effect
__NOTOC__<onlyinclude>{{Trait   -- change {{Infobox Trait to {{Trait

2- Delete if present {{toc-right}}

3- add if not present 
  | mode={{{mode|}}}
  | arg={{{arg|}}}
  | disambigpage        = {{s<includeonly />ubst:FULLPAGENAME}}

4- delete | amount={{{amount|}}}

5- change image to icon
6- change -icon.png to -icon

7- Add/modify }}</onlyinclude>

  • There are issues with multiple Skill entries on the same page... subsequent entries after the first do not get the:
__NOTOC__<onlyinclude></onlyinclude> entries, however, they do get changes 2,3,4,5
I don't understand the workings or the implications, but that appears to make things work correctly.

Change "image" to "icon" in Skills and Effects

Purpose: The Boilerplate:Skill, Template:Skill/Preload, and Template:Skill/doc files incorrectly labeled the parameter "Image" when it should have been "icon". Similarly, they called for "-icon.png" instead of simply "-icon" as the icon file suffix.

  • On both Skill and Effect templates -- this bot changes:
image to icon
-icon.png to -icon

Contents of user-fixes.py.

# -*- coding: utf-8  -*-

#
# This is to change the image parameter to icon
#

fixes['Icon'] = {
    'regex': False,
    'msg': {
        'en':u'Robot: change image to icon for Skills and Effects',
    },
    'replacements': [
        (ur'image', u'icon'),
        (ur'-icon.png', u'-icon'),
    ]
}
  • Example command lines.
python replace_lotro.py -nopreload -fix:Icon "-page:Hammer of Rohan (Rohirrim)"

Categories

Comments from Amphoras

Most of the time I used replace.py to make changes. https://www.mediawiki.org/wiki/Manual:Pywikipediabot/replace.py gives some example of the different commands that you can use. Most of the time when I did it, I would use a command like:

replace.py -transcludes:Effect "{{Effect" "{{Effect\n|mode={{{mode|}}}" -excepttext:"{{{mode|}}}" -excepttitle:"User" -summary:"Add mode parameter for effects" -always -pt:10

This tells the bot to run on all pages that use the Effect template. It will add in the mode parameter right at the start of the effect. The excepttext and excepttitle commands tell the bot not to make the replacement on pages that already have the mode parameter, or on any pages with User in the title (eg. the User namespace where people may be testing things). -summary sets the edit summary that will appear if you want to override the default. -always tells the bot to make the changes without asking first. Normally, the bot shows the change in the command prompt, and you have to confirm each change before the bot makes the edit. With this command you can tell it just to make the edit without checking. This is very useful when you are doing something like this where there are hundreds of pages to be edited. As long as you are sure that the replacement you have specified is narrow enough that it won't cause any problems, you can use this command. Even when you are sure, its best to still check in the recent changes that nothing bad is happening every so often anyway. The pt or putthrottle command limits how often the bot can make an edit. In the example, the bot can edit at most once every 10 seconds. You can use this to avoid making edits too quickly when the wiki is busy. In my experience, the wiki is fine with it set to 1 second, I might even have set it to 0 before, I don't remember. I've never noticed any problems on the wiki while using the bot before anyway, and no one else reported any issues either.
There are more commands on that page. You can set the bot to run on a list of pages, specific pages, namespaces, etc. You can use regex expressions in the replacements and some of the other commands as well.
For extra fixes, I know EoD had a file for this, I think it is on RingTailCat's bot page if you want to look at it.