User:Illviljan/cargo: Difference between revisions
Jump to navigation
Jump to search
>Illviljan |
>Illviljan No edit summary |
||
Line 1: | Line 1: | ||
==Intro== | ==Intro== | ||
Line 14: | Line 6: | ||
** results[2][version.version] | ** results[2][version.version] | ||
==Lists of strings== | |||
===HOLDS=== | |||
{{#cargo_query: | {{#cargo_query: | ||
tables = events | tables = events | ||
Line 22: | Line 16: | ||
}} | }} | ||
===HOLDS NOT=== | |||
{{#cargo_query: | {{#cargo_query: | ||
tables = | tables = events | ||
|fields = | |fields = events.name, events.id | ||
|where = | |where = | ||
events.id HOLDS NOT LIKE "SSF%" | |||
AND events.id HOLDS LIKE "%Hardcore%" | |||
}} | }} | ||
==Lua equivalents== | |||
{{#cargo_query: | {{#cargo_query: | ||
tables = mods, spawn_weights | tables = mods, spawn_weights | ||
Line 68: | Line 52: | ||
) | ) | ||
</pre> | </pre> | ||
==Offset== | |||
We have the following list: | |||
* {{#cargo_query: | |||
|tables = areas, spawn_weights | |||
|join on= areas._pageID=spawn_weights._pageID | |||
|fields = areas.id | |||
|where = spawn_weights.tag="amuletatlas1" AND spawn_weights.weight>0 | |||
|group by = areas._pageID, spawn_weights.tag, spawn_weights.weight | |||
|more results text= | |||
|limit = 5 | |||
}} | |||
Limit to 3 results: | |||
* {{#cargo_query: | |||
|tables = areas, spawn_weights | |||
|join on= areas._pageID=spawn_weights._pageID | |||
|fields = areas.id | |||
|where = spawn_weights.tag="amuletatlas1" AND spawn_weights.weight>0 | |||
|group by = areas._pageID, spawn_weights.tag, spawn_weights.weight | |||
|more results text= | |||
|limit = 3 | |||
}} | |||
Add the rest: | |||
* {{#cargo_query: | |||
|tables = areas, spawn_weights | |||
|join on= areas._pageID=spawn_weights._pageID | |||
|fields = areas.id | |||
|where = spawn_weights.tag="amuletatlas1" AND spawn_weights.weight>0 | |||
|group by = areas._pageID, spawn_weights.tag, spawn_weights.weight | |||
|more results text= | |||
|limit = 2 | |||
|offset=3 | |||
}} | |||
Line 86: | Line 105: | ||
|offset = 0 | |offset = 0 | ||
}} | }} | ||
==Built in timeline== | ==Built in timeline== |
Revision as of 19:35, 13 March 2018
Intro
- https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data
- Lua: https://www.mediawiki.org/wiki/Extension:Cargo/Other_features
- results[2][version.version]
Lists of strings
HOLDS
Abyss • Hardcore Abyss • SSF Abyss • SSF Abyss HC
HOLDS NOT
No results
Lua equivalents
No results
tables = 'mods, spawn_weights' fields = 'mods.id, spawn_weights.weight' query = { join = 'mods._pageID=spawn_weights._pageID', where = 'mods.domain=5 AND mods.name="Fecund" AND spawn_weights.weight > 0', limit = 10, offset = 2 } results = mw.ext.cargo.query(tables, fields, query) print( results[1]['mods.id'], results[1]['spawn_weights.weight'] )
Offset
We have the following list:
- No results
Limit to 3 results:
- No results
Add the rest:
- No results
mods that can spawn on items
item_tags = axe, one_hand_weapon, onehand, weapon, default
Error: No field named "mod_group" found for the database table "mods".