From 3fcfb5da2fd839ebaccf4106d6ff4cf3380ade1b Mon Sep 17 00:00:00 2001 From: ok-and <115187986+ok-and@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:59:25 +0200 Subject: [PATCH 1/5] Update index.js --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 871e8de..b795fa4 100644 --- a/index.js +++ b/index.js @@ -131,7 +131,12 @@ GlobalOffensive.prototype._connect = function() { this._helloTimer = setTimeout(sendHello, 500); }; - +GlobalOffensive.prototype.openContainer = function(keyID, containerID) { + var buf = new ByteBuffer(16, ByteBuffer.LITTLE_ENDIAN); + buf.writeUint64(keyID || 0); + buf.writeUint64(containerID); + this._send(Language.UnlockCrate, null, buf); +} GlobalOffensive.prototype._send = function(type, protobuf, body) { if (!this._steam.steamID) { return false; From 9634221816d15b2ed8c457d9ccd3c3d820ea5d9e Mon Sep 17 00:00:00 2001 From: ok-and <115187986+ok-and@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:04:11 +0200 Subject: [PATCH 2/5] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 9802678..6eebe51 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,13 @@ Request a list of current live tournament games. This is the list you see in the client under Watch -> Live. Listen for the `matchList` event to get your response. +### openContainer([keyid], containerid) + +- `keyid` - The asset ID of the key, defaults to 0 if not provided as to unlock a keyless container. +- `containerid` - The asset ID of the container. + +Opens a container. Listen for the `itemAcquired` event to get the item unboxed (if open was successful) + ### requestRecentGames(steamid) Request a list of recent games (max. 8). This is the list you see in the client under Watch -> Your Matches. From 394f38077b5c4567a6d72321be0bbee9d8edcf84 Mon Sep 17 00:00:00 2001 From: ok-and <115187986+ok-and@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:05:29 +0200 Subject: [PATCH 3/5] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b795fa4..b02989f 100644 --- a/index.js +++ b/index.js @@ -131,7 +131,7 @@ GlobalOffensive.prototype._connect = function() { this._helloTimer = setTimeout(sendHello, 500); }; -GlobalOffensive.prototype.openContainer = function(keyID, containerID) { +GlobalOffensive.prototype.openContainer = function(containerID, keyID) { var buf = new ByteBuffer(16, ByteBuffer.LITTLE_ENDIAN); buf.writeUint64(keyID || 0); buf.writeUint64(containerID); From 838e9c82b6402614d4235a0c49fa4f979c630a91 Mon Sep 17 00:00:00 2001 From: ok-and <115187986+ok-and@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:06:26 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6eebe51..64f8f59 100644 --- a/README.md +++ b/README.md @@ -110,10 +110,10 @@ Request a list of current live tournament games. This is the list you see in the client under Watch -> Live. Listen for the `matchList` event to get your response. -### openContainer([keyid], containerid) +### openContainer(containerid[, keyid]) -- `keyid` - The asset ID of the key, defaults to 0 if not provided as to unlock a keyless container. - `containerid` - The asset ID of the container. +- `keyid` - The asset ID of the key, defaults to 0 if not provided as to unlock a keyless container. Opens a container. Listen for the `itemAcquired` event to get the item unboxed (if open was successful) From 9a22eb4325ecd0da41694dc45e46d551882e282c Mon Sep 17 00:00:00 2001 From: ok-and <115187986+ok-and@users.noreply.github.com> Date: Thu, 5 Sep 2024 21:07:55 +0200 Subject: [PATCH 5/5] Update index.js --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b02989f..4e93211 100644 --- a/index.js +++ b/index.js @@ -131,12 +131,14 @@ GlobalOffensive.prototype._connect = function() { this._helloTimer = setTimeout(sendHello, 500); }; + GlobalOffensive.prototype.openContainer = function(containerID, keyID) { var buf = new ByteBuffer(16, ByteBuffer.LITTLE_ENDIAN); buf.writeUint64(keyID || 0); buf.writeUint64(containerID); this._send(Language.UnlockCrate, null, buf); -} +}; + GlobalOffensive.prototype._send = function(type, protobuf, body) { if (!this._steam.steamID) { return false;