Aeredor: Difference between revisions

From Against the Storm Official Wiki
(using output from log)
(saving my unit testing code for the debug consoles)
Line 1: Line 1:
<table class="wikitable" style="white-space:nowrap">
-------------------------------------------------------------------------------
  <tr>
-- Unit testing
    <th>Building</th>
-------------------------------------------------------------------------------
    <th>Ingredient #1</th>
    <th>Ingredient #2</th>
    <th>Ingredient #3</th>
    <th>Outcome</th>
  </tr>
  <tr>
    <td>{{bl|Scribe|large}} <br /> {{1Star}} <br /> 02:06</td>
    <td></td>
    <td>10 {{rl|Wood|med}} <br /> 3 {{rl|Planks|med}}</td>
    <td>4 {{rl|Copper Bars|med}} <br /> 4 {{rl|Crystalized Dew|med}}</td>
    <td>2 {{rl|Simple Tools|large}}</td>
  </tr>
</table>






<table class="wikitable sortable"><tr><th>Building</th><th>Ingredient #1</th><th>Ingredient #2</th><th>Ingredient #3</th><th>Product</th></tr><tr><td>[[File:Field_Kitchen_icon.png|left|x64px|link=Field Kitchen|alt=Field Kitchen|Field Kitchen]] [[Field Kitchen]]<br />
-- Module:Recipe_link
[[File:Grade Stars 0.png|12px|link=|alt=0 Stars]]<br />02:06<td class="ATSempty"></td><td class="ATSswappable">7 [[File:Vegetables.png|x32px|link=Vegetables|alt=Vegetables|Vegetables]] [[Vegetables]]<br />7 [[File:Mushrooms.png|x32px|link=Mushrooms|alt=Mushrooms|Mushrooms]] [[Mushrooms]]<br />7 [[File:Roots.png|x32px|link=Roots|alt=Roots|Roots]] [[Roots]]<br />7 [[File:Berries.png|x32px|link=Berries|alt=Berries|Berries]] [[Berries]]<br />7 [[File:Eggs.png|x32px|link=Eggs|alt=Eggs|Eggs]] [[Eggs]]</td><td class="ATSswappable">3 [[File:Pottery.png|x32px|link=Pottery|alt=Pottery|Pottery]] [[Pottery]]<br />3 [[File:Barrels.png|x32px|link=Barrels|alt=Barrels|Barrels]] [[Barrels]]<br />3 [[File:Waterskins.png|x32px|link=Waterskins|alt=Waterskins|Waterskins]] [[Waterskins]]</td><td>10 [[File:PickledGoods.png|x64px|link=Pickled Goods|alt=Pickled Goods|Pickled Goods]] [[Pickled Goods]]</td></td></tr><tr><td>[[File:Granary_icon.png|left|x64px|link=Granary|alt=Granary|Granary]] [[Granary]]<br />★★<br />02:06<td class="ATSempty"></td><td class="ATSswappable">5 [[File:Vegetables.png|x32px|link=Vegetables|alt=Vegetables|Vegetables]] [[Vegetables]]<br />5 [[File:Mushrooms.png|x32px|link=Mushrooms|alt=Mushrooms|Mushrooms]] [[Mushrooms]]<br />5 [[File:Roots.png|x32px|link=Roots|alt=Roots|Roots]] [[Roots]]<br />5 [[File:Berries.png|x32px|link=Berries|alt=Berries|Berries]] [[Berries]]<br />5 [[File:Eggs.png|x32px|link=Eggs|alt=Eggs|Eggs]] [[Eggs]]</td><td class="ATSswappable">3 [[File:Pottery.png|x32px|link=Pottery|alt=Pottery|Pottery]] [[Pottery]]<br />3 [[File:Barrels.png|x32px|link=Barrels|alt=Barrels|Barrels]] [[Barrels]]<br />2 [[File:Waterskins.png|x32px|link=Waterskins|alt=Waterskins|Waterskins]] [[Waterskins]]</td><td>10 [[File:PickledGoods.png|x64px|link=Pickled Goods|alt=Pickled Goods|Pickled Goods]] [[Pickled Goods]]</td></td></tr><tr><td>[[File:Cellar_icon.png|left|x64px|link=Cellar|alt=Cellar|Cellar]] [[Cellar]]<br />★<br />02:06<td class="ATSempty"></td><td class="ATSswappable">6 [[File:Vegetables.png|x32px|link=Vegetables|alt=Vegetables|Vegetables]] [[Vegetables]]<br />6 [[File:Mushrooms.png|x32px|link=Mushrooms|alt=Mushrooms|Mushrooms]] [[Mushrooms]]<br />6 [[File:Roots.png|x32px|link=Roots|alt=Roots|Roots]] [[Roots]]<br />6 [[File:Berries.png|x32px|link=Berries|alt=Berries|Berries]] [[Berries]]<br />6 [[File:Eggs.png|x32px|link=Eggs|alt=Eggs|Eggs]] [[Eggs]]</td><td class="ATSswappable">3 [[File:Pottery.png|x32px|link=Pottery|alt=Pottery|Pottery]] [[Pottery]]<br />3 [[File:Barrels.png|x32px|link=Barrels|alt=Barrels|Barrels]] [[Barrels]]<br />3 [[File:Waterskins.png|x32px|link=Waterskins|alt=Waterskins|Waterskins]] [[Waterskins]]</td><td>10 [[File:PickledGoods.png|x64px|link=Pickled Goods|alt=Pickled Goods|Pickled Goods]] [[Pickled Goods]]</td></td></tr><tr><td>[[File:Brewery_icon.png|left|x64px|link=Brewery|alt=Brewery|Brewery]] [[Brewery]]<br />★<br />02:06<td class="ATSempty"></td><td class="ATSswappable">6 [[File:Vegetables.png|x32px|link=Vegetables|alt=Vegetables|Vegetables]] [[Vegetables]]<br />6 [[File:Mushrooms.png|x32px|link=Mushrooms|alt=Mushrooms|Mushrooms]] [[Mushrooms]]<br />6 [[File:Roots.png|x32px|link=Roots|alt=Roots|Roots]] [[Roots]]<br />6 [[File:Berries.png|x32px|link=Berries|alt=Berries|Berries]] [[Berries]]<br />6 [[File:Eggs.png|x32px|link=Eggs|alt=Eggs|Eggs]] [[Eggs]]</td><td class="ATSswappable">3 [[File:Pottery.png|x32px|link=Pottery|alt=Pottery|Pottery]] [[Pottery]]<br />3 [[File:Barrels.png|x32px|link=Barrels|alt=Barrels|Barrels]] [[Barrels]]<br />3 [[File:Waterskins.png|x32px|link=Waterskins|alt=Waterskins|Waterskins]] [[Waterskins]]</td><td>10 [[File:PickledGoods.png|x64px|link=Pickled Goods|alt=Pickled Goods|Pickled Goods]] [[Pickled Goods]]</td></td></tr><tr><td>[[File:Brewery_icon.png|left|x64px|link=Flawless Brewery|alt=Flawless Brewery|Flawless Brewery]] [[Flawless Brewery]]<br />★★★<br />01:45<td class="ATSempty"></td><td class="ATSswappable">4 [[File:Vegetables.png|x32px|link=Vegetables|alt=Vegetables|Vegetables]] [[Vegetables]]<br />4 [[File:Mushrooms.png|x32px|link=Mushrooms|alt=Mushrooms|Mushrooms]] [[Mushrooms]]<br />4 [[File:Roots.png|x32px|link=Roots|alt=Roots|Roots]] [[Roots]]<br />4 [[File:Berries.png|x32px|link=Berries|alt=Berries|Berries]] [[Berries]]<br />4 [[File:Eggs.png|x32px|link=Eggs|alt=Eggs|Eggs]] [[Eggs]]</td><td class="ATSswappable">3 [[File:Pottery.png|x32px|link=Pottery|alt=Pottery|Pottery]] [[Pottery]]<br />3 [[File:Barrels.png|x32px|link=Barrels|alt=Barrels|Barrels]] [[Barrels]]<br />2 [[File:Waterskins.png|x32px|link=Waterskins|alt=Waterskins|Waterskins]] [[Waterskins]]</td><td>15 [[File:PickledGoods.png|x64px|link=Pickled Goods|alt=Pickled Goods|Pickled Goods]] [[Pickled Goods]]</td></td></tr></table>
frame = mw.getCurrentFrame()
frame.args = { building="Cookhouse", iconsize="med" }
txt = p.renderLink(frame)
mw.log(txt)
 
 
 
