Hello! I have been recently trying to make a script that prints out a bestprice of a limited item, which is working correctly.
But the main issue is it isnt working on limited**(U)** items, it just prints out “nil”.
Here is my script:
local HttpService = game:GetService("HttpService")
local URL = "https://www.rolimons.com/item/"
function Request(url)
return HttpService:RequestAsync({
Url = url;
Method = "GET";
})
end
function GetBestPrice(id)
local HttpResponse = Request(URL .. tostring(id))
if HttpResponse.Success then
local Result = HttpResponse.Body
-- Find the start and end positions of the best_price value
local startPos, endPos = string.find(Result, '"best_price":%s*(%d+)')
if startPos and endPos then
-- Extract the best_price value
local bestPrice = tonumber(Result:sub(startPos + 13, endPos))
return bestPrice
end
end
end
local anID = 286524574
while true do
local bestPrice = GetBestPrice(anID)
warn(bestPrice)
task.wait(1)
end
If anyone knows how to modify the script to print out a limited(U) item’s bestprice AND limited’s bestprice, i would greatly appreaciate it.
This is extremely hacky and will break if they modify the page but try this Best Price<\/[a-z A-Z]+>?\n?\s+<[a-z A-Z ="-]+>[0-9,]+<\/[a-z A-Z]+>
You will have to adjust your StartPos math
Im a begginer and the i found the script that im using on devforum, so i modified it a little so it wouldnt be messy and it actually worked. Now im just trying to figure out the limited(U) thing.
Ive tried using proxies but i cant really seem to understand how to do they work.
But one thing i notice that i havent seen the API you showed me, so i will try and make it with that.