User:LunaBot/sandbox-code

If you change anything please use a textcolour, makes it easier for me!

Templates & Changes
What I have already coded in the bot - or have to do :P
 * updated or unneeded on all: dates, level, xp, size,
 * sell updated on: all

To keep track which templates where changed:

New Coding Rules
still a work in progress, If you see a logical mistake please let me know! Some do not need to be in a specific order, but I want them all to be numbered so can easier refer to one

Rule 1
case sensitive find \{\{\s*Decoration replace {{decoration one for each:decoration, vehicle, clothing, seed, quest, animal, farm, bloom, consumable, building, tree and event. This will also make lowercase to navbars and other templates, but this shouldn't be a problem.

Rule 2
remove all comments inside templates if it's not the "Warning!" comment or the "see template page" comment
 * IFNOT blahbla find and replace with nothing \

Rule 4
remove empty params using 3 rules with 3 subrules:
 * 1a IFNOT \|\s*(XP|AUP|CP|FP|XP|SHP|SP|ZP)\s*Gained\s*=(\d+)
 * 1b find \|\s*(XP|AUP|CP|FP|XP|SHP|SP|ZP)\s*Gained\s*=\s*\n
 * 2a IFNOT \|\s*(cost|harvest|sell)(cash|coconutcoin|jade|other)\s*=(\d+)
 * 2b next \|\s*(cost|harvest|sell)(cash|coconutcoin|jade|other)\s*=\s*\n
 * 3a IFNOT \|\s*(au|c|f|a|s|j|z|)\s*Level\s*=(\d+)
 * 3b next \|\s*(au|c|f|a|s|j|z|)\s*Level\s*=\s*\n
 * And for all 3 it will be replaced with nothing - empty it.

Rule 5
(ON HOLD till templates are updated) move the number to the end of the new params using 2 rules:
 * 1a find \|\s*?(harvest|sell|cost)(\d+)_curr_(type|amt)\s*?=
 * 1b replace | $1_curr_$3$2 =
 * 2a find \|\s*?(xp|level)(\d+)_(gain|req)_(type|amt)\s*?=
 * 2b replace | $1_$3_$4$2 =

Rule 6
change old size to sizex and sizey for all that are empty or have 1
 * 1a Find \|\s*?Size\s*?=\s*?1x1
 * 1b Replace with | sizeX    = 1 (newline)| sizeY     = 1
 * 2a IFNOT \|\s*?Size\s*?=\s*?1x
 * 2b Find \|\s*?Size\s*?=\s*?1
 * 2c Replace with | sizeX    = 1 (newline)| sizeY      = 1
 * 3a IFNOT (any digit) \|\s*?Size\s*?=\s*?\d
 * 3b Find \|\s*?Size\s*?=
 * 3c Replace with | sizeX    = 1 (newline)| sizeY      = 1

Rule 7
delete mastery and image parameter if matches pagename via find and replace with nothing
 * Pagename \|\s*?Mastery Sign\s*?=\s*?\{\{PAGENAME\}\}\s*?Mastery Sign\n
 * Imagename \|\s*?Image\s*?=\s*?\{\{PAGENAME\}\}

Old Coding Rules (not all in format yet) for all templates
If you see a logical mistake please let me know!
 * delete comments in templates
 * add warning to not add comments
 * change old size parameter to new if blank or 1
 * World Rule: (\D is any letter) IF |\Dorld = replace with |farm =
 * Move number of *_type to end
 * Don't delete old harvest param for Seed, Animal & Tree
 * Don' delete old cost param for Seed
 * All infoboxes should now use first_available and last_available for the dates.
 * all infoboxes should have dates & farms
 * all old params without =\d or =? get deleted
 * xp1_gain_type is universal for all
 * space between = is a cosmetical detail, probably changed later or never by the bot

Infoboxes:
Then Subrules for each template (individual because not all are updated yet) For 1st type: For 2nd type: For 3rd type:
 * If contains (seperate for all) e.g. {{ Building\n
 * Subrule 1: If contains for each e.g. Gained\s*?=\s*?\d
 * Subrule 2: IfNOT contains xp1_gain_type
 * Subrule 3: e.g. find \|\s*?XP Gained\s*?= replace with | xp1_gain_type = Player | xp1_gain_amt =
 * Subrule 1: If contains for each e.g. Gained\s*?=\s*?\d
 * Subrule 2: If contains xp1_gain_type
 * Subrule 2: IfNOT contains xp2_gain_type
 * Subrule 3: e.g. find \|\s*?XP Gained\s*?= replace with | xp2_gain_type = Player | xp2_gain_amt =
 * Subrule 1: If contains for each e.g. Gained\s*?=\s*?\d
 * Subrule 2: If contains xp1_gain_type
 * Subrule 2: If contains xp2_gain_type
 * Subrule 2: IfNOT contains xp3_gain_type
 * Subrule 3: e.g. find \|\s*?XP Gained\s*?= replace with | xp3_gain_type = Player | xp3_gain_amt =

List of Individual Codes
Only listing one example for each

Level
replace old parameters with words from the column | level_req_type1 = (always Player) | level_req_type2 = | level_req_type3 =


 * For each level type, type the word from either column A or column B as the parameter

XP
replace old parameters AP Gained, CP Gained, ZP Gained, XP Gained etc with words from the column A
 * xp_gain_type1  =
 * xp_gain_amount1 =


 * Type and amount of experience gained. Use the lowercase singular word for the experience type.


 * For each level type, type the word from either column A or column B as the parameter

Cost
replace old parameters costcash, costcoconut, costcoin, costjade, costother with cash, coconut, coin, jade, (trowel), (zcoin), other Cost to purchase the item. Up to 3 currency types may be used. Add, do not replace on seed.
 * cost_curr_type1    =
 * cost_curr_amt1     =
 * cost_curr_type2    =
 * cost_curr_amt2     =
 * cost_curr_type3    =
 * cost_curr_amt3     =

Sell
replace old parameters sellcash, sellcoconut, sellcoin, selljade, sellother with cash, coconut, coin, jade, (trowel), (zcoin), other Amount the item can be sold for. Up to 3 currency types may be used
 * sell_curr_type1    =
 * sell_curr_amt1     =
 * sell_curr_type2    =
 * sell_curr_amt2     =
 * sell_curr_type3    =
 * sell_curr_amt3     =

Harvest
Animals, Trees & Seeds: DON'T replace old parameters harvestcash, harvestcoconut, harvestcoin, harvestjade, harvestother ADD cash, coconut, coin, jade, (trowel), (zcoin), other.

Optional for buildings and decorations: Amount item can be harvested for. Up to 3 currency types may be used Old parameters
 * harvest_curr_type1 =
 * harvest_curr_amt1  =
 * harvest_curr_type2 =
 * harvest_curr_amt2  =
 * harvest_curr_type3 =
 * harvest_curr_amt3  =
 * harvestcash    =
 * harvestcoconut =
 * harvestcoin    =
 * harvestjade    =
 * harvestother   =
 * Obsolete. Still used to calculate profit on some templates