-- Module:BuildingData
mw.log( "data = " ) mw.logObject( p.getData("Alchemist's Hut") )
mw.log( "---Good states---")
mw.log( "Alchemist's Hut ? " .. p.getPagename("Alchemist's Hut") )
mw.log( "Alchemist_Hut_icon.png ? " .. p.getIconFilename("Alchemist's Hut") )
mw.log( "Specializations Alchemy and Brewing ? " ) mw.logObject( p.getSpecialization("Alchemist's Hut") )
mw.log( "Costs 5 Planks & 2 Bricks ? " ) mw.logObject( p.getCosts("Alchemist's Hut") )
mw.log( "2 ? " .. p.getWorkers("Alchemist's Hut") )
mw.log( "Clearance Water ? " .. p.getRainType("Alchemist's Hut") )
mw.log( "Can produce: Crystalized Dew (★★), Cosmetics (★★), Wine (★★). Can use: Clearance Water. Can't be moved. Size: 3x2. ? \n" .. p.getDescription("Alchemist's Hut") )
mw.log( "----------------------\n---Error states---" )
mw.log( "getData(Alchy) should return nil ?" ) mw.logObject( p.getData("Alchy") )
mw.log( "getPagename(Alchy) should be nil ?" ) mw.logObject( p.getPagename("Alchy") )
mw.log( "getIconFilename(Alchy) should be nil ?" ) mw.logObject( p.getIconFilename("Alchy") )
mw.log( "getSpecialization(Alchy) should be nil ?" ) mw.logObject( p.getSpecialization("Alchy") )
mw.log( "getCosts(Alchy) should return nil ?" ) mw.logObject( p.getCosts("Alchy") )
mw.log( "getWorkers(Alchy) should be nil ?" ) mw.logObject( p.getWorkers("Alchy") )
mw.log( "getRainType(Alchy) should return nil ?" ) mw.logObject( p.getRainType("Alchy") )
mw.log( "getDescription(Alchy) should be nil ?" ) mw.logObject( p.getDescription("Alchy") )
 
 
 
-- Module:ResourceData
mw.log( "data = " ) mw.logObject( p.getData("Berries") )
mw.log( "---Good states---" )
mw.log( "Berries ? " .. p.getPagename("Berries") )
mw.log( "Icon_Resource_Berries.png ? " .. p.getIconFilename("Berries") )
mw.log( "Food / Raw Food ? " .. string.format("%s / %s",p.getCategories("Berries")) )
mw.log( "true ? " .. tostring( p.isEatable("Berries") ) )
mw.log( "false or nil ? " .. tostring( p.isBurnable("Berries") ) )
mw.log( "false or nil ? " .. tostring( p.isEatable("Coal") ) )
mw.log( "true ? " .. tostring( p.isBurnable("Coal") ) )
mw.log( "60 / 18 ? " .. string.format("%s / %s",p.getBurnTimeAndSacrificeRate("Coal") ) )
mw.log( "nil ? " .. tostring(p.getBurnTimeAndSacrificeRate("Berries")) )
mw.log( "0.24 / 0.40 ? " .. string.format("%s / %s",p.getSellAndBuyValues("Berries")) )
mw.log( "Common food source. Obtained by: Plantation, Hallowed Herb Garden, Herbalists' Camp, Small Herbalists' Camp. ? \n" .. p.getDescription("Berries") )
mw.log( "----------------------\n---Error states---" )
mw.log( "getData(Bears) should return nil ?" ) mw.logObject( p.getData("Bears") )
mw.log( "getPagename(Bears) should return nil ?" ) mw.logObject( p.getPagename("Bears") )
mw.log( "getIconFilename(Bears) should return nil ?" ) mw.logObject( p.getIconFilename("Bears") )
mw.log( "getCategories(Bears) should return nil ?" ) mw.logObject( p.getCategories("Bears") )
mw.log( "isEatable(Bears) should return nil ?" ) mw.logObject( p.isEatable("Bears") )
mw.log( "isBurnable(Bears) should return nil ?" ) mw.logObject( p.isBurnable("Bears") )
mw.log( "getBurnTimeAndSacrificeRate(Bears) should return nil ?" ) mw.logObject( p.getBurnTimeAndSacrificeRate("Bears") )
mw.log( "getSellAndBuyValues(Bears) should return nil ?" ) mw.logObject( p.getSellAndBuyValues("Bears") )
mw.log( "getDescription(Bears) should return nil ?" ) mw.logObject( p.getDescription("Bears") )

Revision as of 03:04, 14 February 2023


-- Unit testing



-- Module:Recipe_link frame = mw.getCurrentFrame() frame.args = { building="Cookhouse", iconsize="med" } txt = p.renderLink(frame) mw.log(txt)


-- Module:BuildingData mw.log( "data = " ) mw.logObject( p.getData("Alchemist's Hut") ) mw.log( "---Good states---") mw.log( "Alchemist's Hut ? " .. p.getPagename("Alchemist's Hut") ) mw.log( "Alchemist_Hut_icon.png ? " .. p.getIconFilename("Alchemist's Hut") ) mw.log( "Specializations Alchemy and Brewing ? " ) mw.logObject( p.getSpecialization("Alchemist's Hut") ) mw.log( "Costs 5 Planks & 2 Bricks ? " ) mw.logObject( p.getCosts("Alchemist's Hut") ) mw.log( "2 ? " .. p.getWorkers("Alchemist's Hut") ) mw.log( "Clearance Water ? " .. p.getRainType("Alchemist's Hut") ) mw.log( "Can produce: Crystalized Dew (★★), Cosmetics (★★), Wine (★★). Can use: Clearance Water. Can't be moved. Size: 3x2. ? \n" .. p.getDescription("Alchemist's Hut") ) mw.log( "----------------------\n---Error states---" ) mw.log( "getData(Alchy) should return nil ?" ) mw.logObject( p.getData("Alchy") ) mw.log( "getPagename(Alchy) should be nil ?" ) mw.logObject( p.getPagename("Alchy") ) mw.log( "getIconFilename(Alchy) should be nil ?" ) mw.logObject( p.getIconFilename("Alchy") ) mw.log( "getSpecialization(Alchy) should be nil ?" ) mw.logObject( p.getSpecialization("Alchy") ) mw.log( "getCosts(Alchy) should return nil ?" ) mw.logObject( p.getCosts("Alchy") ) mw.log( "getWorkers(Alchy) should be nil ?" ) mw.logObject( p.getWorkers("Alchy") ) mw.log( "getRainType(Alchy) should return nil ?" ) mw.logObject( p.getRainType("Alchy") ) mw.log( "getDescription(Alchy) should be nil ?" ) mw.logObject( p.getDescription("Alchy") )


-- Module:ResourceData mw.log( "data = " ) mw.logObject( p.getData("Berries") ) mw.log( "---Good states---" ) mw.log( "Berries ? " .. p.getPagename("Berries") ) mw.log( "Icon_Resource_Berries.png ? " .. p.getIconFilename("Berries") ) mw.log( "Food / Raw Food ? " .. string.format("%s / %s",p.getCategories("Berries")) ) mw.log( "true ? " .. tostring( p.isEatable("Berries") ) ) mw.log( "false or nil ? " .. tostring( p.isBurnable("Berries") ) ) mw.log( "false or nil ? " .. tostring( p.isEatable("Coal") ) ) mw.log( "true ? " .. tostring( p.isBurnable("Coal") ) ) mw.log( "60 / 18 ? " .. string.format("%s / %s",p.getBurnTimeAndSacrificeRate("Coal") ) ) mw.log( "nil ? " .. tostring(p.getBurnTimeAndSacrificeRate("Berries")) ) mw.log( "0.24 / 0.40 ? " .. string.format("%s / %s",p.getSellAndBuyValues("Berries")) ) mw.log( "Common food source. Obtained by: Plantation, Hallowed Herb Garden, Herbalists' Camp, Small Herbalists' Camp. ? \n" .. p.getDescription("Berries") ) mw.log( "----------------------\n---Error states---" ) mw.log( "getData(Bears) should return nil ?" ) mw.logObject( p.getData("Bears") ) mw.log( "getPagename(Bears) should return nil ?" ) mw.logObject( p.getPagename("Bears") ) mw.log( "getIconFilename(Bears) should return nil ?" ) mw.logObject( p.getIconFilename("Bears") ) mw.log( "getCategories(Bears) should return nil ?" ) mw.logObject( p.getCategories("Bears") ) mw.log( "isEatable(Bears) should return nil ?" ) mw.logObject( p.isEatable("Bears") ) mw.log( "isBurnable(Bears) should return nil ?" ) mw.logObject( p.isBurnable("Bears") ) mw.log( "getBurnTimeAndSacrificeRate(Bears) should return nil ?" ) mw.logObject( p.getBurnTimeAndSacrificeRate("Bears") ) mw.log( "getSellAndBuyValues(Bears) should return nil ?" ) mw.logObject( p.getSellAndBuyValues("Bears") ) mw.log( "getDescription(Bears) should return nil ?" ) mw.logObject( p.getDescription("Bears") )