0% found this document useful (0 votes)
56 views3 pages

Discord Webhook Gems Counter Script

The document contains Lua code for creating a Discord webhook that sends periodic gem count updates. It includes functions for formatting numbers, times, removing colors/symbols from strings, and the main loop that gets the gem count, calculates change, and sends to the webhook every minute.

Uploaded by

iintrovertinf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views3 pages

Discord Webhook Gems Counter Script

The document contains Lua code for creating a Discord webhook that sends periodic gem count updates. It includes functions for formatting numbers, times, removing colors/symbols from strings, and the main loop that gets the gem count, calculates change, and sends to the webhook every minute.

Uploaded by

iintrovertinf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

```

WebHook =
"https://discord.com/api/webhooks/1112148819640057946/vdG4rECPLM5nQIuPmzafceEljIB2z
yaI7vH2mwP2vCIw44Fa_MCDfctXSkS69dVAYjkF" --Webhook Link
Delay = 60000 -- 1 Minute

function removeColorAndSymbols(str)
local cleanedStr = string.gsub(str, "`(%S)", '')
cleanedStr = string.gsub(cleanedStr, "`{2}|(~{2})", '')
return cleanedStr
end

local function FormatNumber(num)


num = math.floor(num + 0.5)

local formatted = tostring(num)


local k = 3
while k < #formatted do
formatted = formatted:sub(1, #formatted - k) .. "," ..
formatted:sub(#formatted - k + 1)
k = k + 4
end

return formatted
end

function FORMAT_TIME(seconds)
local days = math.floor(seconds / 86400)
local hours = math.floor((seconds % 86400) / 3600)
local minutes = math.floor((seconds % 3600) / 60)
local remaining_seconds = seconds % 60

local parts = {}
if days > 0 then
table.insert(parts, tostring(days) .. " day" .. (days > 1 and "s" or
""))
end
if hours > 0 then
table.insert(parts,
tostring(hours) .. " hour" .. (hours > 1 and "s" or ""))
end
if minutes > 0 then
table.insert(parts, tostring(minutes) .. " minute" ..
(minutes > 1 and "s" or ""))
end
if remaining_seconds > 0 then
table.insert(parts, tostring(remaining_seconds) .. " second" ..
(remaining_seconds > 1 and "s" or ""))
end

if #parts == 0 then
return "0 seconds"
elseif #parts == 1 then
return parts[1]
else
local last_part = table.remove(parts)
return table.concat(parts, ", ") .. " and " .. last_part
end
end
CURRENTGEMS = GetLocal().gems
function wh()
local payload = [[
{

"content": "",
"embeds": [{
"title": ":gem:Gems Counter:gem:",
"description": ":pick:**INFORMATION**:pick:",
"url": "https://avatarfiles.alphacoders.com/334/334449.png",
"color": 5814783,
"fields": [{
"name":"Account:",
"value": "Name: **%s**",
"inline": false

},
{
"name": "Information:",
"value": ":earth_asia: Current World: **%s**",
"inline": false
},

{
"name": "**Player Gems:**",
"value": "Current Gems: **%s**\n(Earned **%s** since the last
webhook.)"
}

],
"author": {
"name": "Roxasz Script",
"url": "https://avatarfiles.alphacoders.com/334/334449.png",
"icon_url": "https://avatarfiles.alphacoders.com/334/334449.png"
},
"footer": {
"text": "%s",
"url":
"https://cdn.discordapp.com/attachments/814384402985254940/1092698535117467728/
received_881069006639056.jpg"
}
}]
}]]
payload = payload:format(removeColorAndSymbols(GetLocal().name),
GetLocal().world,tostring(GetLocal().gems):match("(%d+)"), tostring(GetLocal().gems
- CURRENTGEMS):match("(%d+)"), os.date("!%a, %b/%d/%Y at %I:%M %p", os.time() + 8 *
60 * 60))
SendWebhook(WebHook, payload)
CURRENTGEMS = GetLocal().gems
end

while true do
wh()
Sleep(Delay)
end
```
kayak gitu, nah emang fotonya gabisa di ganti ya? gw ganti malah crash fc growpai
gw

You might also like