API Lua
API Lua


steam

Version: stable

FUNCTIONS
steam.init()
steam.update()
steam.restart()
steam.final()
steam.apps_is_dlc_installed()
steam.friends_get_friend_persona_name()
steam.friends_get_persona_name()
steam.friends_get_persona_state()
steam.friends_get_friend_count()
steam.friends_get_friend_by_index()
steam.friends_get_friend_persona_state()
steam.friends_get_friend_steam_level()
steam.friends_get_friend_relationship()
steam.friends_activate_game_overlay_to_store()
steam.friends_activate_game_overlay_to_web_page()
steam.friends_set_rich_presence()
steam.friends_clear_rich_presence()
steam.friends_invite_user_to_game()
steam.set_listener()
steam.matchmaking_request_lobby_list()
steam.matchmaking_get_lobby_by_index()
steam.matchmaking_create_lobby()
steam.matchmaking_join_lobby()
steam.matchmaking_leave_lobby()
steam.matchmaking_get_lobby_owner()
steam.matchmaking_get_num_lobby_members()
steam.matchmaking_get_lobby_member_by_index()
steam.networking_send_message_to_user()
steam.networking_receive_messages_on_channel()
steam.networking_accept_session_with_user()
steam.networking_close_session_with_user()
steam.networking_close_channel_with_user()
steam.networking_get_session_connection_info()
steam.remote_storage_file_share()
steam.remote_storage_get_file_count()
steam.remote_storage_get_file_name_and_size()
steam.remote_storage_get_quota()
steam.remote_storage_file_write()
steam.remote_storage_file_read()
steam.user_get_steam_id()
steam.user_get_player_steam_level()
steam.user_get_game_badge_level()
steam.user_logged_on()
steam.user_is_behind_nat()
steam.user_is_phone_verified()
steam.user_is_phone_identifying()
steam.user_is_phone_requiring_verification()
steam.user_is_two_factor_enabled()
steam.user_get_auth_session_ticket()
steam.user_stats_get_stat_int()
steam.user_stats_set_stat_int()
steam.user_stats_get_stat_float()
steam.user_stats_set_stat_float()
steam.user_stats_request_global_stats()
steam.user_stats_store_stats()
steam.user_stats_reset_all_stats()
steam.user_stats_set_achievement()
steam.user_stats_get_achievement()
steam.user_stats_clear_achievement()
steam.user_stats_get_num_achievements()
steam.user_stats_get_achievement_name()
steam.user_stats_get_achievement_display_attribute()
steam.user_stats_get_achievement_achieved_percent()
steam.user_stats_find_leaderboard()
steam.user_stats_find_or_create_leaderboard()
steam.user_stats_get_leaderboard_name()
steam.user_stats_get_leaderboard_entry_count()
steam.user_stats_get_leaderboard_sort_method()
steam.user_stats_get_leaderboard_display_type()
steam.user_stats_download_leaderboard_entries()
steam.user_stats_get_downloaded_leaderboard_entry()
steam.user_stats_upload_leaderboard_score()
steam.user_stats_attach_leadboard_ugc()
steam.utils_get_app_id()
steam.utils_get_seconds_since_app_active()
steam.utils_is_steam_running_on_steam_deck()
steam.utils_get_image_size()
steam.utils_get_image_rgba()
steam.utils_get_server_real_time()
steam.utils_show_floating_gamepad_text_input()
steam.utils_show_gamepad_text_input()
CONSTANTS
EFloatingGamepadTextInputModeModeSingleLine
EFloatingGamepadTextInputModeModeMultipleLines
EFloatingGamepadTextInputModeModeEmail
EFloatingGamepadTextInputModeModeNumeric
EGamepadTextInputModeNormal
EGamepadTextInputModePassword
EGamepadTextInputLineModeSingleLine
EGamepadTextInputLineModeMultipleLines
ELeaderboardDataRequestGlobal
ELeaderboardDataRequestGlobalAroundUser
ELeaderboardDataRequestFriends
ELeaderboardSortMethodNone
ELeaderboardSortMethodAscending
ELeaderboardSortMethodDescending
ELeaderboardUploadScoreMethodNone
ELeaderboardUploadScoreMethodKeepBest
ELeaderboardUploadScoreMethodForceUpdate
ELeaderboardDisplayTypeNone
ELeaderboardDisplayTypeNumeric
ELeaderboardDisplayTypeTimeSeconds
ELeaderboardDisplayTypeTimeMilliSeconds
EOverlayToStoreFlag_None
EOverlayToStoreFlag_AddToCart
EOverlayToStoreFlag_AddToCartAndShow
EActivateGameOverlayToWebPageMode_Default
EActivateGameOverlayToWebPageMode_Modal
EPersonaStateOffline
EPersonaStateOnline
EPersonaStateBusy
EPersonaStateAway
EPersonaStateSnooze
EPersonaStateLookingToTrade
EPersonaStateLookingToPlay
EPersonaStateInvisible
EFriendFlagNone
EFriendFlagBlocked
EFriendFlagFriendshipRequested
EFriendFlagImmediate
EFriendFlagClanMember
EFriendFlagOnGameServer
EFriendFlagRequestingFriendship
EFriendFlagRequestingInfo
EFriendFlagIgnored
EFriendFlagIgnoredFriend
EFriendFlagChatMember
EFriendFlagAll
SteamNetworkingSend_Unreliable
SteamNetworkingSend_NoNagle
SteamNetworkingSend_UnreliableNoNagle
SteamNetworkingSend_NoDelay
SteamNetworkingSend_UnreliableNoDelay
SteamNetworkingSend_Reliable
SteamNetworkingSend_ReliableNoNagle
SteamNetworkingSend_UseCurrentThread
SteamNetworkingSend_AutoRestartBrokenSession
ESteamNetConnectionEnd_Invalid
ESteamNetConnectionEnd_App_Generic
ESteamNetConnectionEnd_AppException_Generic
ESteamNetConnectionEnd_Local_OfflineMode
ESteamNetConnectionEnd_Local_ManyRelayConnectivity
ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay
ESteamNetConnectionEnd_Local_NetworkConfig
ESteamNetConnectionEnd_Local_Rights
ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses
ESteamNetConnectionEnd_Remote_Timeout
ESteamNetConnectionEnd_Remote_BadCrypt
ESteamNetConnectionEnd_Remote_BadCert
ESteamNetConnectionEnd_Remote_BadProtocolVersion
ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses
ESteamNetConnectionEnd_Misc_Generic
ESteamNetConnectionEnd_Misc_InternalError
ESteamNetConnectionEnd_Misc_Timeout
ESteamNetConnectionEnd_Misc_SteamConnectivity
ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient
ESteamNetConnectionEnd_Misc_P2P_Rendezvous
ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall
ESteamNetConnectionEnd_Misc_PeerSentNoConnection
ESteamNetworkingConnectionState_None
ESteamNetworkingConnectionState_Connecting
ESteamNetworkingConnectionState_FindingRoute
ESteamNetworkingConnectionState_Connected
ESteamNetworkingConnectionState_ClosedByPeer
ESteamNetworkingConnectionState_ProblemDetectedLocally
ELobbyTypePrivate
ELobbyTypeFriendsOnly
ELobbyTypePublic
ELobbyTypeInvisible
ELobbyTypePrivateUnique

Functions

steam.init()

steam.init()

Initialize Steamworks.

PARAMETERS

None

RETURNS

Boolean True if successful
String Error message if unsuccessful.

steam.update()

steam.update()

Update Steamworks. Call this from a script component.

PARAMETERS

None


steam.restart()

steam.restart(appid)

Restart Steamworks.

PARAMETERS

appid number

steam.final()

steam.final()

Finalize Steamworks.

PARAMETERS

None


steam.apps_is_dlc_installed()

steam.apps_is_dlc_installed(app_id)

Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed.

PARAMETERS

app_id number

RETURNS

bool

steam.friends_get_friend_persona_name()

steam.friends_get_friend_persona_name(CSteamID)

Returns the name of another user. Same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously.

PARAMETERS

CSteamID friendId

RETURNS

name Name of user

steam.friends_get_persona_name()

steam.friends_get_persona_name()

Returns the local players name - guaranteed to not be NULL. This is the same name as on the users community profile page. This is stored in UTF-8 format.

PARAMETERS

None

RETURNS

name Name of user

steam.friends_get_persona_state()

steam.friends_get_persona_state()

Gets the status of the current user. Returned as EPersonaState.

PARAMETERS

None

RETURNS

state Status of user.

steam.friends_get_friend_count()

steam.friends_get_friend_count(iFriendFlags)

Friend iteration. Takes a set of EFriendFlags, and returns the number of users the client knows about who meet that criteria. Then GetFriendByIndex() can then be used to return the id's of each of those users.

PARAMETERS

iFriendFlags number
Set of friend flags to match friends against.

RETURNS

count Number of users matching search.

steam.friends_get_friend_by_index()

steam.friends_get_friend_by_index(iFriend,iFriendsFlags)

Returns the steamID of a user. The returned CSteamID can then be used by all the functions below to access details about the user.

PARAMETERS

iFriend number
Is a index of range [0, GetFriendCount())
iFriendsFlags number
Must be the same value as used in GetFriendCount()

RETURNS

steamID Steam id of the user

steam.friends_get_friend_persona_state()

steam.friends_get_friend_persona_state(steamIDFriend)

Returns the current status of the specified user. This will only be known by the local user if steamIDFriend is in their friends list; on the same game server; in a chat room or lobby; or in a small group with the local user.

PARAMETERS

steamIDFriend number
Id of friend

RETURNS

state State of friend

steam.friends_get_friend_steam_level()

steam.friends_get_friend_steam_level(steamIDFriend)

Get friends steam level.

PARAMETERS

steamIDFriend number
Id of friend

RETURNS

level Steam level of friend

steam.friends_get_friend_relationship()

steam.friends_get_friend_relationship(steamIDFriend)

Returns a relationship to a user.

PARAMETERS

steamIDFriend number
Id of friend

RETURNS

relationship Relationship to the user.

steam.friends_activate_game_overlay_to_store()

steam.friends_activate_game_overlay_to_store(app_id,flag)

Activates game overlay to store page for app.

PARAMETERS

app_id number
flag number
EOverlayToStoreFlag

steam.friends_activate_game_overlay_to_web_page()

steam.friends_activate_game_overlay_to_web_page(url,mode)

Activates game overlay web browser directly to the specified URL. Full address with protocol type is required, e.g. http://www.steamgames.com/

PARAMETERS

url string
mode number
EActivateGameOverlayToWebPageMode

steam.friends_set_rich_presence()

steam.friends_set_rich_presence(key,value)

Sets a Rich Presence key/value for the current user.

PARAMETERS

key string
value string

RETURNS

bool True if the rich presence was set successfully, otherwise False.

steam.friends_clear_rich_presence()

steam.friends_clear_rich_presence()

Clears all of the current user's Rich Presence key/values.

PARAMETERS

None


steam.friends_invite_user_to_game()

steam.friends_invite_user_to_game(steamIDFriend,connect)

Invites a friend or clan member to the current game using a special invite string. If the target accepts the invite, a GameRichPresenceJoinRequested_t callback is posted containing the connect string.

PARAMETERS

steamIDFriend number
Id of friend
connect string
String

RETURNS

boolean

steam.set_listener()

steam.set_listener(listener)

Set a listener.

PARAMETERS

listener function
Listener function to call

steam.matchmaking_request_lobby_list()

steam.matchmaking_request_lobby_list()

Get a filtered list of relevant lobbies. Will return results as a LobbyMatchList_t event

PARAMETERS

None

RETURNS

string Id

steam.matchmaking_get_lobby_by_index()

steam.matchmaking_get_lobby_by_index(index)

Gets the Steam ID of the lobby at the specified index. This should only be called after a LobbyMatchList_t call result is received LobbyMatchList_t.m_nLobbiesMatching

PARAMETERS

index number
The index of the lobby to get the Steam ID of, from 0 to

RETURNS

string Of lobby

steam.matchmaking_create_lobby()

steam.matchmaking_create_lobby(lobby_type,max_members)

Create a new matchmaking lobby. Will generate a LobbyCreated_t, LobbyEnter_t and LobbyDataUpdate_t event

PARAMETERS

lobby_type number
The type and visibility of this lobby.
max_members number
The maximum number of players that can join this lobby.

RETURNS

string Id

steam.matchmaking_join_lobby()

steam.matchmaking_join_lobby(lobby_id)

Joins an existing lobby. Will generate a LobbyEnter_t event

PARAMETERS

lobby_id string
The Steam ID of the lobby to join.

RETURNS

string Id

steam.matchmaking_leave_lobby()

steam.matchmaking_leave_lobby(lobby_id)

Leave a lobby that the user is currently in Leave a lobby that the user is currently in; this will take effect immediately on the client side, other users in the lobby will be notified by a LobbyChatUpdate_t callback.

PARAMETERS

lobby_id string
The lobby to leave

steam.matchmaking_get_lobby_owner()

steam.matchmaking_get_lobby_owner(lobby_id)

Returns the current lobby owner. There always one lobby owner - if the current owner leaves, another user in the lobby will become the owner automatically. It is possible (but rare) to join a lobby just as the owner is leaving, thus entering a lobby with self as the owner. You must be a member of the lobby to access this.

PARAMETERS

lobby_id string
The Steam ID of the lobby to get the owner of.

RETURNS

string Of owner

steam.matchmaking_get_num_lobby_members()

steam.matchmaking_get_num_lobby_members(lobby_id)

Gets the number of users in a lobby. This is used for iteration, after calling this then GetLobbyMemberByIndex can be used to get the Steam ID of each person in the lobby. Persona information for other lobby members (name, avatar, etc.) is automatically received and accessible via the ISteamFriends interface. The current user must be in the lobby to retrieve the Steam IDs of other users in that lobby.

PARAMETERS

lobby_id string
The Steam ID of the lobby to get the owner of.

RETURNS

number Of users in the lobby

steam.matchmaking_get_lobby_member_by_index()

steam.matchmaking_get_lobby_member_by_index(lobby_id,index)

Gets the Steam ID of the lobby member at the given index. You must call matchmaking_get_num_lobby_members before calling this. The current user must be in the lobby to retrieve the Steam IDs of other users in that lobby.

PARAMETERS

lobby_id string
index number

RETURNS

string Of member

steam.networking_send_message_to_user()

steam.networking_send_message_to_user(identity_remote,data,send_flags,remote_channel)

Send message

PARAMETERS

identity_remote string
data string
send_flags number
A bitmask of k_nSteamNetworkingSend_xxx options
remote_channel number
A routing number you can use to help route message to different systems

steam.networking_receive_messages_on_channel()

steam.networking_receive_messages_on_channel(localChannel)

Receive message

PARAMETERS

localChannel number

RETURNS

table

steam.networking_accept_session_with_user()

steam.networking_accept_session_with_user(identity_remote)

Accept session Call this in response to a SteamNetworkingMessagesSessionRequest_t callback. pending or otherwise. If there is an existing active session, this function will return true, even if it is not pending.

PARAMETERS

identity_remote string

RETURNS

boolean Returns false if there is no session with the user

steam.networking_close_session_with_user()

steam.networking_close_session_with_user(identity_remote)

Close sesssion Call this when you're done talking to a user to immediately free up resources under-the-hood

PARAMETERS

identity_remote string

RETURNS

boolean

steam.networking_close_channel_with_user()

steam.networking_close_channel_with_user(identity_remote,local_channel)

Close channel Call this when you're done talking to a user on a specific channel.

PARAMETERS

identity_remote string
local_channel number

RETURNS

boolean

steam.networking_get_session_connection_info()

steam.networking_get_session_connection_info(identity_remote)

Get connection info Returns information about the latest state of a connection, if any, with the given peer.

PARAMETERS

identity_remote string

RETURNS

table Connection info (state, info, status)

steam.remote_storage_file_share()

steam.remote_storage_file_share(filename)

Share a file

PARAMETERS

filename string
Name of file to share

RETURNS

string Id

steam.remote_storage_get_file_count()

steam.remote_storage_get_file_count()

Get number of uploaded files

PARAMETERS

None

RETURNS

number Count

steam.remote_storage_get_file_name_and_size()

steam.remote_storage_get_file_name_and_size()

Get file information

PARAMETERS

None

RETURNS

number Count

steam.remote_storage_get_quota()

steam.remote_storage_get_quota()

Get storage quota

PARAMETERS

None

RETURNS

number Bytes
number Bytes

steam.remote_storage_file_write()

steam.remote_storage_file_write(filename,data)

Creates a new file, writes the bytes to the file, and then closes the file. If the target file already exists, it is overwritten.

PARAMETERS

filename string
The name of the file to write to.
data string

RETURNS

boolean

steam.remote_storage_file_read()

steam.remote_storage_file_read(filename)

Opens a binary file, reads the contents of the file into a byte array, And then closes the file.

PARAMETERS

filename string
Name of the file to read from

RETURNS

string

steam.user_get_steam_id()

steam.user_get_steam_id()

Returns the CSteamID of the account currently logged into the Steam client. A CSteamID is a unique identifier for an account, and used to differentiate users in all parts of the Steamworks API.

PARAMETERS

None

RETURNS

CSteamID

steam.user_get_player_steam_level()

steam.user_get_player_steam_level()

Gets the Steam Level of the user, as shown on their profile.

PARAMETERS

None

RETURNS

number

steam.user_get_game_badge_level()

steam.user_get_game_badge_level()

Trading Card badges data access. If you only have one set of cards, the series will be 1. The user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1).

PARAMETERS

None

RETURNS

number
boolean

steam.user_logged_on()

steam.user_logged_on()

Returns true if the Steam client current has a live connection to the Steam Servers.

PARAMETERS

None

RETURNS

boolean

steam.user_is_behind_nat()

steam.user_is_behind_nat()

Returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam .

PARAMETERS

None

RETURNS

boolean

steam.user_is_phone_verified()

steam.user_is_phone_verified()

Gets whether the users phone number is verified.

PARAMETERS

None

RETURNS

boolean

steam.user_is_phone_identifying()

steam.user_is_phone_identifying()

Gets whether the users phone number is identifying.

PARAMETERS

None

RETURNS

boolean

steam.user_is_phone_requiring_verification()

steam.user_is_phone_requiring_verification()

Gets whether the users phone number is awaiting (re)verification.

PARAMETERS

None

RETURNS

boolean

steam.user_is_two_factor_enabled()

steam.user_is_two_factor_enabled()

Gets whether the user has two factor enabled on their account.

PARAMETERS

None

RETURNS

boolean

steam.user_get_auth_session_ticket()

steam.user_get_auth_session_ticket()

Get an authentication ticket. Retrieve an authentication ticket to be sent to the entity who wishes to authenticate you.

PARAMETERS

None

RETURNS

string Or null
string Or null

steam.user_stats_get_stat_int()

steam.user_stats_get_stat_int(id)

Get user stat as an integer. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetStat

PARAMETERS

id string
Id of the stat to get

RETURNS

ok
stat The stat or nil

steam.user_stats_set_stat_int()

steam.user_stats_set_stat_int(id,stat)

Set user stat. Https://partner.steamgames.com/doc/api/ISteamUserStats#SetStat

PARAMETERS

id string
Id of the stat to set
stat number
Number to set

RETURNS

boolean

steam.user_stats_get_stat_float()

steam.user_stats_get_stat_float(id)

Get user stat as a floating point number. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetStat

PARAMETERS

id string
Id of the stat to get

RETURNS

Boolean
Number The stat

steam.user_stats_set_stat_float()

steam.user_stats_set_stat_float(id,stat)

Set user stat. Https://partner.steamgames.com/doc/api/ISteamUserStats#SetStat

PARAMETERS

id string
Id of the stat to set
stat number
Number to set

RETURNS

Boolean

steam.user_stats_request_global_stats()

steam.user_stats_request_global_stats(history_days)

Requests global stats data, which is available for stats marked as "aggregated". This call is asynchronous, with the results returned in GlobalStatsReceived_t. nHistoryDays specifies how many days of day-by-day history to retrieve in addition to the overall totals. The limit is 60. https://partner.steamgames.com/doc/api/ISteamUserStats#RequestGlobalStats

PARAMETERS

history_days number

RETURNS

Boolean

steam.user_stats_store_stats()

steam.user_stats_store_stats()

Store the current data on the server. Will get a callback when set and one callback for every new achievement If the callback has a result of k_EResultInvalidParam, one or more stats uploaded has been rejected, either because they broke constraints or were out of date. In this case the server sends back updated values. The stats should be re-iterated to keep in sync. https://partner.steamgames.com/doc/api/ISteamUserStats#StoreStats

PARAMETERS

None

RETURNS

Boolean

steam.user_stats_reset_all_stats()

steam.user_stats_reset_all_stats(achievements)

Reset stats. Https://partner.steamgames.com/doc/api/ISteamUserStats#ResetAllStats

PARAMETERS

achievements boolean
True if achievements should be reset as well.

RETURNS

Boolean

steam.user_stats_set_achievement()

steam.user_stats_set_achievement(name)

Set achievement. Https://partner.steamgames.com/doc/api/ISteamUserStats#SetAchievement

PARAMETERS

name string

RETURNS

Boolean

steam.user_stats_get_achievement()

steam.user_stats_get_achievement(name)

Get achievement. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetAchievement

PARAMETERS

name string

RETURNS

Boolean
Boolean

steam.user_stats_clear_achievement()

steam.user_stats_clear_achievement(name)

Clear achievement. Https://partner.steamgames.com/doc/api/ISteamUserStats#ClearAchievement

PARAMETERS

name string

RETURNS

Boolean

steam.user_stats_get_num_achievements()

steam.user_stats_get_num_achievements()

Used for iterating achievements. In general games should not need these functions because they should have a list of existing achievements compiled into them. https://partner.steamgames.com/doc/api/ISteamUserStats#GetNumAchievements

PARAMETERS

None

RETURNS

Number Number of achievements.

steam.user_stats_get_achievement_name()

steam.user_stats_get_achievement_name(index)

Get achievement name iAchievement in [0,GetNumAchievements) Https://partner.steamgames.com/doc/api/ISteamUserStats#GetAchievementName

PARAMETERS

index number

RETURNS

String

steam.user_stats_get_achievement_display_attribute()

steam.user_stats_get_achievement_display_attribute(name,key)

Get general attributes for an achievement. Accepts the following keys * "name" and "desc" for retrieving the localized achievement name and description (returned in UTF8) * "hidden" for retrieving if an achievement is hidden (returns "0" when not hidden, "1" when hidden) https://partner.steamgames.com/doc/api/ISteamUserStats#GetAchievementDisplayAttribute

PARAMETERS

name string
key string
Either "name", "desc" or "hidden"

RETURNS

String

steam.user_stats_get_achievement_achieved_percent()

steam.user_stats_get_achievement_achieved_percent()

Returns the percentage of users who have achieved the specified achievement. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetAchievementAchievedPercent

PARAMETERS

None

RETURNS

Boolean
Number

steam.user_stats_find_leaderboard()

steam.user_stats_find_leaderboard(name)

Find a leaderboard. Will return leaderboard asynchronously. https://partner.steamgames.com/doc/api/ISteamUserStats#FindLeaderboard

PARAMETERS

name string

steam.user_stats_find_or_create_leaderboard()

steam.user_stats_find_or_create_leaderboard(leaderboard_name,eLeaderboardSortMethod,eLeaderboardDisplayType)

Gets a leaderboard by name, it will create it if it's not yet created. This call is asynchronous, with the result returned in a listener callback with event set to LeaderboardFindResult_t. https://partner.steamgames.com/doc/api/ISteamUserStats#FindOrCreateLeaderboard

PARAMETERS

leaderboard_name string
The name of the leaderboard to find or create.
eLeaderboardSortMethod ELeaderboardSortMethod
The sort order of the new leaderboard if it's created.
eLeaderboardDisplayType ELeaderboardDisplayType
The display type (used by the Steam Community web site) of the new leaderboard if it's created.

steam.user_stats_get_leaderboard_name()

steam.user_stats_get_leaderboard_name(leaderboard)

Get the name of a leaderboard. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetLeaderboardName

PARAMETERS

leaderboard string

RETURNS

string

steam.user_stats_get_leaderboard_entry_count()

steam.user_stats_get_leaderboard_entry_count(leaderboard)

Get the total number of entries in a leaderboard, as of the last request. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetLeaderboardEntryCount

PARAMETERS

leaderboard string

RETURNS

number

steam.user_stats_get_leaderboard_sort_method()

steam.user_stats_get_leaderboard_sort_method(leaderboard)

Returns the sort method of the leaderboard Https://partner.steamgames.com/doc/api/ISteamUserStats#GetLeaderboardSortMethod

PARAMETERS

leaderboard string

RETURNS

number Order

steam.user_stats_get_leaderboard_display_type()

steam.user_stats_get_leaderboard_display_type(leaderboard)

Returns the display type of a leaderboard handle. Https://partner.steamgames.com/doc/api/ISteamUserStats#GetLeaderboardDisplayType

PARAMETERS

leaderboard string

RETURNS

number Type

steam.user_stats_download_leaderboard_entries()

steam.user_stats_download_leaderboard_entries(leaderboard,request,start,end)

Asks the Steam back-end for a set of rows in the leaderboard. This call is asynchronous, with the result returned in a listener callback with event set to LeaderboardScoresDownloaded_t. LeaderboardScoresDownloaded_t will contain a handle to pull the results from GetDownloadedLeaderboardEntries(). You can ask for more entries than exist, and it will return as many as do exist. * k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries] * k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after * k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user https://partner.steamgames.com/doc/api/ISteamUserStats#DownloadLeaderboardEntries

PARAMETERS

leaderboard string
request ELeaderboardDataRequest
start number
end number

steam.user_stats_get_downloaded_leaderboard_entry()

steam.user_stats_get_downloaded_leaderboard_entry(hSteamLeaderboardEntries,index)

Returns data about a single leaderboard entry Https://partner.steamgames.com/doc/api/ISteamUserStats#GetDownloadedLeaderboardEntry

PARAMETERS

hSteamLeaderboardEntries string
Leaderboard entries handle
index number
Which entry to get

RETURNS

Boolean
Table The requested leaderboard entry.

steam.user_stats_upload_leaderboard_score()

steam.user_stats_upload_leaderboard_score(leaderboard,eLeaderboardUploadScoreMethod,nScore)

Uploads a user score to a specified leaderboard. This call is asynchronous, with the result returned in a listener callback with event set to LeaderboardScoreUploaded_t. https://partner.steamgames.com/doc/api/ISteamUserStats#UploadLeaderboardScore

PARAMETERS

leaderboard string
eLeaderboardUploadScoreMethod ELeaderboardUploadScoreMethod
nScore number

steam.user_stats_attach_leadboard_ugc()

steam.user_stats_attach_leadboard_ugc(leaderboard,ugc_handle)

Attaches a piece of user generated content the current user's entry on a Leaderboard. https://partner.steamgames.com/doc/api/ISteamUserStats#AttachLeaderboardUGC

PARAMETERS

leaderboard string
ugc_handle string

RETURNS

string API call id

steam.utils_get_app_id()

steam.utils_get_app_id()

Returns the appID of the current process.

PARAMETERS

None

RETURNS

Number

steam.utils_get_seconds_since_app_active()

steam.utils_get_seconds_since_app_active()

Return the number of seconds since the user.

PARAMETERS

None

RETURNS

Number

steam.utils_is_steam_running_on_steam_deck()

steam.utils_is_steam_running_on_steam_deck()

Returns true if currently running on the Steam Deck device.

PARAMETERS

None

RETURNS

Boolean

steam.utils_get_image_size()

steam.utils_get_image_size(image)

Get size of image

PARAMETERS

image number
Image handle

RETURNS

Boolean True if size of image was read successfully
Number Image width or nil
Number Image height or nil

steam.utils_get_image_rgba()

steam.utils_get_image_rgba(image,size)

Get image in RGBA format.

PARAMETERS

image number
Image handle
size number
Size of image

RETURNS

Boolean True if size of image was read successfully
String

steam.utils_get_server_real_time()

steam.utils_get_server_real_time()

Returns the Steam server time in Unix epoch format. (Number of seconds since Jan 1, 1970 UTC)

PARAMETERS

None

RETURNS

number Time

steam.utils_show_floating_gamepad_text_input()

steam.utils_show_floating_gamepad_text_input(mode,x,y,width,height)

Opens a floating keyboard over the game content and sends OS keyboard keys directly to the game.

PARAMETERS

mode number
EFloatingGamepadTextInputMode
x number
Text field x position
y number
Text field y position
width number
Text field width
height number
Text field height

RETURNS

bool True if the floating keyboard was shown, otherwise, false.

steam.utils_show_gamepad_text_input()

steam.utils_show_gamepad_text_input(input_mode,line_input_mode,description,existing_text)

Activates the Big Picture text input dialog which only supports gamepad input.

PARAMETERS

input_mode number
EGamepadTextInputMode
line_input_mode number
EGamepadTextInputLineMode
description string
Sets the description that should inform the user what the input dialog is for
existing_text string
Sets the preexisting text which the user can edit.

RETURNS

bool True if the big picture overlay is running; otherwise, false

Constants

EFloatingGamepadTextInputModeModeSingleLine

Enter dismisses the keyboard


EFloatingGamepadTextInputModeModeMultipleLines

User needs to explicitly dismiss the keyboard


EFloatingGamepadTextInputModeModeEmail

Keyboard is displayed in a special mode that makes it easier to enter emails


EFloatingGamepadTextInputModeModeNumeric

Numeric keypad is shown


EGamepadTextInputModeNormal

Normal text input


EGamepadTextInputModePassword

Password text input


EGamepadTextInputLineModeSingleLine

Single line text


EGamepadTextInputLineModeMultipleLines

Multi line text


ELeaderboardDataRequestGlobal

Requests rows in the leaderboard from the full table


ELeaderboardDataRequestGlobalAroundUser

Requests rows in the leaderboard from rows around the user


ELeaderboardDataRequestFriends

Requests all the rows for friends of the current user


ELeaderboardSortMethodNone


ELeaderboardSortMethodAscending

Top-score is lowest number


ELeaderboardSortMethodDescending

Top-score is highest number


ELeaderboardUploadScoreMethodNone


ELeaderboardUploadScoreMethodKeepBest

Leaderboard will keep user's best score


ELeaderboardUploadScoreMethodForceUpdate

Leaderboard will always replace score with specified


ELeaderboardDisplayTypeNone


ELeaderboardDisplayTypeNumeric

Simple numerical score


ELeaderboardDisplayTypeTimeSeconds

The score represents a time, in seconds


ELeaderboardDisplayTypeTimeMilliSeconds

The score represents a time, in milliseconds


EOverlayToStoreFlag_None

Passed as parameter to the store


EOverlayToStoreFlag_AddToCart

Passed as parameter to the store


EOverlayToStoreFlag_AddToCartAndShow

Passed as parameter to the store


EActivateGameOverlayToWebPageMode_Default

Passed as parameter to ActivateGameOverlayToWebPage


EActivateGameOverlayToWebPageMode_Modal

Passed as parameter to ActivateGameOverlayToWebPage


EPersonaStateOffline

Friend is not currently logged on


EPersonaStateOnline

Friend is logged on


EPersonaStateBusy

User is on, but busy


EPersonaStateAway

Auto-away feature


EPersonaStateSnooze

Auto-away for a long time


EPersonaStateLookingToTrade

Online, trading


EPersonaStateLookingToPlay

Online, wanting to play


EPersonaStateInvisible

Online, but appears offline to friends. This status is never published to clients.


EFriendFlagNone

EFriendFlagNone


EFriendFlagBlocked

EFriendFlagBlocked


EFriendFlagFriendshipRequested

EFriendFlagFriendshipRequested


EFriendFlagImmediate

EFriendFlagImmediate


EFriendFlagClanMember

EFriendFlagClanMember


EFriendFlagOnGameServer

EFriendFlagOnGameServer


EFriendFlagRequestingFriendship

EFriendFlagRequestingFriendship


EFriendFlagRequestingInfo

EFriendFlagRequestingInfo


EFriendFlagIgnored

EFriendFlagIgnored


EFriendFlagIgnoredFriend

EFriendFlagIgnoredFriend


EFriendFlagChatMember

EFriendFlagChatMember


EFriendFlagAll

EFriendFlagAll


SteamNetworkingSend_Unreliable

SteamNetworkingSend_Unreliable


SteamNetworkingSend_NoNagle

SteamNetworkingSend_NoNagle


SteamNetworkingSend_UnreliableNoNagle

SteamNetworkingSend_UnreliableNoNagle


SteamNetworkingSend_NoDelay

SteamNetworkingSend_NoDelay


SteamNetworkingSend_UnreliableNoDelay

SteamNetworkingSend_UnreliableNoDelay


SteamNetworkingSend_Reliable

SteamNetworkingSend_Reliable


SteamNetworkingSend_ReliableNoNagle

SteamNetworkingSend_ReliableNoNagle


SteamNetworkingSend_UseCurrentThread

SteamNetworkingSend_UseCurrentThread


SteamNetworkingSend_AutoRestartBrokenSession

SteamNetworkingSend_AutoRestartBrokenSession


ESteamNetConnectionEnd_Invalid

ESteamNetConnectionEnd_Invalid


ESteamNetConnectionEnd_App_Generic

ESteamNetConnectionEnd_App_Generic


ESteamNetConnectionEnd_AppException_Generic

ESteamNetConnectionEnd_AppException_Generic


ESteamNetConnectionEnd_Local_OfflineMode

ESteamNetConnectionEnd_Local_OfflineMode


ESteamNetConnectionEnd_Local_ManyRelayConnectivity

ESteamNetConnectionEnd_Local_ManyRelayConnectivity


ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay

ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay


ESteamNetConnectionEnd_Local_NetworkConfig

ESteamNetConnectionEnd_Local_NetworkConfig


ESteamNetConnectionEnd_Local_Rights

ESteamNetConnectionEnd_Local_Rights


ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses

ESteamNetConnectionEnd_Local_P2P_ICE_NoPublicAddresses


ESteamNetConnectionEnd_Remote_Timeout

ESteamNetConnectionEnd_Remote_Timeout


ESteamNetConnectionEnd_Remote_BadCrypt

ESteamNetConnectionEnd_Remote_BadCrypt


ESteamNetConnectionEnd_Remote_BadCert

ESteamNetConnectionEnd_Remote_BadCert


ESteamNetConnectionEnd_Remote_BadProtocolVersion

ESteamNetConnectionEnd_Remote_BadProtocolVersion


ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses

ESteamNetConnectionEnd_Remote_P2P_ICE_NoPublicAddresses


ESteamNetConnectionEnd_Misc_Generic

ESteamNetConnectionEnd_Misc_Generic


ESteamNetConnectionEnd_Misc_InternalError

ESteamNetConnectionEnd_Misc_InternalError


ESteamNetConnectionEnd_Misc_Timeout

ESteamNetConnectionEnd_Misc_Timeout


ESteamNetConnectionEnd_Misc_SteamConnectivity

ESteamNetConnectionEnd_Misc_SteamConnectivity


ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient

ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient


ESteamNetConnectionEnd_Misc_P2P_Rendezvous

ESteamNetConnectionEnd_Misc_P2P_Rendezvous


ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall

ESteamNetConnectionEnd_Misc_P2P_NAT_Firewall


ESteamNetConnectionEnd_Misc_PeerSentNoConnection

ESteamNetConnectionEnd_Misc_PeerSentNoConnection


ESteamNetworkingConnectionState_None

ESteamNetworkingConnectionState_None


ESteamNetworkingConnectionState_Connecting

ESteamNetworkingConnectionState_Connecting


ESteamNetworkingConnectionState_FindingRoute

ESteamNetworkingConnectionState_FindingRoute


ESteamNetworkingConnectionState_Connected

ESteamNetworkingConnectionState_Connected


ESteamNetworkingConnectionState_ClosedByPeer

ESteamNetworkingConnectionState_ClosedByPeer


ESteamNetworkingConnectionState_ProblemDetectedLocally

ESteamNetworkingConnectionState_ProblemDetectedLocally


ELobbyTypePrivate

ELobbyTypePrivate only way to join the lobby is to invite to someone else


ELobbyTypeFriendsOnly

ELobbyTypeFriendsOnly shows for friends or invitees, but not in lobby list


ELobbyTypePublic

ELobbyTypePublic visible for friends and in lobby list


ELobbyTypeInvisible

ELobbyTypeInvisible returned by search, but not visible to other friends


ELobbyTypePrivateUnique

ELobbyTypePrivateUnique private, unique and does not delete when empty