From c0ffa71f39d9abc06c873dd209e4526e0b6a17da Mon Sep 17 00:00:00 2001 From: 9382 Date: Sun, 18 May 2025 11:12:02 +0100 Subject: [PATCH 1/3] Implement support for the Verification Sign item --- src/Modules/strafes_net.lua | 10 ++++++++-- src/SlashCommands/User.lua | 18 ++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/Modules/strafes_net.lua b/src/Modules/strafes_net.lua index 8101b67..30d4768 100644 --- a/src/Modules/strafes_net.lua +++ b/src/Modules/strafes_net.lua @@ -305,8 +305,14 @@ end function API:GetVerificationItemID(USER_ID) if not USER_ID then return 'empty id' end - local response,headers = http_request('GET', ROBLOX_INVENTORY_API..'users/'..USER_ID.."/items/Asset/102611803", API_HEADER) - return response,headers + local response1,headers1 = http_request('GET', ROBLOX_INVENTORY_API..'users/'..USER_ID.."/items/Asset/102611803", API_HEADER) + if response1.errors then return response1,headers1 end + local response2,headers2 = http_request('GET', ROBLOX_INVENTORY_API..'users/'..USER_ID.."/items/Asset/1567446", API_HEADER) + if response2.errors then return response2,headers2 end + local data = {} + data[#data+1] = response2.data[1] -- Do the older item first if present + data[#data+1] = response1.data[1] + return {data=data},headers1 end function API:GetUserThumbnail(USER_ID,TYPE,SIZE) -- https://thumbnails.roblox.com/v1/users/avatar?userIds=1455906620&size=180x180&format=Png&isCircular=false diff --git a/src/SlashCommands/User.lua b/src/SlashCommands/User.lua index 02457b6..0e7f2a6 100644 --- a/src/SlashCommands/User.lua +++ b/src/SlashCommands/User.lua @@ -62,15 +62,19 @@ local IDToDate = { --Terrible ranges but it's all we have local function linterp(i1, i2, m) return math.floor(i1 + (i2-i1)*m) end -local function GuessDateFromAssetID(AssetID) +local function GuessDateFromAssetID(InstanceID, AssetID) + local note = "" + if AssetID == 1567446 then + note = " (Verification Sign)" + end for i = #IDToDate, 1, -1 do --Newest to oldest local ID,Time = unpack(IDToDate[i]) - if ID < AssetID then + if ID < InstanceID then if not IDToDate[i+1] then return "After "..ToYMD(Time) end local ParentID, ParentTime = unpack(IDToDate[i+1]) - return "Around "..ToYMD(linterp(Time, ParentTime, (AssetID-ID)/(ParentID-ID))) + return "Around "..ToYMD(linterp(Time, ParentTime, (InstanceID-ID)/(ParentID-ID)))..note end end return "Before "..ToYMD(IDToDate[1][2]) @@ -128,7 +132,13 @@ local function Callback(Interaction, Command, Args) if verificationAssetId.errors then verificationDate = "Failed to fetch" elseif verificationAssetId.data[1] then - verificationDate = GuessDateFromAssetID(verificationAssetId.data[1].instanceId) + verificationDate = "" + for i, data in next, verificationAssetId.data do + verificationDate = verificationDate .. GuessDateFromAssetID(data.instanceId, data.id) + if i ~= #verificationAssetId.data then + verificationDate = verificationDate .. "\n" + end + end end local badgeRequest = API:GetBadgesAwardedDates(id,Badges) From dce3e812192f026833dfb8c3b78bffad5bd71191 Mon Sep 17 00:00:00 2001 From: 9382 Date: Sun, 18 May 2025 11:13:06 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Do=20interpolation=20beyond=20the=20dataset?= =?UTF-8?q?=20bounds=20(=F0=9F=A4=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Still not sure this is a good idea, but it means there's less need to update the IDToDate dataset --- src/SlashCommands/User.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SlashCommands/User.lua b/src/SlashCommands/User.lua index 0e7f2a6..e6307cf 100644 --- a/src/SlashCommands/User.lua +++ b/src/SlashCommands/User.lua @@ -71,13 +71,19 @@ local function GuessDateFromAssetID(InstanceID, AssetID) local ID,Time = unpack(IDToDate[i]) if ID < InstanceID then if not IDToDate[i+1] then - return "After "..ToYMD(Time) + -- Screw it we ball, just do unjustified interpolation + local ID1, Time1 = unpack(IDToDate[#IDToDate-1]) + local ID2, Time2 = unpack(IDToDate[#IDToDate]) + return "Around "..ToYMD(linterp(Time1, Time2, (InstanceID-ID1)/(ID2-ID1)))..note end local ParentID, ParentTime = unpack(IDToDate[i+1]) return "Around "..ToYMD(linterp(Time, ParentTime, (InstanceID-ID)/(ParentID-ID)))..note end end - return "Before "..ToYMD(IDToDate[1][2]) + -- Screw it we ball, just do unjustified interpolation + local ID1, Time1 = unpack(IDToDate[1]) + local ID2, Time2 = unpack(IDToDate[2]) + return "Around "..ToYMD(linterp(Time1, Time2, (InstanceID-ID1)/(ID2-ID1)))..note end local function Callback(Interaction, Command, Args) From cc9b12c858e4213321d1003c001acfef5cd5e17d Mon Sep 17 00:00:00 2001 From: 9382 Date: Sun, 18 May 2025 11:13:13 +0100 Subject: [PATCH 3/3] More data points --- src/SlashCommands/User.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SlashCommands/User.lua b/src/SlashCommands/User.lua index e6307cf..8bdb21f 100644 --- a/src/SlashCommands/User.lua +++ b/src/SlashCommands/User.lua @@ -44,6 +44,7 @@ end local IDToDate = { --Terrible ranges but it's all we have -- {1000000000, FromYMD("2006-01-01")}, --I guess? -- {1864564055, FromYMD("2008-08-04")}, + {1228821079, FromYMD("2013-02-07")}, -- asomstephano12344 (mass scanning near sign removal date) {3800920136, FromYMD("2016-04-16")}, {9855616205, FromYMD("2017-04-02")}, {30361018662, FromYMD("2018-11-14")}, @@ -57,6 +58,7 @@ local IDToDate = { --Terrible ranges but it's all we have {232802028144, FromYMD("2024-04-08")}, {234886704167, FromYMD("2024-06-28")}, {241580400713, FromYMD("2025-02-16")}, + {244356127782, FromYMD("2025-05-18")}, } --We assume linear interpolation since anything more complex I can't process local function linterp(i1, i2, m)