
For every hour played in Redout you get a random Steam inventory drop. This can either be a new color scheme or livery to be applied to your ships in game. The inventory on Steam's side is unsorted making it hard to catalouge what you have, what you want to trade, and what you want to trade for. My app pulls this data and sorts it for you.
Code Example
jsonMap = json_decode(jsonRaw)
if (jsonMap[? "success"] = 1) {
resetInventory()
descriptionsList = jsonMap[? "descriptions"] //Descriptions/names for each possible inventory item
assetsList = jsonMap[? "assets"] //Users inventory items
nameMap = ds_map_create()
for (var i = 0; i < ds_list_size(descriptionsList); i++) {
description = descriptionsList[| i] //List Accessor
classId = description[? "classid"] //Hash Map Accessor
nameMap[? classId] = description[? "name"]
}
for (var i = 0; i < ds_list_size(assetsList); i++) {
asset = assetsList[| i]
classId = asset[? "classid"]
name = nameMap[? classId]
if (string_pos("-", name) != 0 ) { //Livery: "WILD - CONQUEROR CLASS III"
dashPosition = string_pos("-", name)
classPosition = string_pos("CLASS", name)
nameLength = string_length(name)
liveryId = liveryMap[? stringSub(name, 1, dashPosition-2)]
shipId = shipMap[? stringSub(name, dashPosition+2, classPosition-2)]
classId = classMap[? stringSub(name, classPosition+6, nameLength)]
writeLivery(liveryId, shipId, classId)
}
else { //Color: "Golden Lime"
colorId = colorMap[? name]
writeColor(colorId)
}
}
}
JSON Sample
2x Tangerine Sunset and 1x Wild Conqueror Class I
{
"assets": [
{
"appid": 517710,
"contextid": "2",
"assetid": "618523351903078304",
"classid": "2006427026",
"instanceid": "0",
"amount": "1"
},
{
"appid": 517710,
"contextid": "2",
"assetid": "618523351903078304",
"classid": "2006427026",
"instanceid": "0",
"amount": "1"
},
{
"appid": 517710,
"contextid": "2",
"assetid": "3578683545912617874",
"classid": "2097502851",
"instanceid": "0",
"amount": "1"
}
],
"descriptions": [
{
"appid": 517710,
"classid": "2006427026",
"instanceid": "0",
"currency": 0,
"background_color": "1490C7",
"icon_url": "0WUNihj0oGReooIWU_iYWtrQ1ieKy6g8eWff3L-TwAJxFjWYXEfQl0DuVzrH-2jFrSeEgbT7m961FBuuC-wLtgazO60u",
"icon_url_large": "0WUNihj0oGReooIWU_iYWtrQ1ieKy6g8eWff3L-TwAJxFjWYXEfQl0DuVzrH-2jFrSeEgbT76t22EuKAY62P",
"descriptions": [
{
"type": "html",
"value": "Tangerine Sunset ship color scheme.
Common."
}
],
"tradable": 1,
"name": "Tangerine Sunset",
"name_color": "FFFFFF",
"type": "",
"market_name": "Tangerine Sunset",
"market_hash_name": "Tangerine Sunset",
"commodity": 1,
"market_tradable_restriction": 7,
"market_marketable_restriction": 7,
"marketable": 1
},
{
"appid": 517710,
"classid": "2097502851",
"instanceid": "0",
"currency": 0,
"background_color": "1490C7",
"icon_url": "0WUNihj0oGReooIWU_iYWtrQ1ieKy6g8eWff3L-TwAJxFjWYXEfQl0DuVzrH-2jHrX200fCU957gKgSvRPAJ__okeLt8crEd",
"icon_url_large": "0WUNihj0oGReooIWU_iYWtrQ1ieKy6g8eWff3L-TwAJxFjWYXEfQl0DuVzrH-2jHrX200fCU957gWwesQm6oVzm6",
"descriptions": [
{
"type": "html",
"value": "WILD livery option for the CONQUEROR Ehawee ship.
Common."
}
],
"tradable": 1,
"name": "WILD - CONQUEROR CLASS III",
"name_color": "FFFFFF",
"type": "",
"market_name": "WILD - CONQUEROR CLASS III",
"market_hash_name": "WILD - CONQUEROR CLASS III",
"commodity": 1,
"market_tradable_restriction": 7,
"market_marketable_restriction": 7,
"marketable": 1
}
],
"total_inventory_count": 3,
"success": 1,
"rwgrsn": -2
}
Steam API Link
https://steamcommunity.com/inventory/76561198048878166/517710/2?l=english&count=5000