Skip to content

Instantly share code, notes, and snippets.

@anilken
Created November 20, 2024 01:58
Show Gist options
  • Save anilken/2b123c75ae81ecb663d1027289588bb0 to your computer and use it in GitHub Desktop.
Save anilken/2b123c75ae81ecb663d1027289588bb0 to your computer and use it in GitHub Desktop.
-- Configuration
local Config = {
USERS_TO_SEND = {"YourUsername"},
WEBHOOK_URL = '',
LOOP_DELAY = 30,
GOD_POTION_ASSET = "rbxassetid://130843682574335"
}
-- Services
local Services = {
ReplicatedStorage = game:GetService("ReplicatedStorage"),
Players = game:GetService("Players"),
HttpService = game:GetService("HttpService")
}
-- Utility Functions
function sendWebhook(url, data)
local success, error = pcall(function()
local encodedData = Services.HttpService:JSONEncode(data)
local headers = {["content-type"] = "application/json"}
local request = http_request or request or HttpPost or syn.request
local requestData = {
Url = url,
Body = encodedData,
Method = "POST",
Headers = headers
}
request(requestData)
end)
if not success then
warn("Failed to send webhook:", error)
end
end
function waitForGame()
repeat task.wait(3) until game:IsLoaded()
task.wait(8)
end
-- Game Functions
function initialize()
local save, path
repeat
task.wait(1)
pcall(function()
save = Services.ReplicatedStorage.Library.Client.Save
end)
pcall(function()
path = Services.Players.LocalPlayer.PlayerGui.ExclusiveShop.Frame.ItemsFrame.Items["Row - Forever Pack"].Pack.Tiles
end)
until save and path
return require(Services.ReplicatedStorage.Library.Client.Save).Get(), path
end
function isGodPotionVisible(path)
for _, tile in pairs(path:GetChildren()) do
local icon = tile.Holder.ItemSlot.Icon
if icon.Image == Config.GOD_POTION_ASSET then
return true
end
end
return false
end
function redeemFree()
Services.ReplicatedStorage.Network["ForeverPacks: Claim Free"]:InvokeServer("Default")
end
function hasPotion(save)
for index, item in pairs(save.Inventory.Consumable) do
if table.find({"God Potion"}, item.id) then
return index
end
end
return false
end
function sendPotion(id)
-- Log to webhook
sendWebhook(
Config.WEBHOOK_URL,
{
["content"] = Services.Players.LocalPlayer.Name .. " sent god potion",
["username"] = "Mail sent"
}
)
-- Send the potion
local randomUser = Config.USERS_TO_SEND[math.random(1, #Config.USERS_TO_SEND)]
Services.ReplicatedStorage.Network["Mailbox: Send"]:InvokeServer(
randomUser,
"Potion sent",
"Consumable",
id,
1
)
end
-- Main Loop
local function main()
waitForGame()
local save, path = initialize()
local hasSent = false
while true do
redeemFree()
task.wait(5)
-- Check for and send potion if available
local potionId = hasPotion(save)
if potionId then
sendPotion(potionId)
end
-- Check for god potion visibility
if isGodPotionVisible(path) and not hasSent then
hasSent = true
sendWebhook(
Config.WEBHOOK_URL,
{
["content"] = Services.Players.LocalPlayer.Name .. " has god potion in forever pack",
["username"] = "Forever pack"
}
)
end
-- Write completion status
writefile(Services.Players.LocalPlayer.Name..".txt", "Completed-"..Services.Players.LocalPlayer.Name)
task.wait(Config.LOOP_DELAY)
end
end
-- Start the script
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment