Run it
Copy the script and paste it into your executor.
Players = :()
player = Players.LocalPlayer
RS = :()
RunService = :()
TweenService = :()
UserInputService = :()
HttpService = :()
rEvents = RS:(, )
(name)
r = rEvents rEvents:(name)
r
orbEvent = ()
questsEvent = ()
openCrystalRemote = ()
sellPetEvent = ()
sellTrailEvent = ()
equipPetEvent = ()
petEvolveEvent = ()
evolveTrailEvent = ()
rebirthEvent = ()
speedRampEvent = ()
ultimatesRemote = ()
checkChestRemote = ()
GF =
(() GF = (RS:()) )
MONO = {
bg = .(, , ),
panel = .(, , ),
panel2 = .(, , ),
border = .(, , ),
text = .(, , ),
sub = .(, , ),
accent = .(, , ),
success = .(, , ),
= .(, , ),
danger = .(, , ),
rare = .(, , ),
}
state = {
hatcher = , hatchThread = , hatchChoice = ,
hatchRate = , hatchMax = , gemReserve = ,
autoSell = , keepTop = , keepFree = ,
snipePet = , hatches = , rarity = {}, hits = {},
autoEquip = , equipThread = ,
orbFarming = , orbChoice = , orbRate = , orbAmount = ,
orbInfinite = , orbThread = ,
hoopLoop = , hoopThread = ,
quest = , questThread = ,
evolvePets = , petThread = ,
evolveTrails = , trailThread = ,
ramps = , rampThread = ,
autoRebirth = , rebirthThread = , rebirthsDone = , rebirthReserve = ,
autoUltimates = , ultimateThread = , ultimatesBought = ,
chests = , chestThread = , chestsOpened = ,
keepNames = {},
minimised = , session = {},
}
GENV =
(()
() == GENV = ()
)
INSTANCE_ID = (GENV.__LOS_AUTOFARM_ID ) +
GENV.__LOS_AUTOFARM_ID = INSTANCE_ID
() GENV.__LOS_AUTOFARM_ID == INSTANCE_ID
setStatus = ()
notify = ()
state.keepNames = {}
(fn)
co = .(()
ok, err = (fn)
ok ( .. (err))
)
ok, err = .(co)
ok ( .. (err))
co
(n)
n = (n)
s = { , , , , , , }
i =
n >= i < #s n = n / ; i = i +
i == (.(n)) .(, n, s[i])
(name)
v = player:(name)
v v:() v.Value
ls = player:()
v = ls ls:(name)
v v.Value
(v) (v)
() (player:() player.Gems.Value)
() (player:() player.level.Value)
() (())
()
c = player:()
c c.Value
crystals = {}
prices = RS:()
chances = RS:()
prices
_, c (prices:())
base = c.Name:(, )
p, t = c:(), c:()
entry = { base = base, price = (p p.Value) .huge, ptype = (t t.Value) , pool = {} }
ch = chances chances:(c.Name)
ch
_, item (ch:())
n = item:()
r = item:()
cv = item:()
n
.(entry.pool, { name = n.Value, rarity = r r.Value , chance = (cv cv.Value) })
.(entry.pool, (a, b) a.chance < b.chance )
.(crystals, entry)
.(crystals, (a, b) a.price < b.price )
(base)
base ==
base = (base):(, )
_, c (crystals)
c.base == base (c.base .. ) == base c
(c)
parts = {}
_, p (c.pool)
.(parts, .(, p.name, p.rarity, p.chance))
.(parts, )
priceOf = {}
shop = RS:()
shop
_, item (shop:())
p = item:()
r = item:()
p priceOf[item.Name]
priceOf[item.Name] = { price = p.Value, rarity = r r.Value }
orbs = {}
folder = RS:()
folder
_, m (folder:())
v = m:() m:()
v orbs[m.Name] = { stat = v.Name, base = v.Value }
()
{
pets = player:(),
trails = player:(),
}
(kind)
f = ()[kind]
rows = {}
f rows
_, tier (f:())
_, it (tier:())
rows[#rows + ] = { it = it, tier = tier.Name, name = it.Name, kind = kind }
rows
(kind)
f = ()[kind]
n =
f
_, tier (f:()) n = n + #tier:()
n
(row)
GF
lvl = row.it:()
GF.(row.tier, lvl lvl.Value , row.it:() ~= )
()
set = {}
eq = player:()
eq
_, c (eq:())
ref = c:()
ref ref.Value set[ref.Value] =
set
()
t = player:()
t t.Value
RARITY_ORDER = { Basic = , Advanced = , Rare = , Epic = , Unique = , Omega = }
sellStats = { pets = , trails = , gems = }
state.rankMode = state.rankMode
state.sellBelow = state.sellBelow
state.keepEvolved == state.keepEvolved =
state.keepDupes = state.keepDupes
state.evolveAll == state.evolveAll =
state.autoEvolve == state.autoEvolve =
(row)
p = priceOf[row.name]
p p.price
(row)
p = priceOf[row.name]
p p.rarity
(row)
state.rankMode == (row)
state.rankMode ==
(RARITY_ORDER[(row)] ) * + (row)
(row)
(row)
e = row.it:()
e ~= e.Value ==
(row)
row.kind == ()[row.it]
row.kind == () == row.it
state.keepNames[row.name]
(kind)
rows = (kind)
.(rows, (a, b)
ra, rb = (a), (b)
ra == rb (a) < (b)
ra < rb
)
rows
(kind)
rows = (kind)
keep, dupes = {}, {}
topKept =
floor = RARITY_ORDER[state.sellBelow]
i = #rows, , -
row = rows[i]
protected = (row)
evo = (row)
belowFloor = (RARITY_ORDER[(row)] ) < floor
protected (state.keepEvolved evo)
keep[row.it] =
belowFloor
state.keepNames[row.name]
dupes[row.name] = dupes[row.name]
dupes[row.name] < state.keepDupes
dupes[row.name] = dupes[row.name] +
keep[row.it] =
topKept < state.keepTop
topKept = topKept +
keep[row.it] =
keep
(kind)
keep = (kind)
_, row ((kind))
keep[row.it] row
(kind, n)
keep = (kind)
out = {}
_, row ((kind))
keep[row.it]
.(out, .(, row.name, (row), (row)))
#out >= (n )
out
(row)
row.kind ==
sellPetEvent sellPetEvent:(, row.it)
sellStats.pets = sellStats.pets +
sellTrailEvent sellTrailEvent:(, row.it)
sellStats.trails = sellStats.trails +
(kind)
row = (kind)
row
(row)
row
(row)
state.autoSell row
keep = (row.kind)
keep[row.it]
g0 = ()
(row)
sellStats.gems = sellStats.gems + .(() - g0, )
(need)
need = need state.keepFree
freed =
capNow = ()
_ = ,
capNow - () >= need
()
freed = freed +
.()
_ = ,
capNow - () >= need
()
freed = freed +
.()
freed
evolveStats = { pets = , trails = , last = {} }
(kind)
counts = {}
_, row ((kind))
(row)
counts[row.name] = (counts[row.name] ) +
counts
(kind, onlyKeepList)
counts = (kind)
done = {}
names = {}
name, n (counts)
n >= .(names, name)
.(names)
_, name (names)
state.evolveAll onlyKeepList state.keepNames[name]
kind ==
petEvolveEvent petEvolveEvent:(, name)
evolveStats.pets = evolveStats.pets +
_, row (())
row.name == name (row)
evolveTrailEvent evolveTrailEvent:(, row.it)
evolveStats.trails = evolveStats.trails +
evolveStats.last[kind .. .. name] = (evolveStats.last[kind .. .. name] ) +
.(done, name)
.()
done
()
a = ()
b = ()
a, b
()
(state.autoEvolve state.evolvePets state.evolveTrails) ()
fired = {}
state.autoEvolve state.evolvePets
_, n (()) .(fired, .. n)
state.autoEvolve state.evolveTrails
_, n (()) .(fired, .. n)
#fired >
( .. .(fired, ), MONO.rare)
( .. #fired .. , )
ready = {}
kind, label ({ pets = , trails = })
best, bestName = ,
name, n ((kind))
n > best n >= best, bestName = n, name
bestName
ready[#ready + ] = .(, label, bestName, best)
(#ready > ( .. .(ready, )) , MONO.sub)
.()
state.autoEvolve, state.evolvePets, state.evolveTrails = , ,
state.evolveThread =
equipStats = { equipped = , unequipped = }
()
t =
rows = ()
_, r (rows) t = t + (r)
t
()
eq = player:()
eq
slots = #eq:()
slots == slots =
rows = ()
#rows ==
.(rows, (a, b)
ra, rb = (a), (b)
ra == rb (a) > (b)
ra > rb
)
have = ()
actions =
wanted = .(slots, #rows)
i = , wanted
row = rows[i]
have[row.it]
occupied =
_ (eq:()) occupied = occupied +
occupied >= slots
worst
_, c (eq:())
ref = c:()
ref ref.Value
rk = priceOf[ref.Value.Name] priceOf[ref.Value.Name].price
worst rk < worst.rank worst = { ref = ref, rank = rk }
worst worst.rank < (row) equipPetEvent
equipPetEvent:(, worst.ref.Value)
equipStats.unequipped = equipStats.unequipped +
.()
equipPetEvent
equipPetEvent:(, row.it)
equipStats.equipped = equipStats.equipped +
actions = actions +
.()
actions
()
state.autoEquip ()
n = ()
(n > ( .. n .. ) , MONO.accent)
.()
state.autoEquip =
state.equipThread =
hatchStats = { attempts = , pets = , trails = , gems = , failed = }
(base)
c = (base)
c c
crystals[#crystals]
()
i = #crystals, , -
c = crystals[i]
c.ptype == () - c.price >= state.gemReserve c.base
(base, petName)
c = (base)
c
_, p (c.pool)
p.name == petName
chance = .(p.chance, )
{ chance = p.chance, rarity = p.rarity,
expected = .( / chance),
cost = .( / chance) * c.price }
()
base = state.hatchChoice
base ==
base = ()
base ,
c = (base)
c , .. (base)
c.ptype == () - c.price < state.gemReserve
, .. (state.gemReserve) ..
state.autoSell (state.keepFree)
() - () < () - () <
,
beforePets, beforeTrails = {}, {}
_, r (()) beforePets[r.it] =
_, r (()) beforeTrails[r.it] =
g0 = ()
name, rarity = openCrystalRemote:(, c.base .. )
hatchStats.attempts = hatchStats.attempts +
hatchStats.gems = hatchStats.gems + (g0 - ())
state.hatches = state.hatches +
name ==
hatchStats.failed = hatchStats.failed +
,
state.rarity[rarity ] = (state.rarity[rarity ] ) +
got
_, r (())
beforePets[r.it] got = r
got
hatchStats.pets = hatchStats.pets +
got.kind =
_, r (())
beforeTrails[r.it] got = r
got hatchStats.trails = hatchStats.trails +
state.snipePet ~= name == state.snipePet
state.hits[state.snipePet] = (state.hits[state.snipePet] ) +
((state.snipePet .. .. (c.price) .. ), )
state.autoSell got (got)
, , name, rarity, c.base
()
carry, shownRate = , .(state.hatchRate, )
lastReport, statusAcc = ,
started = .()
state.hatcher ()
dt = RunService.Heartbeat:()
shownRate = .(state.hatchRate, )
carry = .(carry + shownRate * dt, )
budget = .(carry)
carry = carry - budget
stopReason =
_ = , budget
state.hatcher
state.hatchMax > hatchStats.attempts >= state.hatchMax
stopReason = .. state.hatchMax ..
state.hatcher =
ok, err, name = ()
ok
err err:()
.()
err ==
stopReason =
state.hatcher =
err (err:() err:())
stopReason = err
state.hatcher =
statusAcc = statusAcc +
statusAcc >= .() - lastReport >
statusAcc, lastReport = , .()
rar = {}
k, v ({ , , , , , })
state.rarity[v] .(rar, v .. .. state.rarity[v])
(.(, state.hatchChoice,
state.hatches, shownRate, .(rar, )), MONO.success)
stopReason
( .. stopReason, MONO.warn)
state.hatcher =
state.hatchThread =
dt = .(.() - started, )
(.(,
hatchStats.attempts, dt, hatchStats.attempts / dt, (hatchStats.gems)), MONO.warn)
(choice)
choice = choice state.hatchChoice
choice ~=
c = (choice)
c choice = c.base
state.hatcher state.hatchChoice == choice
state.hatcher =
(, MONO.sub)
state.hatchChoice = choice
state.hatcher =
state.hatchThread
state.hatchThread = (hatchLoop)
()
name = player:()
name = name name.Value
f = :()
f f:(name) name
f
_, c (f:())
#c:() > c.Name
name
ORB_BURST_CAP =
()
fired =
map = ()
names = {}
name (orbs) .(names, name)
#names == names = { }
.(names)
()
state.orbChoice == names[(fired % #names) + ]
state.orbChoice names[]
carry, sinceStatus = ,
state.orbFarming ()
dt = RunService.Heartbeat:()
carry = .(carry + .(state.orbRate, ) * dt, ORB_BURST_CAP)
budget = .(carry)
carry = carry - budget
budget >=
_ = , budget
orbEvent orbEvent:(, (), map)
fired = fired +
state.orbInfinite fired >= state.orbAmount
sinceStatus = sinceStatus + dt
sinceStatus >
sinceStatus =
(.(, (), fired, state.orbRate,
state.orbInfinite (fired .. .. state.orbAmount)), MONO.success)
state.orbInfinite fired >= state.orbAmount
state.orbFarming =
state.orbThread =
( .. fired .. , MONO.warn)
(choice)
state.orbFarming state.orbChoice == choice
state.orbFarming =
(, MONO.sub)
state.orbFarming =
state.orbChoice = choice
state.orbThread state.orbThread = (orbLoop)
()
ch = player.Character
ch ch:()
()
home = {}
passes =
state.hoopLoop ()
root = ()
root .()
folder = :()
list = {}
folder
_, h (folder:())
h:()
home[h] home[h] = h.CFrame
.(list, h)
#list == .()
before = ()
anchor = root.Position
_, h (list) h.CFrame = .(anchor + .(, , ))
.()
_, h (list)
o = home[h]
o h.CFrame = o
passes = passes +
(.(,
() - before, passes), MONO.success)
.()
h, o (home) (() h.CFrame = o )
state.hoopLoop =
state.hoopThread =
(, MONO.warn)
()
collected =
qroot = player:()
qroot
_, folderName ({ , , , })
folder = qroot:(folderName)
folder
_, q (folder:())
q:()
reqs = q:()
reqs #reqs:() >
done =
_, r (reqs:())
r:()
p = r:()
p p.Value < r.Value done =
done questsEvent
questsEvent:(, q)
collected = collected +
state.session.quests = (state.session.quests ) +
.()
collected
()
state.quest ()
n = ()
(n > ( .. n .. ) ,
n > MONO.success MONO.sub)
.()
state.quest =
state.questThread =
()
ramps = :()
index, tries = ,
state.ramps ()
ramps #ramps:() ==
(, MONO.danger)
.()
list = ramps:()
model = list[((index - ) % #list) + ]
index = index +
touch
_, d (model:())
d:() d.Name == touch = d
root = ()
touch root
root.CFrame = .(touch.Position + .(, , ))
() ==
(() (root, touch, ) )
.()
(() (root, touch, ) )
speedRampEvent speedRampEvent:()
tries = tries +
( .. tries .. , MONO.warn)
.()
state.ramps =
state.rampThread =
()
GF
ok, res = (() GF.((), player) )
ok res
()
state.autoRebirth ()
req = ()
req () >= req
rebirthEvent rebirthEvent:()
state.rebirthsDone = state.rebirthsDone +
(.(,
state.rebirthsDone, (), req), MONO.rare)
.()
(.(,
(), req -, ()), MONO.sub)
.()
state.autoRebirth =
state.rebirthThread =
ULTIMATE_PRIORITY = {
, , , , ,
, , , ,
, , ,
}
(name)
owned = player:() player.ultimatesFolder:(name)
def = RS:() RS.gameUltimatesFolder:(name)
have = owned owned.Value
maxUp = def def:()
cost =
GF def
ok, res = (() GF.(def, have) )
ok cost = res
have, maxUp maxUp.Value , cost
()
state.autoUltimates ()
bought =
_, name (ULTIMATE_PRIORITY)
state.autoUltimates
have, maxUp, cost = (name)
cost have < maxUp () >= cost + state.rebirthReserve
ok, res = (() ultimatesRemote:(, name) )
ok res ==
state.ultimatesBought = state.ultimatesBought +
bought = bought +
(.(,
name, have + , maxUp, cost), MONO.rare)
.()
( .. name, MONO.warn)
.()
bought ==
(.(,
(), state.rebirthReserve), MONO.sub)
.()
state.autoUltimates =
state.ultimateThread =
CHESTS = {
{ label = , model = },
{ label = , model = },
{ label = , model = },
{ label = , model = },
}
()
state.chests ()
got =
_, chest (CHESTS)
state.chests
model = :(chest.model)
inner = model model:(, )
inner ()
().CFrame = .(inner.Position + .(, , ))
.()
ok, res, currency, amount = (() checkChestRemote:(chest.label) )
ok res ==
state.chestsOpened = state.chestsOpened +
got = got +
(.(, chest.label, (amount ), (currency)), MONO.rare)
.()
got ==
(, MONO.sub)
.()
state.chests =
state.chestThread =
UAI_URL =
libOk, UI = (()
(:(UAI_URL))()
)
libOk (UI) ~= (UI.CreateWindow) ~=
( .. UAI_URL)
window = UI:({
Id = ,
Title = ,
Subtitle = ,
GameName = ,
Width = ,
Height = ,
})
U = {}
(colour)
colour ==
colour == MONO.success
colour == MONO.warn
colour == MONO.danger
setStatus = (text, colour)
text = (text )
U.tone = (colour)
U.status U.status:(text)
U.badge U.badge:(U.tone)
notify = (text, tone)
kind =
tone == kind =
tone == kind =
tone == kind =
window:({
Title = ,
Content = (text ),
Kind = kind,
Duration = ,
})
(kind)
n =
_, r ((kind)) n = n +
n
state.session = {
t = .(),
steps = (), gems = (), exp = (),
hoops = (), level = (), rebirths = (),
pets = (), trails = (), hatches = ,
}
()
s = state.session
dt = .(.() - s.t, )
m = dt /
best =
name, count (state.hits)
best = name .. .. count
.(
,
(()), ((() - s.steps) / m),
(()), ((() - s.gems) / m),
(), (), (), (), (), (),
hatchStats.attempts, hatchStats.attempts / m, (hatchStats.gems),
sellStats.pets, sellStats.trails, best ~= ( .. best) )
(on, choice)
choice = choice state.hatchChoice
on
state.hatcher state.hatchChoice ~= choice
(choice)
state.hatcher
(choice)
state.hatcher
(state.hatchChoice)
state.hatchChoice = choice
(on, choice)
choice = choice state.orbChoice
on
(state.orbFarming state.orbChoice == choice)
(choice)
state.orbFarming
(state.orbChoice)
()
state.autoEvolve
state.evolvePets, state.evolveTrails = ,
(state.autoEvolve state.evolvePets state.evolveTrails) state.evolveThread
state.evolveThread = (evolveLoop)
()
state.autoEquip state.equipThread
state.equipThread = (equipLoop)
SIMPLE_LOOPS = {
{ , , , hoopLoop },
{ , , , questLoop },
{ , , , rampLoop },
{ , , , rebirthLoop },
{ , , , ultimateLoop },
{ , , , chestLoop },
}
(flagKey, threadKey, fn, on)
state[flagKey] = on
state[flagKey] state[threadKey]
state[threadKey] = (fn)
()
U.hatchRun
ok, err = (()
U.hatchRun:(state.hatcher , )
U.crystal:(state.hatchChoice, )
U.orbRun:(state.orbFarming , )
U.orbChoice:(state.orbChoice , )
U.orbAmount:(state.orbInfinite)
U.hoop:(state.hoopLoop , )
U.quest:(state.quest , )
U.equipSet:(state.autoEquip , )
U.evolveAll:(state.autoEvolve , )
U.evolvePets:(state.evolvePets state.autoEvolve , )
U.evolveTrails:(state.evolveTrails state.autoEvolve , )
_, L (SIMPLE_LOOPS)
U[L[]] U[L[]]:(state[L[]] , )
U.keepName
names = {}
name (state.keepNames) .(names, name)
.(names)
mirror = .(names, )
shown = (U.keepName:() )
shown == shown == (U.keepMirror )
U.keepMirror = mirror
U.keepName:(mirror, )
)
ok U.syncWarned
U.syncWarned =
( .. (err))
()
U.hatchRun
state.autoSell = U.autoSell:()
state.rankMode = U.rankMode:()
state.keepTop = U.keepTop:()
state.keepDupes = U.keepDupes:()
state.keepFree = U.keepFree:()
state.keepEvolved = U.keepEvolved:()
state.evolveAll = U.evolveOnlyKept:()
floor = U.floor:()
state.sellBelow = (floor == floor == ) floor
state.hatchRate = U.hatchRate:()
state.gemReserve = U.gemReserve:()
state.hatchMax = U.hatchMax:()
state.orbRate = U.orbRate:()
state.orbAmount = U.orbAmount:()
state.orbInfinite = U.orbInfinite:()
state.rebirthReserve = U.rebirthReserve:()
(U.hatchRun:() , U.crystal:())
(U.orbRun:() , U.orbChoice:())
U.orbAmount:(state.orbInfinite)
_, L (SIMPLE_LOOPS)
U[L[]] (L[], L[], L[], U[L[]]:())
state.autoEvolve = U.evolveAll:()
state.evolvePets = U.evolvePets:()
state.evolveTrails = U.evolveTrails:()
state.autoEvolve
U.evolvePets:() state.evolvePets =
U.evolveTrails:() state.evolveTrails =
()
state.autoEquip = U.equipSet:()
()
()
hatchTab = window:({ Id = , Title = })
crystalOptions = { { Label = , Value = } }
_, c (crystals)
.(crystalOptions, {
Label = .(, c.base, (c.price), c.ptype),
Value = c.base,
})
hSec = hatchTab:({
Title = ,
Description = ,
})
U.crystal = hSec:({
Id = ,
Text = ,
Options = crystalOptions,
Default = state.hatchChoice,
Searchable = ,
Placeholder = ,
Callback = (value)
state.hatchChoice = value
state.hatcher (, value)
,
})
U.hatchRun = hSec:({
Id = ,
Text = ,
Default = state.hatcher,
Description = ,
Callback = (on) (on ) ,
})
U.hatchRate = hSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.hatchRate,
Callback = (v) state.hatchRate = v ,
})
U.gemReserve = hSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.gemReserve,
Suffix = ,
Description = ,
Callback = (v) state.gemReserve = v ,
})
U.hatchMax = hSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.hatchMax,
Callback = (v) state.hatchMax = v ,
})
U.snipe = hSec:({
Id = ,
Text = ,
Default = state.snipePet ,
Placeholder = ,
Description = ,
})
(value)
value = (value )
state.snipePet = value
value ==
(, )
base = state.hatchChoice ~= state.hatchChoice
odds = (base, value)
odds
(.(,
value, odds.rarity, odds.chance, odds.expected, (odds.cost)), )
( .. value, )
(U.snipe.OnCommit) ==
U.snipe:(snipeCommit)
U.snipe:(snipeCommit)
dropSec = hatchTab:({
Title = ,
Description = ,
Collapsible = ,
Collapsed = ,
})
lines = {}
_, c (crystals)
#c.pool > .(lines, c.base .. .. (c))
dropSec:({ Text = .(lines, ) })
orbTab = window:({ Id = , Title = })
oSec = orbTab:({
Title = ,
Description = ,
})
orbOptions = { { Label = , Value = } }
names = {}
name (orbs) .(names, name)
.(names)
_, name (names)
.(orbOptions, {
Label = .(, name, orbs[name].stat),
Value = name,
})
U.orbChoice = oSec:({
Id = ,
Text = ,
Options = orbOptions,
Default = state.orbChoice ,
Searchable = ,
Callback = (value)
state.orbChoice = value
state.orbFarming (, value)
,
})
U.orbRun = oSec:({
Id = ,
Text = ,
Default = state.orbFarming,
Callback = (on) (on ) ,
})
U.orbRate = oSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.orbRate,
Callback = (v) state.orbRate = v ,
})
U.orbAmount = oSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.orbAmount,
Disabled = state.orbInfinite,
Callback = (v) state.orbAmount = v ,
})
U.orbInfinite = oSec:({
Id = ,
Text = ,
Default = state.orbInfinite,
Description = ,
Callback = (on)
state.orbInfinite = on
U.orbAmount:(on)
,
})
oSec:({
Text = ,
})
petTab = window:({ Id = , Title = })
sSec = petTab:({
Title = ,
Description = ,
})
U.autoSell = sSec:({
Id = ,
Text = ,
Default = state.autoSell,
Callback = (v) state.autoSell = v ,
})
U.rankMode = sSec:({
Id = ,
Text = ,
Options = { , , },
Default = state.rankMode,
Callback = (v)
state.rankMode = v
( .. v, )
,
})
U.keepTop = sSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.keepTop,
Callback = (v) state.keepTop = v ,
})
U.keepDupes = sSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.keepDupes,
Callback = (v) state.keepDupes = v ,
})
U.keepFree = sSec:({
Id = ,
Text = ,
Min = , Max = , Step = ,
Default = state.keepFree,
Callback = (v) state.keepFree = v ,
})
U.keepEvolved = sSec:({
Id = ,
Text = ,
Default = state.keepEvolved,
Callback = (v) state.keepEvolved = v ,
})
U.evolveOnlyKept = sSec:({
Id = ,
Text = ,
Default = state.evolveAll,
Callback = (v)
state.evolveAll = v
()
,
})
U.floor = sSec:({
Id = ,
Text = ,
Options = {
{ Label = , Value = },
{ Label = , Value = },
{ Label = , Value = },
{ Label = , Value = },
{ Label = , Value = },
{ Label = , Value = },
},
Default = (RARITY_ORDER[state.sellBelow] ) <= state.sellBelow,
Callback = (v)
state.sellBelow = v == v
(v == ( .. v .. ), )
,
})
U.keepName = sSec:({
Id = ,
Text = ,
Placeholder = ,
Description = ,
})
sSec:({
Id = ,
Text = ,
Callback = ()
text = (U.keepName:() )
text = text:(, ):(, )
text ==
state.keepNames = {}
(, )
state.keepNames[text] =
( .. text, )
U.keepName:(, )
,
})
sSec:({
Id = ,
Text = "Sell junk now",
Description = "Frees up to 30 slots per kind using the policy above.",
Callback = function()
local freed = 0
for _ = 1, 30 do
local f = ensureRoom(state.keepFree)
freed = freed + f
if f == 0 then break end
end
notify(freed > 0 and ("freed " .. freed .. " slots") or "nothing sellable",
freed > 0 and "good" or "warn")
end,
})
sSec:Button({
Id = "sell-preset-rare",
Text = "Apply preset: rare-pet farm",
Style = "Primary",
Description = "Hatch Jungle, keep Swift Samurai, 5 duplicates, dump everything below Unique.",
Callback = function()
state.keepTop = 0
state.keepDupes = 5
state.keepEvolved = true
state.sellBelow = "Unique"
state.keepNames["Swift Samurai"] = true
state.snipePet = "Swift Samurai"
state.hatchChoice = "Jungle"
state.rankMode = "MARKET"
state.autoEvolve = true
state.evolvePets, state.evolveTrails = true, true
evolveApply()
U.keepTop:Set(0, true)
U.keepDupes:Set(5, true)
U.keepEvolved:Set(true, true)
U.floor:Set("Unique", true)
U.rankMode:Set("MARKET", true)
U.evolveOnlyKept:Set(false, true)
U.snipe:Set("Swift Samurai", true)
U.crystal:Set("Jungle", true)
if state.hatcher then hatchSet(true, "Jungle") end
notify("preset: keep+evolve Swift Samurai, dump everything below Unique", "good")
setStatus("Preset applied: hatch Jungle, keep Swift Samurai, auto-evolve on", MONO.rare)
syncControls()
end,
})
local lSec = petTab:Section({ Title = "Live policy state" })
U.sellPreview = lSec:Label({ Id = "live-sellpreview", Text = "next to sell: ..." })
U.evolveWatch = lSec:Label({ Id = "live-evolvewatch", Text = "evolve watch: ..." })
U.keepList = lSec:Label({ Id = "live-keeplist", Text = "keep list: none" })
-- ============ AUTO EVOLVE ============
local eSec = petTab:Section({
Title = "Auto evolve",
Description = "Five non-evolved copies of the same name become one evolved copy: the server consumes four and leaves one marked evolved.",
})
U.evolveAll = eSec:Toggle({
Id = "evolve-all",
Text = "Auto evolve everything",
Default = state.autoEvolve,
Callback = function(on)
state.autoEvolve = on
if on then
state.evolvePets, state.evolveTrails = true, true
else
state.evolvePets, state.evolveTrails = false, false
end
evolveApply()
syncControls()
end,
})
U.evolvePets = eSec:Toggle({
Id = "evolve-pets",
Text = "Auto evolve pets only",
Default = state.evolvePets and not state.autoEvolve,
Callback = function(on)
state.evolvePets = on
evolveApply()
end,
})
U.evolveTrails = eSec:Toggle({
Id = "evolve-trails",
Text = "Auto evolve trails only",
Default = state.evolveTrails and not state.autoEvolve,
Callback = function(on)
state.evolveTrails = on
evolveApply()
end,
})
eSec:Button({
Id = "evolve-now",
Text = "Evolve everything ready now",
Callback = function()
local a, b = evolveNow()
notify(string.format("evolved %d pet name(s), %d trail name(s)", #a, #b),
(#a + #b) > 0 and "good" or "warn")
end,
})
eSec:Paragraph({
Title = "Evolve remotes",
Content = 'petEvolveEvent:FireServer("evolvePet", name) and evolveTrailEvent:FireServer("evolveTrail", instance). Evolution needs five copies of the same name, so the sell policy keeps duplicates of kept names.',
})
-- ============ AUTO EQUIP ============
local qSec = petTab:Section({ Title = "Auto equip" })
U.equipSet = qSec:Toggle({
Id = "equip-auto",
Text = "Auto-equip best pets",
Default = state.autoEquip,
Description = "Fills every empty pet slot with the best pet available.",
Callback = function(on)
state.autoEquip = on
equipApply()
end,
})
qSec:Button({
Id = "equip-now",
Text = "Equip best now",
Callback = function()
local n = autoEquipStep()
notify(n > 0 and ("equipped " .. n .. " pets") or "already optimal",
n > 0 and "good" or "info")
end,
})
qSec:Label({
Text = "Equipping needs a free slot: v5 unequips the weakest equipped pet first, then equips. Equipped pets can never be sold by the sell engine.",
})
-- ============ TAB: WORLD LOOPS ============
local worldTab = window:Tab({ Id = "world", Title = "Loops" })
local TEXTURES = {
hoop = { Title = "Hoop farm", Text = "Hoop loop (35 hoops per pass, 8.6s cycle)",
Description = "Hoops pay out on a per-hoop debounce." },
quest = { Title = "Quests", Text = "Collect completed quests",
Description = "Collects anything the quest remote accepts as complete." },
rebirth = { Title = "Rebirth", Text = "Auto rebirth when level is enough",
Description = 'rebirthEvent:FireServer("rebirthRequest") once level >= calculateRequiredRebirthLevel(rebirths, player).' },
ultimates = { Title = "Ultimate upgrades", Text = "Auto-buy ultimates",
Description = 'ultimatesRemote:InvokeServer("upgradeUltimate", name). Costs rebirths, so it is ordered by payoff: Step Booster, Gem Booster, Ethereal Orbs, Demon Hoops, Infernal Gems, slots, chests, quests, trails, Divine Rebirth, spins.' },
chests = { Title = "Chests", Text = "Open golden / enchanted / magma / jungle chests",
Description = 'checkChestRemote:InvokeServer("Golden Chest") and friends. Each has its own 6 hour cooldown.' },
ramps = { Title = "Speed ramps", Text = "Touch speed ramps",
Description = "Unverified ramp loop, kept from v4." },
}
for _, L in ipairs(SIMPLE_LOOPS) do
local meta = TEXTURES[L[1]]
local sec = worldTab:Section({ Title = meta.Title, Description = meta.Description })
U[L[1]] = sec:Toggle({
Id = "loop-" .. L[1],
Text = meta.Text,
Default = state[L[2]],
Callback = function(on)
simpleApply(L[2], L[3], L[4], on and true or false)
end,
})
if L[1] == "rebirth" then
U.rebirthReserve = sec:Slider({
Id = "rebirth-reserve",
Text = "Keep N rebirths spare",
Min = 0, Max = 20, Step = 1,
Default = state.rebirthReserve,
Description = "Stops spending rebirths when the live count is at or under this.",
Callback = function(v) state.rebirthReserve = v end,
})
end
end
-- ============ TAB: STATUS ============
local statusTab = window:Tab({ Id = "status", Title = "Status" })
local stSec = statusTab:Section({ Title = "Live status" })
U.badge = stSec:Badge({ Id = "status-tone", Default = "Info", Kind = "Secondary" })
U.status = stSec:Label({ Id = "status-text", Text = "Idle" })
local ssSec = statusTab:Section({ Title = "Session" })
U.session = ssSec:Label({ Id = "session-text", Text = sessionText() })
U.petBar = ssSec:Progress({ Id = "cap-pets", Text = "Pet capacity", Min = 0, Max = 100, Default = 0 })
U.petCap = ssSec:Label({ Id = "cap-pets-text", Text = "pets 0/0" })
U.trailBar = ssSec:Progress({ Id = "cap-trails", Text = "Trail capacity", Min = 0, Max = 100, Default = 0 })
U.trailCap = ssSec:Label({ Id = "cap-trails-text", Text = "trails 0/0" })
local ctlSec = statusTab:Section({ Title = "Controls" })
ctlSec:Button({
Id = "stop-all",
Text = "Stop all loops",
Style = "Danger",
Description = "Stops every farm loop and leaves the window open.",
Callback = function()
state.orbFarming, state.hoopLoop, state.hatcher, state.quest = false, false, false, false
state.evolvePets, state.evolveTrails, state.ramps = false, false, false
state.autoRebirth, state.autoUltimates, state.chests, state.autoEquip = false, false, false, false
state.autoEvolve = false
syncControls()
notify("all loops stopping", "warn")
end,
})
ctlSec:Keybind({
Id = "hotkey-hatch",
Text = "Hatch hotkey",
Default = Enum.KeyCode.H,
Mode = "Toggle",
Callback = function(active)
hatchSet(active and true or false)
syncControls()
end,
})
-- ============ CONFIGURATION ============
local cfgSec = statusTab:Section({
Title = "Configuration",
Description = "Named profiles are stored under ProjectUAI/UI/ by the library. The profile called \"default\" is restored silently when the script starts; everything else is explicit.",
})
U.profile = cfgSec:Input({
Id = "cfg-profile",
Text = "Profile name",
Default = "default",
MaxLength = 48,
Persist = false,
})
U.json = cfgSec:Input({
Id = "cfg-json",
Text = "Configuration JSON",
MultiLine = true,
Lines = 4,
MaxLength = 262144,
Placeholder = "Export fills this field; Import reads it back.",
Persist = false,
})
cfgSec:Button({
Id = "cfg-save",
Text = "Save profile",
ActionText = "Saving",
Style = "Primary",
Callback = function()
local ok, info = window:SaveConfig(U.profile:Get())
if ok then
notify("saved " .. tostring(info), "good")
else
notify("save failed: " .. tostring(info), "bad")
end
end,
})
cfgSec:Button({
Id = "cfg-load",
Text = "Load profile",
ActionText = "Loading",
Description = "Loads the profile into the controls and applies it to the running loops.",
Callback = function()
local ok, info = window:LoadConfig(U.profile:Get(), { Silent = true })
if ok == false then
notify("load failed: " .. tostring(info), "bad")
return
end
applyControls()
notify("profile applied", "good")
end,
})
cfgSec:Button({
Id = "cfg-export",
Text = "Export to field",
Callback = function()
U.json:Set(window:ExportConfig(), true)
notify("configuration exported", "info")
end,
})
cfgSec:Button({
Id = "cfg-copy",
Text = "Copy JSON to clipboard",
Callback = function()
local json = window:ExportConfig()
U.json:Set(json, true)
if type(setclipboard) == "function" then
pcall(setclipboard, json)
notify("configuration copied to clipboard", "good")
else
notify("clipboard unavailable; use the field below", "warn")
end
end,
})
cfgSec:Button({
Id = "cfg-import",
Text = "Import from field",
Callback = function()
local text = tostring(U.json:Get() or "")
if text == "" then
notify("nothing to import", "warn")
return
end
local ok, info = window:ImportConfig(text, { Silent = true })
if ok then
applyControls()
notify("imported " .. tostring(info) .. " value(s)", "good")
else
notify("import failed: " .. tostring(info), "bad")
end
end,
})
cfgSec:Button({
Id = "cfg-reset",
Text = "Reset controls to session defaults",
Style = "Danger",
Callback = function()
window:Confirm({
Title = "Reset controls?",
Content = "Every control returns to the value it had when this window was created, then the running loops are re-applied.",
ConfirmText = "Reset",
Danger = true,
Callback = function()
for _, control in pairs(U) do
if type(control) == "table" and type(control.Get) == "function"
and type(control.Reset) == "function" then
pcall(function() control:Reset(true) end)
end
end
applyControls()
notify("controls reset", "info")
end,
})
end,
})
-- keep list: the field is a command box, and it mirrors the live list whenever
-- it is empty or already showing the mirror, so a saved profile keeps the names
local function keepNameCommit(value)
for part in tostring(value or ""):gmatch("[^,]+") do
local name = part:gsub("^%s+", ""):gsub("%s+$", "")
if name ~= "" then state.keepNames[name] = true end
end
end
if type(U.keepName.OnCommit) == "function" then
U.keepName:OnCommit(keepNameCommit)
else
U.keepName:OnChanged(keepNameCommit)
end
-- ============ WINDOW CLEANUP ============
local function stopEverything()
state.orbFarming, state.hoopLoop, state.hatcher, state.quest = false, false, false, false
state.evolvePets, state.evolveTrails, state.ramps = false, false, false
state.autoRebirth, state.autoUltimates, state.chests, state.autoEquip = false, false, false, false
state.autoEvolve = false
end
window:OnDestroy(function()
stopEverything()
for _, key in ipairs({ "orbThread", "hoopThread", "hatchThread", "questThread", "petThread",
"trailThread", "evolveThread", "rampThread", "rebirthThread", "ultimateThread",
"chestThread", "equipThread" }) do
state[key] = nil
end
end)
-- ============ RESTORE SAVED PROFILE ============
do
local restored = false
pcall(function()
local r1, r2 = window:LoadConfig("default", { Silent = true })
if r1 == false then
notify("saved profile not restored: " .. tostring(r2), "warn")
else
restored = r1 ~= nil or r2 ~= nil
end
end)
if restored then applyControls() end
end
-- ============ PROGRAMMATIC CONTROL (drives the ;los IY plugin) ============
GENV.__LOS_AUTOFARM = {
instance = INSTANCE_ID,
state = state,
crystals = crystals,
prices = priceOf,
stats = { hatch = hatchStats, sell = sellStats, equip = equipStats },
orbFarm = function(choice)
if choice == nil then state.orbFarming = false return end
toggleOrb(choice)
end,
hatch = function(choice)
if choice == nil then state.hatcher = false return end
toggleHatch(choice)
end,
hoop = function(on)
if on and not state.hoopLoop then state.hoopLoop = true
if not state.hoopThread then state.hoopThread = spawnLoop(hoopLoop) end
elseif not on then state.hoopLoop = false end
end,
quests = function(on)
if on and not state.quest then state.quest = true
if not state.questThread then state.questThread = spawnLoop(questLoop) end
elseif not on then state.quest = false end
end,
evolve = function(which, on)
if which == "all" then
state.autoEvolve = on ~= false
if state.autoEvolve then
state.evolvePets, state.evolveTrails = true, true
if not state.evolveThread then state.evolveThread = spawnLoop(evolveLoop) end
else
state.evolvePets, state.evolveTrails = false, false
end
elseif which == "pets" then
state.evolvePets = on ~= false
if state.evolvePets and not state.evolveThread then state.evolveThread = spawnLoop(evolveLoop) end
elseif which == "trails" then
state.evolveTrails = on ~= false
if state.evolveTrails and not state.evolveThread then state.evolveThread = spawnLoop(evolveLoop) end
end
end,
evolveNow = evolveNow,
evolveReady = function()
local out = {}
for _, kind in ipairs({ "pets", "trails" }) do
for name, n in pairs(evolveCounts(kind)) do
if n >= 2 then table.insert(out, string.format("%s %s %d/5", kind, name, n)) end
end
end
table.sort(out)
return out
end,
sellPreview = function(kind, n) return sellPreview(kind or "pets", n or 5) end,
rank = function(mode)
if mode then state.rankMode = mode end
return state.rankMode
end,
sellFloor = function(r)
if r then state.sellBelow = r end
return state.sellBelow
end,
keepDupes = function(n)
if n then state.keepDupes = n end
return state.keepDupes
end,
ramps = function(on)
if on and not state.ramps then state.ramps = true
if not state.rampThread then state.rampThread = spawnLoop(rampLoop) end
elseif not on then state.ramps = false end
end,
sellJunk = function(n)
local freed = 0
for _ = 1, n or 20 do
local f = ensureRoom(state.keepFree)
freed = freed + f
if f == 0 then break end
end
return freed
end,
sellAll = function()
local n = 0
state.keepTop, state.keepDupes = 0, 0
for _ = 1, 80 do
if not sellLowest("pets") then break end
n = n + 1
task.wait(0.1)
end
for _ = 1, 80 do
if not sellLowest("trails") then break end
n = n + 1
task.wait(0.1)
end
return n
end,
autoEquip = function(on)
state.autoEquip = on and true or false
if state.autoEquip and not state.equipThread then state.equipThread = spawnLoop(equipLoop) end
end,
equipNow = function() return autoEquipStep() end,
rebirth = function(on)
state.autoRebirth = on and true or false
if state.autoRebirth and not state.rebirthThread then state.rebirthThread = spawnLoop(rebirthLoop) end
end,
ultimates = function(on)
state.autoUltimates = on and true or false
if state.autoUltimates and not state.ultimateThread then state.ultimateThread = spawnLoop(ultimateLoop) end
end,
chests = function(on)
state.chests = on and true or false
if state.chests and not state.chestThread then state.chestThread = spawnLoop(chestLoop) end
end,
snipe = function(petName, crystal)
state.snipePet = petName or ""
if crystal then
local c = crystalByName(crystal)
state.hatchChoice = c and c.base or crystal
end
if state.snipePet ~= "" then toggleHatch(state.hatchChoice) end
local base = crystalByName(state.hatchChoice) and crystalByName(state.hatchChoice).base or "Jungle"
return oddsFor(base, state.snipePet)
end,
keep = function(petName, on)
if petName == nil then return state.keepNames end
state.keepNames[petName] = on ~= false or nil
return state.keepNames
end,
oneHatch = function(crystal)
local saved = state.hatchChoice
if crystal then state.hatchChoice = crystal end
local ok, err, name, rarity = hatchOnce()
state.hatchChoice = saved
return ok, err, name, rarity
end,
collectQuests = collectQuests,
stopAll = function()
state.orbFarming, state.hoopLoop, state.hatcher, state.quest = false, false, false, false
state.evolvePets, state.evolveTrails, state.ramps = false, false, false
state.autoRebirth, state.autoUltimates, state.chests, state.autoEquip = false, false, false, false
state.autoEvolve = false
end,
}
-- ============ REFRESH LOOP (UI LIB EDITION) ============
do
local acc, accPill = 0, 0
local conn, warned = nil, false
conn = RunService.Heartbeat:Connect(function(dt)
if not isCurrent() then conn:Disconnect() return end
local ok, err = pcall(function()
accPill = accPill + dt
if accPill >= 0.2 then
accPill = 0
syncControls()
end
acc = acc + dt
if acc < 1 then return end
acc = 0
if U.session then U.session:SetText(sessionText()) end
local pd = sellPreview("pets", 3)
local td = sellPreview("trails", 2)
if U.sellPreview then
U.sellPreview:SetText("next pets to sell: "
.. (#pd > 0 and table.concat(pd, ", ") or "nothing")
.. "\nnext trails: "
.. (#td > 0 and table.concat(td, ", ") or "nothing"))
end
local watch = {}
for _, kind in ipairs({ "pets", "trails" }) do
for name, n in pairs(evolveCounts(kind)) do
if n >= 2 then table.insert(watch, name .. " " .. n .. "/5") end
end
end
table.sort(watch)
if U.evolveWatch then
U.evolveWatch:SetText("evolve watch (non-evolved copies): "
.. (#watch > 0 and table.concat(watch, ", ") or "nothing yet")
.. (state.autoEvolve and " [auto ON]" or " [auto off]"))
end
if U.keepList then
local keeps = {}
for name in pairs(state.keepNames) do table.insert(keeps, name) end
table.sort(keeps)
U.keepList:SetText("keep list: " .. (#keeps > 0 and table.concat(keeps, ", ") or "none")
.. " ranking: " .. state.rankMode .. " floor: " .. state.sellBelow)
end
local c = cap()
local pn, tn = itemTotal("pets"), itemTotal("trails")
if U.petBar then U.petBar:Set(c > 0 and math.min(pn / c, 1) * 100 or 0) end
if U.petCap then
U.petCap:SetText(string.format("pets %d/%d (%d free)", pn, c, math.max(c - pn, 0)))
end
if U.trailBar then U.trailBar:Set(c > 0 and math.min(tn / c, 1) * 100 or 0) end
if U.trailCap then
U.trailCap:SetText(string.format("trails %d/%d (%d free)", tn, c, math.max(c - tn, 0)))
end
end)
if not ok and not warned then
warned = true
warn("[LOS Autofarm v5] refresh error: " .. tostring(err))
end
end)
window:Give(conn)
end
print("[LOS Autofarm v5 | UI LIB] loaded. Window Id 'los-autofarm-v5'. "
.. "Hatch = openCrystalRemote:InvokeServer(\"openCrystal\", \"<Name> Crystal\"). "
.. #crystals .. " crystals, "
.. (function() local n = 0 for _ in pairs(priceOf) do n = n + 1 end return n end)()
.. " priced pets/trails.")Loads code from the internet. It downloads more code when it runs (loadstring + HttpGet), which can change after it was posted. From: raw.githubusercontent.com.
Legends of speed autofarm made inside Project UAI. Written by deepseek v4.1 flash.
Stay safe
Never paste your .ROBLOSECURITY cookie anywhere, and use an alt account with scripts.

Legends Of Speed ⚡