|
|
| Line 2: |
Line 2: |
| local cargo = mw.ext.cargo | | local cargo = mw.ext.cargo |
|
| |
|
| function p.main( args ) | | function p.main ( frame ) |
| print('This is a test') | | return "Hello, world!" |
| local belleName = args[1] and mw.text.trim(args[1])
| |
| local tables = "MISC_BelleMoreInfo"
| |
| local fields = "TXT_Summary"
| |
| | |
| local cargoArgs = {
| |
| where = "MISC_BelleMoreInfo.FK_Belle = '" .. belleName .. "'",
| |
| default ='Description not defined',
| |
| limit = 1
| |
| }
| |
| local results = cargo.query( tables, fields, cargoArgs )
| |
| for r = 1, #results do
| |
| local result = results[r]
| |
| if result == nil then
| |
| return 'Empty Cargo...'
| |
| else
| |
| return result.TXT_Summary
| |
| end
| |
| end
| |
| end | | end |
|
| |
|
| return p | | return p |