local CompleteCollection_NormalEggs = true
local CompleteCollection_GoldenEggs = true
local CompleteCollection_MakeRainbows = false
local CompleteCollection_MakeDarkMatter = false
function GetNextMissingPet()
local SaveData = Library.Save.Get()
if not SaveData then return nil end
local allCollectablePets = Library.Shared.GetAllCollectablePets()
local remainingPets = {}
for i, pet in pairs(allCollectablePets) do
local petId = pet.petId
local petData = Library.Directory.Pets[petId]
local isGolden = pet.isGolden
local isRainbow = pet.isRainbow
local isDarkMatter = pet.isDarkMatter
local petType = 1
if isGolden then
petType = 2
elseif isRainbow then
petType = 3
elseif isDarkMatter then
petType = 4
end
local isUnlocked = Library.Functions.SearchArray(SaveData.Collection, tostring(petId) .. "-" .. tostring(petType))
if petData and not (petData.titanic or petData.huge or petData.rarity == "Exclusive" or petData.rarity == "Event") and not isUnlocked then
-- remainingPets[petId] = petType
table.insert(remainingPets, {petId, petType})
end
end
table.sort(remainingPets, function(a, b)
local petDataA = Library.Directory.Pets[a[1]]
local petDataB = Library.Directory.Pets[b[1]]
local petTypeA = a[2]
local petTypeB = b[2]
if a == b then
return petTypeA < petTypeB
end
return a[1] < b[1]
end)
for i, v in ipairs(remainingPets) do return v end
end
function GetBestEggForPet(petId)
local allEggs = Library.Directory.Eggs
local eggsWithPet = {}
for eggId, v in pairs(allEggs) do
if v and v.drops and typeof(v.drops) == "table" then
for _, drop in pairs(v.drops) do
local petDropId = drop[1]
if petDropId == tostring(petId) then
table.insert(eggsWithPet, {eggId, drop[2]})
end
end
end
end
table.sort(eggsWithPet, function(a, b)
local chanceA = eggsWithPet[a][2]
local chanceB = eggsWithPet[b][2]
return chanceA > chanceB
end)
for i, v in ipairs(eggsWithPet) do
return v[1]
end
return nil
end
local completeCollectionSection = automationTab:CreateSection("Auto Pet Collection", false, true)
local completeCollectionStatus = automationTab:CreateParagraph({Title = "Status", Content = "Waiting to start"}, completeCollectionSection)
local completeCollectionNormalEggs = automationTab:CreateToggle({
Name = "Normal Eggs",
SectionParent = completeCollectionSection,
CurrentValue = true,
Flag = "CompleteCollection_NormalEggs",
Callback = function(value)
CompleteCollection_NormalEggs = value
coroutine.wrap(function()
local currentPet, currentPetType = unpack(GetNextMissingPet())
local currentEgg = GetBestEggForPet(currentPet)
completeCollectionStatus:SetContent("Pet: " .. Library.Directory.Pets[currentPet].name .. "\nType: " .. currentPetType .. "\nEgg: " .. currentEgg)
while task.wait(3) do
end
end)()
end
})
local completeCollectionGolldenEggs = automationTab:CreateToggle({
Name = "Golden Eggs",
SectionParent = completeCollectionSection,
CurrentValue = true,
Flag = "CompleteCollection_GoldenEggs",
Callback = function(value)
CompleteCollection_GoldenEggs = value
end
})
local completeCollectionMakeRainbows = automationTab:CreateToggle({
Name = "Make Rainbows",
SectionParent = completeCollectionSection,
CurrentValue = false,
Flag = "CompleteCollection_MakeRainbows",
Callback = function(value)
CompleteCollection_MakeRainbows = value
end
})
local completeCollectionMakeDarkMatter = automationTab:CreateToggle({
Name = "Make Dark Matter",
SectionParent = completeCollectionSection,
CurrentValue = false,
Flag = "CompleteCollection_MakeDarkMatter",
Callback = function(value)
CompleteCollection_MakeDarkMatter = value
end
})
-- SETTINGS
local AUTODAYCARE_OTHER_GAMEMODES = false -- CHANGE THIS TO TRUE IF YOU WANT TO AUTO-COLLECT/ENROLL BOTH NORMAL AND HARDCORE GAMEMODES
local TRY_TO_TELEPORT_SAME_SERVER = true -- If auto-daycare is enabled for both gamemodes, this option will TRY teleport you back to the same server that you were before
local DAYCARE_WORLD = "Spawn"
local DAYCARE_POSITION = Vector3.new(35, 110, 40)
local PetsToDaycare = {}
local DaycareGUI = Library.GUI.Daycare;
local DISCORD_EMOTES = {
["Diamonds"] = "<:e:1062469796341497887>",
["Triple Coins"] = "<:e:1082130777355079800>",
["Triple Damage"] = "<:e:1082130816261443674>",
["Super Lucky"] = "<:e:1082130793880621167>",
["Ultra Lucky"] = "<:e:1082130805914079313>"
}
local COIN_EMOTE = "<:e:1087199766401794168>"
local PET_EMOTE = "<:e:1083222082533462098>"
local AUTODAYCARE_SETTINGS_FOLDER = "AutoDaycare"
local AUTODAYCARE_SETTINGS_FILE = "SaveData"
function SaveSettings()
pcall(function()
if not isfolder(AUTODAYCARE_SETTINGS_FOLDER) then
makefolder(AUTODAYCARE_SETTINGS_FOLDER)
end
local fileData = {}
if CurrentWorld and CurrentWorld ~= "" then
fileData.World = CurrentWorld
end
if CurrentPosition and CurrentPosition ~= nil then
fileData.Position = CurrentPosition
end
fileData.GameMode = "normal"
if Library.Shared.IsHardcore then
fileData.GameMode = "hardcore"
end
writefile(AUTODAYCARE_SETTINGS_FOLDER .. "/" .. AUTODAYCARE_SETTINGS_FILE .. ".json", tostring(HttpService:JSONEncode(fileData)))
end)
end
local IsTeleporting = false
function LoadSettings()
pcall(function()
if isfile(AUTODAYCARE_SETTINGS_FOLDER .. "/" .. AUTODAYCARE_SETTINGS_FILE .. ".json") then
local saveData = readfile(AUTODAYCARE_SETTINGS_FOLDER .. "/" .. AUTODAYCARE_SETTINGS_FILE .. ".json")
local save = HttpService:JSONDecode(saveData)
if not save.GameMode or save.GameMode == "" then return end
local shouldTeleport = false
if save.World and save.World ~= "" then
CurrentWorld = save.World
shouldTeleport = true
end
if save.Position and save.Position ~= nil then
CurrentPosition = save.Position
shouldTeleport = true
end
local gamemode = "normal"
if Library.Shared.IsHardcore then
gamemode = "hardcore"
end
if save.GameMode ~= gamemode then return end
if shouldTeleport then
IsTeleporting = true
TeleportBack()
IsTeleporting = false
end
end
end)
end
function SendWebhookInfo(quantity, loots)
if not Webhook_Enabled or not Webhook_Daycare or not Webhook_URL or Webhook_URL == "" then return end
local gamemode = "[NORMAL]"
if Library.Shared.IsHardcore then
gamemode = "[HARDCORE]"
end
local lootString = ""
local ContainsPet = false
for _, loot in pairs(loots) do
local selectedEmote = ""
if DISCORD_EMOTES[loot.Data] then
selectedEmote = DISCORD_EMOTES[loot.Data]
elseif loot.Category == "Currency" then
selectedEmote = COIN_EMOTE
elseif loot.Category == "Pet" then
ContainsPet = true
selectedEmote = PET_EMOTE
end
lootString = lootString .. selectedEmote .. " " .. Library.Functions.NumberShorten(loot.Min) .. " **" .. loot.Data .. "**\n"
end
local embed = {
["title"] = "Daycare has been collected! " .. gamemode,
["description"] = "Successfully collected **".. tostring(quantity) .."** pets from daycare!",
["color"] = tonumber(0x90ff90),
["fields"] = {
{
["name"] = "Collected Loot",
["value"] = lootString,
["inline"] = false
}
},
["footer"] = {
["text"] = "Pet Simulator X",
["icon_url"] = "https://[Log in to view URL]"
}
}
(syn and syn.request or http_request or http.request) {
Url = Webhook_URL;
Method = 'POST';
Headers = {
['Content-Type'] = 'application/json';
};
Body = HttpService:JSONEncode({
username = "Daycare Update",
avatar_url = 'https://[Log in to view URL]',
embeds = {embed}
})
}
end
function TeleportToDaycare()
CurrentWorld = Library.WorldCmds.Get()
CurrentPosition = HumanoidRootPart.CFrame
task.wait()
-- Go to Spawn World
if CurrentWorld ~= DAYCARE_WORLD then
Library.WorldCmds.Load(DAYCARE_WORLD)
end
HumanoidRootPart.CFrame = CFrame.new(DAYCARE_POSITION)
end
function SendNotification(msg, options)
if not options then
options = {
time = 10,
color = Color3.fromRGB(160, 30, 245),
force = true
}
end
Library.Signal.Fire("Notification", msg, options)
end
function ErrorNotification(msg)
SendNotification(msg, {
time = 10, color = Color3.fromRGB(255, 60, 60), force = true
})
end
To embed this project on your website, copy the following code and paste it into your website's HTML: