FANDOM

LunaBot

aka LunaC

Bot
  • I live in Berlin

This is the Message Wall for the LunaBot.

If you feel that I have done something wrongly, please inform my Master and Programmer LunaC.

Please leave ALL bot requests on this message wall only!

Thank you!

A FANDOM user
  Loading editor
  • IF
    \|\s*Breeds\s*=\s*\{\{Breed/(\w+)\}\}
    FIND \|\s*Breeds\s*=\s*\{\{Breed/(\w+)\}\}
    REPLACE $ \{\{List of $1\}\}
    
      Loading editor
    • so far couldn't get the $ working in the replace, it just added the $ as text

        Loading editor
    • I don't think the condensed coding on the cfd page will work because to rename categories I use a module that has it's own rules, but I will try what I can find out...

        Loading editor
    • A FANDOM user
        Loading editor
  • The new currency template uses the old template name as the first parameter.

    Old New
    {{coin}} {{currency|coin}}
    {{coin|(\d+)}} {{currency|coin|$1}}
    {{cash}} {{currency|cash}}
    {{cash|(\d+)}} {{currency|cash|$1}}
    {{coconuts}} {{currency|coconut}}
    {{coconuts|(\d+)}} {{currency|coconut|$1}}
    etc etc
    IF
    {\{{(cash|coconut|coconuts|coin|coins|jade)\}\}
    FIND {\{{(cash|coconut|coconuts|coin|coins|jade|trowel|trowels)\}\}
    REPLACE {\{{currency\|$1\}\}<ac_metadata title="Currency template merge"> </ac_metadata>
      Loading editor
    • A FANDOM user
        Loading editor
  • The new points template uses the old template name as the first parameter.

    Old New
    {{xp}} {{points|XP}}
    {{XP|(\d+)}} {{points|XP|$1}}
    {{AP}} {{points|AP}}
    {{AP|(\d+)}} {{points|AP|$1}}
    {{CP}} {{points|CP}}
    {{CP|(\d+)}} {{points|CP|$1}}
    etc etc
      Loading editor
    • A FANDOM user
        Loading editor
  • Old parameter New parameter
    | Seed            =
    | SeedAmount      =
    | Seed2           =
    | SeedAmount2     =
    | Seed3           =
    | SeedAmount3     =
    | Gold            =
    | Silver          =
    | Bronze          =
    | Reward          =
    
    | seed1           =
    | seedamount1     =
    | seed2           =
    | seedamount2     =
    | seed3           =
    | seedamount3     =
    | gold            =
    | silver          =
    | bronze          =
    | reward          =
    
      Loading editor
    • A FANDOM user
        Loading editor
  • Harvest parameters have now been fully updated (or at least as much as they need to be at this point) for template:infobox-animal and template:infobox-tree.

    I'm still working on getting the parameters for template:seed updated.

      Loading editor
    • A FANDOM user
        Loading editor
  • This follows the same pattern as level/harvest/sell parameters (I'm just giving you part of the code, you will need finish it yourself).

    RULE
    IF = "xp_gain_type2"
    SUBRULEFIND  \|\s*?(AP|AUP|FP|SHP|SP|XP|ZP)\sGained\s*?=\s*?(\d+)/)
    REPLACE
    
    | xp_gain_type2 = $1
    | xp_gain_amt2 = $2
    

    A result from this means that someone would need to be notified to add a 2nd parameter to the infobox.

      Loading editor
  • VERY IMPORTANT! Be very, very careful using the bot on template or MediaWiki pages.

    If you see an error in the templates, and it's not a simple category fix... either fix it by human hand, or ask someone experienced with templates to fix it. Don't fix it with the bot!

    Especially on the infobox templates, you will frequently need to change multiple pages each time you make a change to certain templates. Always check the "What links here" for MediaWiki pages and other template pages when you edit a template.

    LunaBot edited the page Template:infobox-animal and broke something (it replaced dateend and datestart with first_available and last_available in the part of the template that flags for errors. It also removed some comments from that template. It also made some bad changes to some of the other templates.

      Loading editor
    • why was the Template:infobox-animal ever in the "out of date infobox" category? I thought there were only the pages that use those boxes...

        Loading editor
    • sorry that it happened, still makes me wonder, never noticed a template page in the bot list. Good the wiki has the rollback function...

        Loading editor
    • A FANDOM user
        Loading editor
  • For levels, you need to do a couple steps... First, you need to convert the parameters. Then you can do a simpler find/replace. The first part should read:

    RULE
    IF = "level_req_type3"
    SUBRULEFIND  \|\s*?(a|au|c|f|j|s|z|other)Level\s*?=\s*?(\d+)/)
    REPLACE
    
    | level_req_type4 = $1
    | level_req_amt4 = $2
    

    A result from this means that someone would need to be notified to add a 4th parameter to the infobox.

    RULE
    IFNOT = "level_req_type3"
    SUBRULE
    IF = "level_req_type2"
    SUBRULE
    IF = "level_req_type1"
    SUBRULEFIND  \|\s*?(a|au|c|f|j|s|z|other)Level\s*?=\s*?(\d+)/)
    REPLACE
    
    | level_req_type3 = $1
    | level_req_amt3 = $2
    


    RULE
    IFNOT = "level_req_type3"
    SUBRULE
    IFNOT = "level_req_type2"
    SUBRULE
    IF = "level_req_type1"
    SUBRULEFIND  \|\s*?(a|au|c|f|j|s|z|other)Level\s*?=\s*?(\d+)/)
    REPLACE
    
    | level_req_type2 = $1
    | level_req_amt2 = $2
    | level($1) = $2
    


    RULE
    IFNOT = "level_req_type3"
    SUBRULE
    IFNOT = "level_req_type2"
    SUBRULE
    IFNOT = "level_req_type1"
    SUBRULE
    FIND  \|\s*?(a|au|c|f|j|s|z|other)Level\s*?=\s*?(\d+)/)
    
    REPLACE
    
    | level_req_type1 = $1
    | level_req_amt1 = $2
    | level($1) = $2
    

    After you have replaced those parameters, you will only need to find replace:

    FIND level_req_type1 = au
    REPLACE level_req_type1 = aussie
    etc

      Loading editor
    • I just did it the other way round I think, did you check the codes on the bot sandbox?

        Loading editor
    • The only problem with the way you did it is that it creates an ambiguous parameter that does not really exist. This means that if you run it, both level and xp are converted to |aussie = . If your bot stops in the middle of the conversion, then an editor is going to have no clue what that parameter is. Also, if there are both the old auLevel and AUP Gained parameters, then your bot will choose the wrong rule to run.

        Loading editor
    • You could even combine the various xp and level replacements:

      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(au|AUP)
      REPLACE $1_$2_type$3 = aussie
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(a|AP|SHP)
      REPLACE | $1_$2_type$3 = atlantis
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(c|CP)
      REPLACE | $1_$2_type$3 = cheer
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(f|FP)
      REPLACE | $1_$2_type$3 = fairy
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(g|GP)
      REPLACE | $1_$2_type$3 = galaxy
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(j|ZP)
      REPLACE | $1_$2_type$3 = jade
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(s|SP)
      REPLACE | $1_$2_type$3 = spook
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(z)
      REPLACE | $1_$2_type$3 = rewardville
      
      FIND \|\s*?(level|xp)_(req|gain)_type(/d+)\s*?=\s*?(other)
      REPLACE | $1_$2_type$3 = other
      
        Loading editor
    • A FANDOM user
        Loading editor
    • A FANDOM user
        Loading editor
  • I had an idea for the approach you should take for adding the harvest parameters. Apologies for not putting this in correct bot code.

    finding

    The search should probably be something like the following example:

    RULE
    IFNOT = "harvest_curr_type3"
    SUBRULE
    IFNOT = "harvest_curr_type2"
    SUBRULE
    IFNOT = "harvest_curr_type1"
    SUBRULE
    FIND  = string1 "(harvestcoin) = (\d+)/)"
    

    replacing

    The result code for harvest needs to look somewhat like the following:

    $1 = $2 | harvest_curr_type1 = coin |harvest_curr_amt1 = $2
    

    $1 = contents of 1st (harvestcoin parameter), $2 = number contents of 2nd (original number value).

    Unless you figure out how to make an OR statement, this would probably need to be repeated for each different parameter. (e.g. harvestcoconut instead of harvestcoin). I'm sure someone who is more experienced with bots could make the code much simpler.

      Loading editor
    • View all 10 replies
    • Oops, I have the order wrong. The order should be

      1. check for harvest_curr_type3 or below
      2. check for harvest_curr_type2 or below
      3. check for harvest_curr_type1
        Loading editor
    • So... it should read:

      RULE
      IF = "harvest_curr_type3"
      SUBRULEFIND  \|\s*?harvest(cash|coconut|coin|jade|other)\s*?=\s*?(\d+)
      REPLACE
      
      | harvest_curr_type4 = $1
      | harvest_curr_amt4 = $2
      | harvest($1) = $2
      

      A result from this means that someone would need to be notified to add a 4th parameter to the infobox.

      RULE
      IFNOT = "harvest_curr_type3"
      SUBRULE
      IF = "harvest_curr_type2"
      SUBRULE
      IF = "harvest_curr_type1"
      SUBRULEFIND  \|\s*?harvest(cash|coconut|coin|jade|other)\s*?=\s*?(\d+)
      REPLACE
      
      | harvest_curr_type3 = $1
      | harvest_curr_amt3 = $2
      | harvest($1) = $2
      


      RULE
      IFNOT = "harvest_curr_type3"
      SUBRULE
      IFNOT = "harvest_curr_type2"
      SUBRULE
      IF = "harvest_curr_type1"
      SUBRULEFIND  \|\s*?harvest(cash|coconut|coin|jade|other)\s*?=\s*?(\d+)
      REPLACE
      
      | harvest_curr_type2 = $1
      | harvest_curr_amt2 = $2
      | harvest($1) = $2
      


      RULE
      IFNOT = "harvest_curr_type3"
      SUBRULE
      IFNOT = "harvest_curr_type2"
      SUBRULE
      IFNOT = "harvest_curr_type1"
      SUBRULE
      FIND  \|\s*?harvest(cash|coconut|coin|jade|other)\s*?=\s*?(\d+)
      
      REPLACE
      
      | harvest_curr_type1 = $1
      | harvest_curr_amt1 = $2
      | harvest($1) = $2
      
        Loading editor
    • A FANDOM user
        Loading editor
Give Kudos to this message
You've given this message Kudos!
See who gave Kudos to this message
Community content is available under CC-BY-SA unless otherwise noted.