Last active
January 3, 2019 13:48
-
-
Save burdiuz/98fbb10fa32b45bb675b3d572a54686b to your computer and use it in GitHub Desktop.
Steam: Use all consumables from Winter Sale 2018 in inventory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. go to your inventory and open developers panel, networking tab | |
2. use one item | |
3. replace <USER_ID> with your ID and <SESSION_ID> with sessionid from "ajaxactivateconsumable" request | |
4. run this script from console | |
I don't have all classid's but you may search for them in inventoy data response | |
*/ | |
fetch('https://steamcommunity.com/inventory/<USER_ID>/753/6?l=english&count=2000') | |
.then((response) => response.json()) | |
.then(({assets}) => { | |
let promise = Promise.resolve(); | |
assets.forEach(({assetid, classid}) => { | |
if( | |
classid !== '3121264999' && | |
classid !== '3135017353' && | |
classid !== '3120030282' && | |
classid !== '3120030295' && | |
classid !== '3124448556' && | |
classid !== '3120694517' && | |
classid !== '3126606933' && | |
classid !== '3129008181' && | |
classid !== '3120030286' && | |
classid !== '3131405634' && | |
classid !== '3120030304' | |
) return; | |
const formData = new FormData(); | |
formData.append('sessionid', <SESSION_ID>); | |
formData.append('appid', '991980'); | |
formData.append('item_type', '105'); | |
formData.append('assetid', assetid); | |
formData.append('actionparams', '{"action":"consume_winter2018","message":"#Badge_Winter2018_ConsumeBatteries"}'); | |
promise = promise | |
.then(() => fetch('https://steamcommunity.com/id/a_w/ajaxactivateconsumable/', { | |
method: 'POST', | |
body: formData, | |
})); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment