local BoostIcons = {
		["Triple Coins"] = "rbxassetid://7402604552", 
		["Triple Damage"] = "rbxassetid://7402604431", 
		["Super Lucky"] = "rbxassetid://7402604677", 
		["Ultra Lucky"] = "rbxassetid://7402706511"
	}

	function CollectDaycare()
		local saving = Library.Save.Get()
		if not saving then 
			ErrorNotification("Something went wrong! Try re-logging!")
			return
		end
		
		local success, errorMsg, pets, loots, queue = Library.Network.Invoke("Daycare: Claim", nil)
		if not success then
			return false, (errorMsg and "Can't claim, unknown error!")
		end

		if loots then 
			
			for _, loot in pairs(loots) do
				-- print (tostring(loot.Category) .. ": " .. tostring(loot.Min) .. "x " .. tostring(loot.Data) )
				-- Quantity: loot.Min
				if loot.Category == "Currency" then 
					-- CurrencyIcon: Library.Directory.Currency[loot.Data].tinyImage;	
				elseif loot.Category == "Boost" then
					-- BoostIcon = BoostIcon[loot.Data]
				elseif loot.Category == "Pet" then
					local petData = loot.Data;
					
					-- Open Huge Egg
					if petData.id ~= "1019" then
						Library.Signal.Fire("Open Egg", "Huge Machine Egg 1", { petData });
					end
				end
			end
			
		end
		
		if queue then
			if Library.Shared.IsHardcore then
				saving.DaycareHardcoreQueue = queue;
			else
				saving.DaycareQueue = queue;
			end
			
			-- Remove pets that isn't ready yet
			
			for _, pet in pairs(queue) do
				if pet["Pet"] and pet["Pet"].uid then
					local tablePos = table.find(PetsToDaycare, pet["Pet"].uid)
					if tablePos then
						-- print("A pet was not ready yet!")
						table.remove(PetsToDaycare, tablePos)
					end
				end
			end
			
		end
		
		SendWebhookInfo(#PetsToDaycare, loots)

		return true, nil
	end

	function PutPetsInDaycare()
		local saving = Library.Save.Get()
		local success, errorMsg, _ = Library.Network.Invoke("Daycare: Enroll", PetsToDaycare)
		if not success then
			return false, (errorMsg and "Can't enroll pets, unknown error!")
		end

		print(tostring(#PetsToDaycare) .. " pets have been put on daycare!")
		task.wait(1)
		
		Library.Signal.Fire("Stat Changed", "DaycareTier")
		Library.Signal.Fire("Window Closed", DaycareGUI.Gui)
		return true, nil
	end

	function CreateReminder()
		if getgenv().AutoDaycare then
			return 
		end
		
		local saving = Library.Save.Get()
		
		local queue = saving.DaycareQueue
		if Library.Shared.IsHardcore then
			queue = saving.DaycareHardcoreQueue
		end
		
		-- Check if queue isn't nil and queue lenght is more than 1 (pet)
		if queue ~= nil and #queue > 0 then	
			getgenv().AutoDaycare = true
			coroutine.wrap(function() 
				while true do
					local allPetsAreReady = true
					
					for _, pet in pairs(queue) do
						local remainingTime = Library.Shared.DaycareComputeRemainingTime(saving, pet)

						if remainingTime > 0 then
							allPetsAreReady = false
							break
						end

					end
					
					
					if allPetsAreReady or not enableAutoDaycare then break end
					task.wait(1)
				end
				
				getgenv().AutoDaycare = false
				
				if not enableAutoDaycare then return end
				if ScriptIsCurrentlyBusy then 
					while ScriptIsCurrentlyBusy do wait() end
					ScriptIsCurrentlyBusy = true
					wait(3)
				end
				
				ScriptIsCurrentlyBusy = true
				
				--if reminder then Library.Message.New("Your pets in daycare are ready to collect!") end
				
				PetsToDaycare = {}
				
				for _, pet in pairs(queue) do	
					local remainingTime = Library.Shared.DaycareComputeRemainingTime(saving, pet)

					if remainingTime <= 0 and pet["Pet"] and pet["Pet"].uid then
						table.insert(PetsToDaycare, pet["Pet"].uid)
					end
				end
				
				TeleportToDaycare()
				task.wait(1)
				
				local collected, collectError = CollectDaycare()
				if not collected then		
					ErrorNotification(collectError)
					ResetDaycare()
					return
				end
				
				task.wait(3)
				
				local enrollSuccess, enrollError = PutPetsInDaycare()
				if not enrollSuccess then
					ErrorNotification(enrollError)
					ResetDaycare()
					return
				end

				SendNotification("Successfully put pets in daycare!")
				ResetDaycare()
			end)()
		end
	end

	function TeleportBack()
		pcall(function() 
			-- Go to Spawn World
			if CurrentWorld ~= "" and Library.WorldCmds.Get() ~= CurrentWorld then
				Library.WorldCmds.Load(CurrentWorld)
			end
			CurrentWorld = ""
			
			if CurrentPosition then
				HumanoidRootPart.CFrame = CurrentPosition
			end
			CurrentPosition = nil
		end)
	end

	function ResetDaycare()
		TeleportBack()
		DaycareGUI.Categories.ViewPets.Frame.PetReady.Visible = false

    -- FIRE CLOSE CONNECTION
		for _, connection in pairs(getconnections(DaycareGUI.Close.Activated)) do 
			connection:Fire()
		end

		wait(3)
		ScriptIsCurrentlyBusy = false
	end

	Library.Signal.Fired("Stat Changed"):Connect(function(stat)
		if stat == "DaycareQueue" and enableAutoDaycare then
			CreateReminder()
		end
	end)

	task.spawn(function() 
		while true do
			if Automations_AutoGameComplete then	
				local saveData = Library.Save.Get()
				local currentAreaName, nextAreaName = GetCurrentAndNextArea()
				local currentArea = Library.Directory.Areas[currentAreaName]
				local nextArea = Library.Directory.Areas[nextAreaName]
				
				local shouldSkip = false
				if currentAreaName == "Hacker Portal" then
					shouldSkip = true
					local ownsHackerGate = IsHardcore and saveData.Hardcore.HackerPortalUnlocked or not IsHardcore and saveData.HackerPortalUnlocked
					if not ownsHackerGate then
					
						local currentProgress, currentMission = unpack(IsHardcore and saveData.Hardcore.HackerPortalProgress or saveData.HackerPortalProgress)
						if currentMission < 0 then
							-- Start quest
							local map = Library.WorldCmds.GetMap()
							local interactive = nil
							if map then interactive = map:FindFirstChild("Interactive") end
							
							local hackerPortal = nil
							if interactive then hackerPortal = interactive:FindFirstChild("Hacker Portal") end
							
							local interactLocation = nil
							if hackerPortal then interactLocation = hackerPortal:FindFirstChild("_INTERACT") end
							
							if interactLocation then
								HumanoidRootPart.CFrame = CFrame.new(interactLocation.CFrame.p) + (interactLocation.CFrame.RightVector * 10)
								SendNotification("Starting hacker portal mission...")
								Library.Network.Fire("Start Hacker Portal Quests")
								currentMission = 1
							end
						end
						
						if currentMission > 1 then
							currentMission = 1
							currentProgress = Library.Shared.HackerPortalQuests[1]

						end
						
						if currentMission > -1 then
							local totalToComplete = Library.Shared.HackerPortalQuests[currentMission]
							if totalToComplete and tonumber(totalToComplete) and currentProgress >= totalToComplete then
								local map = Library.WorldCmds.GetMap()
								local interactive = nil
								if map then interactive = map:FindFirstChild("Interactive") end
								
								local hackerPortal = nil
								if interactive then hackerPortal = interactive:FindFirstChild("Hacker Portal") end
								
								local interactLocation = nil
								if hackerPortal then interactLocation = hackerPortal:FindFirstChild("_INTERACT") end
								
								if interactLocation then
									HumanoidRootPart.CFrame = CFrame.new(interactLocation.CFrame.p) + (interactLocation.CFrame.RightVector * 10)
									wait(0.3)
								end
								
								if Library.Network.Invoke("Finish Hacker Portal Quest")	then
									SendNotification("Unlocking Void...")
									Library.WorldCmds.Load("Void")
									wait(2)
									SendNotification("Unlocking ".. nextAreaName .. "...")
									Library.WorldCmds.Load(nextArea.world)
									wait(1)
								end
							end
						end
					else 
						SendNotification("Unlocking Void...")
						Library.WorldCmds.Load("Void")
						wait(2)
						SendNotification("Unlocking ".. nextAreaName .. "...")
						Library.WorldCmds.Load(nextArea.world)
						wait(1)
					end
				end
				
				if nextAreaName ~= "COMPLETED" and not shouldSkip and CheckIfCanAffordArea(nextAreaName) then 

                   -- Buy area
					local currentWorld = Library.WorldCmds.Get() 
					if currentWorld ~= nextArea.world then 
						Library.WorldCmds.Load(nextArea.world)
						wait(1)
					end
					
					local map = Library.WorldCmds.GetMap()
					local allGates = nil
					if map then allGates = map:FindFirstChild("Gates") end
					
					local successfullyTeleported = false
					if allGates and allGates:FindFirstChild(nextAreaName) then
						local gate = allGates:FindFirstChild(nextAreaName):FindFirstChild("Gate")
						if gate and gate:FindFirstChild("GateHUD") then
							local gateTP = gate:FindFirstChild("GateHUD").Parent
							if gateTP then 
								HumanoidRootPart.CFrame = CFrame.new(gateTP.CFrame.p) * CFrame.new(1,0,0)
								successfullyTeleported = true
							end
						end
					elseif currentArea.world == "Fantasy" then
						local interactive = map:FindFirstChild("Interactive")
						local portals = nil
						if interactive then portals = interactive:FindFirstChild("Portals") end
						if portals and portals:FindFirstChild(nextAreaName) then 
							local portal = portals:FindFirstChild(nextAreaName)
							HumanoidRootPart.CFrame = CFrame.new(portal.PrimaryPart.CFrame.p) + (portal.PrimaryPart.CFrame.RightVector * 5)
							successfullyTeleported = true
						end 
						
					end
					
					if successfullyTeleported then
						wait(0.1)
						SendNotification("Unlocking ".. nextAreaName .. "...")
						local success, errorMsg = Library.Network.Invoke("Buy Area", nextAreaName)
						if success then
							if currentAreaName == "Cat Kingdom" then
								SendNotification("Unlocking Limbo...")
								Library.WorldCmds.Load("Limbo")
								wait(1)
                            end 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: