Receive result from RCCService as base64 and save as png, other luau formatting fixes
This commit is contained in:
parent
ebce3c82c6
commit
3aae7fc2b7
|
|
@ -10258,6 +10258,10 @@ declare _CHAR_APPEARANCE: string
|
||||||
declare _PING_URL: string
|
declare _PING_URL: string
|
||||||
|
|
||||||
declare _BASE_URL: string
|
declare _BASE_URL: string
|
||||||
|
declare _THUMBNAIL_KEY: string
|
||||||
|
declare _RENDER_TYPE: string
|
||||||
|
declare _ASSET_ID: number
|
||||||
|
|
||||||
declare _MAP_LOCATION_EXISTS: boolean
|
declare _MAP_LOCATION_EXISTS: boolean
|
||||||
declare _MAP_LOCATION: any
|
declare _MAP_LOCATION: any
|
||||||
declare _SERVER_PORT: number
|
declare _SERVER_PORT: number
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,16 @@
|
||||||
-- Avatar v1.1.0
|
-- Avatar v1.1.0
|
||||||
-- This is the thumbnail script for R6 avatars. Straight up and down, with the right arm out if they have a gear.
|
-- This is the thumbnail script for R6 avatars. Straight up and down, with the right arm out if they have a gear.
|
||||||
|
|
||||||
local baseUrl: string = _BASE_URL
|
local baseUrl = _BASE_URL
|
||||||
local thumbnailKey: string = _THUMBNAIL_KEY
|
local thumbnailKey = _THUMBNAIL_KEY
|
||||||
local renderType: string = _RENDER_TYPE
|
local renderType = _RENDER_TYPE
|
||||||
local assetId: number = _ASSET_ID
|
local assetId = _ASSET_ID
|
||||||
|
|
||||||
local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
|
local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
|
local HttpService = game:GetService "HttpService"
|
||||||
|
local ScriptContext = game:GetService "ScriptContext"
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
ContentProvider:SetBaseUrl(baseUrl)
|
ContentProvider:SetBaseUrl(baseUrl)
|
||||||
|
|
@ -16,8 +18,11 @@ pcall(function()
|
||||||
InsertService:SetAssetVersionUrl(baseUrl .. "/Asset/?assetversionid=%d")
|
InsertService:SetAssetVersionUrl(baseUrl .. "/Asset/?assetversionid=%d")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
game:GetService("HttpService").HttpEnabled = true
|
HttpService.HttpEnabled = true
|
||||||
game:GetService("ScriptContext").ScriptsDisabled = true
|
ScriptContext.ScriptsDisabled = true
|
||||||
|
|
||||||
|
print(baseUrl, thumbnailKey, renderType, assetId)
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"["
|
"["
|
||||||
.. game.JobId
|
.. game.JobId
|
||||||
|
|
@ -41,6 +46,8 @@ local player = game:GetService("Players"):CreateLocalPlayer(0)
|
||||||
player.CharacterAppearance = baseUrl
|
player.CharacterAppearance = baseUrl
|
||||||
.. "/Asset/CharacterFetch.ashx?userID="
|
.. "/Asset/CharacterFetch.ashx?userID="
|
||||||
.. assetId
|
.. assetId
|
||||||
|
.. "&serverId=-1&t="
|
||||||
|
.. tick()
|
||||||
player:LoadCharacter(false)
|
player:LoadCharacter(false)
|
||||||
|
|
||||||
-- Raise up the character's arm if they have gear.
|
-- Raise up the character's arm if they have gear.
|
||||||
|
|
@ -50,10 +57,10 @@ if gear then
|
||||||
player.Character.Torso["Right Shoulder"].CurrentAngle = math.rad(90)
|
player.Character.Torso["Right Shoulder"].CurrentAngle = math.rad(90)
|
||||||
end
|
end
|
||||||
|
|
||||||
local click = ThumbnailGenerator:Click("PNG", 1024, 1024, true)
|
local click = ThumbnailGenerator:Click("PNG", 420, 420, true)
|
||||||
|
|
||||||
local result = '{"Status": 2, "Click": "' .. tostring(click) .. '"}'
|
local result = '{"Status": 2, "Click": "' .. tostring(click) .. '"}'
|
||||||
print result
|
print(result)
|
||||||
print("[" .. game.JobId .. "] Successfully rendered, moving on...")
|
print("[" .. game.JobId .. "] Successfully rendered, moving on...")
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
|
|
@ -66,8 +73,7 @@ while true do
|
||||||
.. game.JobId,
|
.. game.JobId,
|
||||||
result,
|
result,
|
||||||
true,
|
true,
|
||||||
"text/plain",
|
"text/plain"
|
||||||
true
|
|
||||||
)
|
)
|
||||||
end)
|
end)
|
||||||
if not ok then
|
if not ok then
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,16 @@
|
||||||
-- Avatar v1.1.0
|
-- Avatar v1.1.0
|
||||||
-- This is the thumbnail script for R6 avatars. Straight up and down, with the right arm out if they have a gear.
|
-- This is the thumbnail script for R6 avatars. Straight up and down, with the right arm out if they have a gear.
|
||||||
|
|
||||||
local baseUrl: string, thumbnailKey: string, renderType: string, assetId: number =
|
local baseUrl = _BASE_URL
|
||||||
...
|
local thumbnailKey = _THUMBNAIL_KEY
|
||||||
|
local renderType = _RENDER_TYPE
|
||||||
|
local assetId = _ASSET_ID
|
||||||
|
|
||||||
local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
|
local ThumbnailGenerator = game:GetService "ThumbnailGenerator"
|
||||||
local ContentProvider = game:GetService "ContentProvider"
|
local ContentProvider = game:GetService "ContentProvider"
|
||||||
local InsertService = game:GetService "InsertService"
|
local InsertService = game:GetService "InsertService"
|
||||||
|
local HttpService = game:GetService "HttpService"
|
||||||
|
local ScriptContext = game:GetService "ScriptContext"
|
||||||
|
|
||||||
pcall(function()
|
pcall(function()
|
||||||
ContentProvider:SetBaseUrl(baseUrl)
|
ContentProvider:SetBaseUrl(baseUrl)
|
||||||
|
|
@ -14,8 +18,10 @@ pcall(function()
|
||||||
InsertService:SetAssetVersionUrl(baseUrl .. "/Asset/?assetversionid=%d")
|
InsertService:SetAssetVersionUrl(baseUrl .. "/Asset/?assetversionid=%d")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
game:GetService("HttpService").HttpEnabled = true
|
HttpService.HttpEnabled = true
|
||||||
game:GetService("ScriptContext").ScriptsDisabled = true
|
ScriptContext.ScriptsDisabled = true
|
||||||
|
|
||||||
|
print(baseUrl, thumbnailKey, renderType, assetId)
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"["
|
"["
|
||||||
|
|
@ -50,10 +56,10 @@ if gear then
|
||||||
player.Character.Torso["Right Shoulder"].CurrentAngle = math.rad(90)
|
player.Character.Torso["Right Shoulder"].CurrentAngle = math.rad(90)
|
||||||
end
|
end
|
||||||
|
|
||||||
local click = ThumbnailGenerator:Click("PNG", 1024, 1024, true)
|
local click = ThumbnailGenerator:Click("PNG", 420, 420, true)
|
||||||
|
|
||||||
local result = '{"Status": 2, "Click": "' .. tostring(click) .. '"}'
|
local result = '{"Status": 2, "Click": "' .. tostring(click) .. '"}'
|
||||||
print result
|
print(result)
|
||||||
print("[" .. game.JobId .. "] Successfully rendered, moving on...")
|
print("[" .. game.JobId .. "] Successfully rendered, moving on...")
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue