steamworks/GetList

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Also menu state)
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
 
{{Func
 
{{Func
|Name=GetList
 
|Parent=steamworks
 
 
|Description=Retrieves a customized list of Steam Workshop addons.
 
|Description=Retrieves a customized list of Steam Workshop addons.
 
|Realm=Client and Menu
 
|Realm=Client and Menu
Line 9: Line 7:
 
|type=string
 
|type=string
 
|name=type
 
|name=type
|desc=The type of items to retrieve.
+
|desc=The type of items to retrieve. Possible values include:
 +
* popular (All invalid options will equal to this)
 +
* trending
 +
* latest
 +
* friends
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 24: Line 26:
 
|type=number
 
|type=number
 
|name=numRetrieve
 
|name=numRetrieve
|desc=How much addons to retrieve.
+
|desc=How much items to retrieve, up to 50 at a time.
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 34: Line 36:
 
|type=string
 
|type=string
 
|name=userID
 
|name=userID
|desc="0" to retrieve all addons, "1" to retrieve addons only published by you.
+
|desc="0" to retrieve all addons, "1" to retrieve addons only published by you, or a valid SteamID64 of a user to get workshop items of.
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=function
 
|type=function
 
|name=resultCallback
 
|name=resultCallback
|desc=The function to process retrieved data. The first and only argument is a table, containing all the info.
+
|desc=The function to process retrieved data. The first and only argument is a table, containing all the info, or nil in case of error
 
}}
 
}}
 
{{Example
 
{{Example
 
|Description=Retrieves top 10 of Steam Workshop addons.
 
|Description=Retrieves top 10 of Steam Workshop addons.
|Code=steamworks.GetList( "", nil, nil, 10, nil, 0, function( data ) PrintTable(data) end )
+
|Code=steamworks.GetList( "popular", nil, 0, 10, 7, 0, function( data ) PrintTable( data ) end )
|Output=A printed into console table:
+
|OutputFixedWidth=Fixed width
totalresults = 1748
+
|Output=totalresults = 1748
 
  numresults = 10
 
  numresults = 10
 
  results:
 
  results:

Latest revision as of 18:01, 29 November 2019

 steamworks.GetList( )

Contents

Description

Retrieves a customized list of Steam Workshop addons.

Arguments

string type

The type of items to retrieve. Possible values include:

  • popular (All invalid options will equal to this)
  • trending
  • latest
  • friends

Arguments

table tags

A table of tags to match.

Arguments

number offset

How much of results to skip from first one. Mainly used for pages.

Arguments

number numRetrieve

How much items to retrieve, up to 50 at a time.

Arguments

number days

When getting Most Popular content from Steam, this determines a time period. ( 7 = most popular addons in last 7 days, 1 = most popular addons today, etc )

Arguments

string userID

"0" to retrieve all addons, "1" to retrieve addons only published by you, or a valid SteamID64 of a user to get workshop items of.

Arguments

function resultCallback

The function to process retrieved data. The first and only argument is a table, containing all the info, or nil in case of error

Examples

Example

Retrieves top 10 of Steam Workshop addons.

steamworks.GetList( "popular", nil, 0, 10, 7, 0, function( data ) PrintTable( data ) end )

Output:

totalresults = 1748
 numresults = 10
 results:
 1 = 21197
 2 = 72122655
 3 = 68207248
 4 = 71921341
 5 = 79927494
 6 = 12692
 7 = 21174
 8 = 72145362
 9 = 16221
 10 = 22104
Personal tools
Navigation