Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.7 kB
27
Indexable
Never
sendNotif = true -- if true bot will send webhook

webhook = ""

function sendWebhook(text)
    webhook = Webhook.new(webhook)
    webhook.username = "Donate Logs"
    webhook.content = text
    webhook:send()
end


function string:removeColors()
    return self:gsub("`.", '')
end

while true do
    addEvent(Event.variantlist, function(variant, netid)
        if variant:get(0):getString() == "OnConsoleMessage" then
            local body = variant:get(1):getString()
            local content = removeColor(body)
            local vtext = variant:get(1):getString()
            if vtext:find("```5") and not vtext:find("SB") and not vtext:find("CB") and not vtext:find("BC") then
                content = removeColor(variant:get(1):getString())
                local name = content:match("%[%[(.-) places")
                local amount = content:match("places (%d+)")
                local item = content:match("places "..amount.." (.+) into")
                item = item:lower()
                name = name:lower()
                if sendNotif then
                    sendWebhook(name .. " has deposited " .. amount.. " " .. item)
                end
                if item:find("lock") and amount and name then
                    if item:lower():find("diamond lock") then
                        amount = amount * 100
                    elseif item:lower():find("world lock") then
                        amount = amount
                    elseif item:lower():find("blue gem lock") then
                        amount = amount * 100 * 100
                    end
                end
            end
        end
    end)

    listenEvents(100999990)
end
Leave a Comment