local eggTab = Window:CreateTab("Eggs", "13075637275", true)
local hatchingSection = eggTab:CreateSection("Egg Hatching", false)
local eggInfo = eggTab:CreateParagraph({Title = "Information", Content = "Buy some egg in-game and it will be automatically selected!\nSelected Egg: %s\nMode: %s\nQuantity Hatched: %s\nQuantity Remaining: %s\n25x Insane Luck: %s\n\n\n\naaa"}, hatchingSection)
local LastOpenEggId = "None"
AddCustomFlag("CurrentEgg", "None", function(newValue)
LastOpenEggId = newValue
end)
local LastOpenEggData = nil
local LastHatchSetting = "Normal"
AddCustomFlag("CurrentHatchSettings", "Normal", function(newValue)
LastHatchSetting = newValue
end)
local EnableAutoHatch = false
eggTab:CreateToggle({
Name = "Auto Hatch",
Flag = "AutoHatch_Enabled",
SectionParent = hatchingSection,
Callback = function(Value)
EnableAutoHatch = Value
if EnableAutoHatch then
coroutine.wrap(function()
while EnableAutoHatch do
wait(math.random(3, 3.1))
if not EnableAutoHatch then break end
local tripleHatch = false
local octupleHatch = false
if LastHatchSetting == "Triple" then tripleHatch = true end
if LastHatchSetting == "Octuple" then octupleHatch = true end
--print("Trying to hatch: ", LastOpenEggId, tripleHatch, octupleHatch)
local successHatch, errorHatch = HatchEgg(LastOpenEggId, tripleHatch, octupleHatch, true)
if not successHatch then print(errorHatch or "Opss, failed to hatch!") end
end
end)()
end
end
})
local Original_OpenEgg = nil
eggTab:CreateToggle({
Name = "Skip Egg Animation",
Flag = "AutoFarm_SkipEggAnimation",
SectionParent = hatchingSection,
Callback = function(Value)
if Value then SkipEggAnimation() else RestoreEggAnimation() end
end
})
local OpenEggsScript = getsenv(LocalPlayer.PlayerScripts.Scripts.Game:WaitForChild("Open Eggs", 10))
function SkipEggAnimation()
if not Original_OpenEgg then
Original_OpenEgg = OpenEggsScript.OpenEgg
end
OpenEggsScript.OpenEgg = function()
return true
end
end
function RestoreEggAnimation()
if not Original_OpenEgg then return end
OpenEggsScript.OpenEgg = Original_OpenEgg
end
function UpdateEggInfo()
local playerData = Library.Save.Get()
local playerEggsOpened = playerData["EggsOpened"]
local serverBoosts = Library.ServerBoosts.GetActiveBoosts()
if eggInfo then
local selectedEgg = LastOpenEggId or "None"
local selectedSetting = LastHatchSetting or "Normal"
local eggsOpened = Library.Functions.Commas(playerEggsOpened and playerEggsOpened[LastOpenEggId] and playerEggsOpened[LastOpenEggId] or 0)
local eggsRemaining = Library.Functions.Commas(Library.Directory.Eggs[selectedEgg] and math.floor(playerData[Library.Directory.Eggs[selectedEgg].currency] / Library.Directory.Eggs[selectedEgg].cost) > 0 and math.floor(playerData[Library.Directory.Eggs[selectedEgg].currency] / Library.Directory.Eggs[selectedEgg].cost) or 0)
local insaneLucky = serverBoosts and serverBoosts["Insane Luck"] and tostring(serverBoosts["Insane Luck"].totalTimeLeft) .. "s" or "Inactive"
eggInfo:Set({Title = "Information", Content = string.format("Buy some egg in-game and it will be automatically selected!\n\n<b>Selected Egg:</b> %s\n<b>Mode:</b> %s\n<b>Quantity Hatched:</b> %s\n<b>Quantity Remaining:</b> %s\n<b>25x Insane Luck:</b> %s", selectedEgg, selectedSetting, eggsOpened, eggsRemaining, insaneLucky)})
end
end
task.spawn(function()
while true do
UpdateEggInfo()
task.wait()
end
end)
local automationTab = Window:CreateTab("Automation", "13075622619", true)
local automaticFunctionsSection = automationTab:CreateSection("Automatic Functions", false)
local enableAutoDaycare = false
local autodaycareButton = automationTab:CreateToggle({
Name = "Auto Daycare",
CurrentValue = false,
Flag = "Automation_AutoDaycare",
SectionParent = automaticFunctionsSection,
Callback = function(Value)
enableAutoDaycare = Value
if Value then
CreateReminder()
end
end
})
local Automations_AutoGameComplete = false
local autoCompleteGameToggle = automationTab:CreateToggle({
Name = "Auto Complete Game",
Flag = "Automation_AutoCompleteGame",
CurrentValue = false,
SectionParent = automaticFunctionsSection,
Callback = function(Value)
if Value then
local currentAreaName, nextAreaName = GetCurrentAndNextArea()
if nextAreaName ~= "COMPLETED" then
local areaToTeleport = Library.Directory.Areas[currentAreaName]
if areaToTeleport and areaToTeleport.world then
if Library.WorldCmds.Get() ~= areaToTeleport.world then
Library.WorldCmds.Load(areaToTeleport.world)
end
wait(0.25)
local areaTeleport = Library.WorldCmds.GetMap().Teleports:FindFirstChild(currentAreaName)
if areaTeleport then
Library.Signal.Fire("Teleporting")
task.wait(0.25)
Character:PivotTo(areaTeleport.CFrame + areaTeleport.CFrame.UpVector * (Humanoid.HipHeight + HumanoidRootPart.Size.Y / 2))
Library.Network.Fire("Performed Teleport", currentAreaName)
task.wait(0.25)
end
end
else
Value = false
Rayfield.Flags["Automation_AutoCompleteGame"]:Set(false)
end
-- CHECK FOR CURRENT AREA AND TELEPORT TO IT
end
Automations_AutoGameComplete = Value
end
})
local _, nextAreaCheck = GetCurrentAndNextArea()
if nextAreaCheck == "COMPLETED" then
autoCompleteGameToggle:Lock("No areas to unlock! 🎉", true)
end
local bankIndexSection = automationTab:CreateSection("Bank Index", false, false, "13080063246")
automationTab:CreateParagraph({ Title = "What is this?", Content = "Some people <font color=\"#2B699F\">store pets in a bank to complete the pet collection</font> on alt accounts.\n<b>This feature should help on that process, it will automatically do:</b>\n- <font color=\"#2B699F\"><b>Check non-indexed pets on current account</b></font>\n- <font color=\"#2B699F\"><b>Take pets from the bank</b></font>\n- <font color=\"#2B699F\"><b>Put back on the bank after indexed</b></font>" }, bankIndexSection)
local BankIndex_Debounce = false
local BankIndex_InProgress = false
local BankIndex_OwnerUsername = ""
local Input = automationTab:CreateInput({
Name = "Bank Owner",
Info = "Owner of the bank", -- Speaks for itself, Remove if none.
PlaceholderText = "CoolUsername69",
Flag = "BankIndex_OwnerUsername",
SectionParent = bankIndexSection,
OnEnter = false, -- Will callback only if the user pressed ENTER while the box is focused.
RemoveTextAfterFocusLost = false,
Callback = function(Text)
BankIndex_OwnerUsername = Text
end,
})
local bankIndexInfo = automationTab:CreateParagraph({
Title = "Idling",
Content = "Not doing anything yet..."
}, bankIndexSection)
local startBankIndex = nil
function BankMessage(message)
if not startBankIndex then return end
coroutine.wrap(function()
while true do
wait()
startBankIndex:Set(nil, message)
break
end
end)()
end
function BankError(errorMessage)
pcall(function()
bankIndexInfo:Set({
Title = "Idling",
Content = "Not doing anything yet..."
})
end)
BankMessage(errorMessage)
print("Error on Bank Index: " .. errorMessage)
wait(3)
BankMessage("")
end
startBankIndex = automationTab:CreateButton({
Name = "Start Indexing",
CurrentValue = false,
Interact = "",
SectionParent = bankIndexSection,
Callback = function(Value)
if BankIndex_Debounce then return end
if not BankIndex_InProgress then
BankIndex_Debounce = true
coroutine.wrap(function()
wait(0.3)
BankIndex_Debounce = false
end)()
end
-- Start bank functions
if BankIndex_InProgress then
-- Cancel process
BankIndex_Debounce = true
BankIndex_InProgress = false
BankMessage(nil, "")
coroutine.wrap(function()
while true do
wait()
startBankIndex:Set("Waiting deposit to stop...", nil)
break
end
end)()
else
while BankIndex_InProgress do
UpdateInfo()
if not petsToWithdraw or #petsToWithdraw < 50 then
for petIdentifer, pet in pairs(petsAvailableOnBank) do
if pet and pet.uid and #petsToWithdraw < 50 then
table.insert(petsToWithdraw, pet.uid)
petsAvailableOnBank[petIdentifer] = nil
end
if #petsToWithdraw >= 50 then break end
end
end
UpdateInfo()
if petsToWithdraw and #petsToWithdraw > 0 then
bankIndexInfo:SetTitle(string.format("Withdrawing %s pets...", tostring(#petsToWithdraw)))
wait(0.5)
local oldCollectionCount = 0 + #SaveData.Collection
local expectedCollectionCount = oldCollectionCount + #petsToWithdraw
local withdrawSuccess, withdrawMessage = Library.Network.Invoke("Bank Withdraw", BankUID, petsToWithdraw, 0)
if withdrawSuccess then
UpdateInfo()
bankIndexInfo:SetTitle(string.format("Waiting for %s pets to index...", tostring(#petsToWithdraw)))
wait(5)
local cTick = tick()
repeat UpdateInfo() wait() until #SaveData.Collection > oldCollectionCount or not BankIndex_InProgress or tick() - cTick > 15
bankIndexInfo:SetTitle(string.format("Depositing %s pets...", tostring(#petsToWithdraw)))
UpdateInfo()
local depositsAttempts = 0
local function TryToDeposit()
local depositSuccess, depositMessage = Library.Network.Invoke("Bank Deposit", BankUID, petsToWithdraw, 0)
if not depositSuccess then
if depositsAttempts >= 5 then
failedToDeposit = true
return
end
depositsAttempts = depositsAttempts + 1
wait(5)
TryToDeposit()
end
end
TryToDeposit()
if failedToDeposit then
bankIndexInfo:SetTitle("Oopps... Aborting process!")
bankIndexInfo:SetContent(string.format("Damn! <b>Failed to deposit</b> after <b>5</b> attempts, <font color=\"#FF0000\">process has been canceled</font>!\nFailed to deposit: %s pets!", tostring(#petsToWithdraw)))
break
else
-- CLEAR THE WITHDRAW TABLE
petsToWithdraw = {}
end
else
print(withdrawMessage)
end
else break end
wait(10)
end
BankIndex_InProgress = false
BankIndex_Debounce = false
UpdateInfo()
coroutine.wrap(function()
while true do
wait()
startBankIndex:Set("Start Indexing", nil)
break
end
end)()
if not failedToDeposit then
bankIndexInfo:Set({
Title = "Idling",
Content = "Not doing anything yet..."
})
end
BankMessage(nil, "")
end)()
end
end
})
To embed this project on your website, copy the following code and paste it into your website's HTML: