Run it
Copy the script and paste it into your executor.
VERSION =
WINDUI_VERSION =
startedAt = .()
WindUI =
Window =
Container =
Connections = {}
Entries = {}
CONTAINER_NAME =
CONFIG = {
Version = VERSION,
WindUIVersion = WINDUI_VERSION,
MaxLogs = ,
AutoRefresh = ,
Notifications = ,
}
Settings = {
Labels = ,
Highlights = ,
MaxHighlights = ,
ShowDistance = ,
ShowPrice = ,
ShowNotes = ,
ShowHealth = ,
ScanInterval = ,
ActionDelay = ,
WashBatch = ,
WalkTimeout = ,
AutoTeleport = ,
HuntRadius = ,
HuntReach = ,
HuntMinHealth = ,
HuntTimeout = ,
CollectBodies = ,
CollectWindow = ,
SkipHostile = ,
WeaponName = ,
HideMenuWhileHunting = ,
HuntBoostSpeed = ,
HuntWalkSpeed = ,
BowMode = ,
BowRange = ,
BowCharge = ,
BowCooldown = ,
BowSpeed = ,
BowArc = ,
AimOffsetY = ,
}
State = {
Running = ,
Logs = {},
TotalCreated = ,
TotalRemoved = ,
LastScan = ,
LastScanClock = ,
ScanDirty = ,
}
ENV = (() == ())
INSTANCE_KEY =
()
parents = {}
(gethui) ==
(()
.(parents, ())
)
(()
.(parents, :())
)
(()
lp = :().LocalPlayer
pg = lp lp:()
pg
.(parents, pg)
)
_, parent (parents)
(()
found = parent:(CONTAINER_NAME)
found
found:()
)
(()
_, obj (:():())
obj.Name ==
obj.Name ==
(()
obj:()
)
)
previous = ENV[INSTANCE_KEY]
previous (previous.Unload) ==
(previous.Unload)
.()
ENV[INSTANCE_KEY] =
()
(message)
(():(
.(),
(message)
))
(message)
.(State.Logs, {
Time = .(),
Message = (message),
})
#State.Logs > CONFIG.MaxLogs
.(State.Logs, )
(message)
(title, content, duration)
WindUI
()
ok, err = (()
WindUI:({
Title = title,
Content = content,
Duration = duration ,
})
)
ok
( .. (err))
(title, content, duration)
CONFIG.Notifications
(title, content, duration)
(connection)
.(Connections, connection)
connection
()
_, connection (Connections)
(()
connection:()
)
.(Connections)
()
() ~=
()
sourceUrl =
.. WINDUI_VERSION ..
response = :(sourceUrl)
(response) ~= #response <
()
chunk, compileError = (response)
chunk
( .. (compileError))
ok, result = (chunk)
ok
( .. (result))
(result) ~=
(result.CreateWindow) ~=
()
result
loadOK, loadResult = (loadWindUI)
loadOK
()
((loadResult))
WindUI = loadResult
( .. WINDUI_VERSION .. )
Players = :()
Workspace = :()
RunService = :()
UserInputService = :()
VirtualInputManager =
(()
VirtualInputManager = :()
)
LocalPlayer = Players.LocalPlayer
()
folder = .()
folder.Name = CONTAINER_NAME
parent =
(gethui) ==
(()
parent = ()
)
parent
(()
parent = :()
)
ok = parent ~= (()
folder.Parent = parent
)
ok folder.Parent
folder.Parent = LocalPlayer:()
folder
Container = ()
SPECIES_LIST = {
{
Name = ,
Price = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Note = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Note = ,
Color = .(, , ),
},
{
Name = ,
Price = ,
Color = .(, , ),
},
}
UNKNOWN_COLOR = .(, , )
SPECIES_BY_LOWER = {}
_, species (SPECIES_LIST)
SPECIES_BY_LOWER[species.Name:()] = species
WildState = {
Enabled = ,
MaxDistance = ,
Selected = {},
}
_, species (SPECIES_LIST)
WildState.Selected[species.Name] =
(name)
Workspace:(name)
(parent, name)
parent
exact = parent:(name)
exact
exact
lowered = name:()
_, child (parent:())
child.Name:() == lowered
child
(name)
original = (name)
cleaned = original
cleaned = cleaned:(, )
cleaned = cleaned:(, )
cleaned = cleaned:(, )
cleaned ==
original
cleaned
(name)
cleaned = (name)
info = SPECIES_BY_LOWER[cleaned:()]
info
info, info.Name
, cleaned
(info, displayName)
info
WildState.Selected[info.Name] ==
(root)
results = {}
root
results
_, descendant (root:())
descendant:() descendant:()
nested =
parent = descendant.Parent
parent parent ~= root
parent:() parent:()
nested =
parent = parent.Parent
nested
.(results, descendant)
results
(inst)
inst
inst:()
inst.Position
inst:()
ok, cf = (()
inst:()
)
ok cf
cf.Position
sum = .(, , )
count =
_, descendant (inst:())
descendant:()
sum += descendant.Position
count +=
count >=
count >
sum / count
ANCHOR_NAMES = {
, , , , ,
}
(obj)
obj:()
obj
obj:()
root = obj:()
obj:()
root root:()
root
obj.PrimaryPart
obj.PrimaryPart
_, name (ANCHOR_NAMES)
part = obj:(name)
part part:()
part
_, descendant (obj:())
descendant:()
descendant
(obj)
part = (obj)
part
part.Position
(obj)
()
character = LocalPlayer LocalPlayer.Character
root = character character:()
root
root.Position
camera = Workspace.CurrentCamera
camera
camera.CFrame.Position
.(, , )
(obj)
count =
_, descendant (obj:())
descendant:()
count +=
count
Owner = {
UserId = LocalPlayer.UserId,
TavernName = .. (LocalPlayer.UserId),
Tavern = ,
Plot = ,
PlotName = ,
PlotReason = ,
PlotScores = {},
}
InfoParagraph =
(value)
value ==
kind = (value)
kind ==
value == LocalPlayer.UserId
kind ==
lowered = value:()
lowered == (LocalPlayer.UserId)
lowered == LocalPlayer.Name:()
lowered == LocalPlayer.DisplayName:()
kind ==
value == LocalPlayer
(text)
(text) ~= text ==
lowered = text:()
name = LocalPlayer.Name:()
display = LocalPlayer.DisplayName:()
#name >= lowered:(name, , )
#display >= lowered:(display, , )
()
guests = (Workspace, )
guests
Owner.Tavern =
tavern = (guests, Owner.TavernName)
tavern
suffix = (Owner.UserId)
_, child (guests:())
child.Name:(-#suffix) == suffix
tavern = child
Owner.Tavern = tavern
tavern
()
plotsFolder = (Workspace, )
plots = {}
plotsFolder
_, child (plotsFolder:())
child.Name:():()
.(plots, child)
.(plots, (a, b)
a.Name < b.Name
)
plots, plotsFolder
(plot)
best, reason = ,
(score, why)
score > best
best, reason = score, why
key, value (plot:())
(value)
(, .. (key))
_, descendant (plot:())
descendant:()
ok, value = (()
descendant.Value
)
ok (value)
(, .. descendant.Name)
descendant:()
(descendant.ObjectText)
(descendant.ActionText)
(, )
lowered = descendant.Name:()
lowered:(, , ) lowered:(, , )
key, value (descendant:())
(value)
(, descendant.Name .. .. (key))
best, reason
()
plots = ()
.(Owner.PlotScores)
#plots ==
Owner.Plot =
Owner.PlotName =
Owner.PlotReason =
bestPlot, bestScore, bestReason = , ,
_, plot (plots)
score, reason = (plot)
Owner.PlotScores[plot.Name] = { Score = score, Reason = reason }
score > bestScore
bestPlot, bestScore, bestReason = plot, score, reason
bestPlot Owner.Tavern
tavernPos = (Owner.Tavern)
tavernPos
nearestDist = .huge
_, plot (plots)
pos = (plot)
pos
dist = (pos - tavernPos).Magnitude
dist < nearestDist
bestPlot, nearestDist = plot, dist
bestPlot
bestReason =
Owner.Plot = bestPlot
Owner.PlotName = bestPlot bestPlot.Name
Owner.PlotReason = bestReason
bestPlot
()
tavernText = Owner.Tavern Owner.Tavern.Name
(Owner.TavernName .. )
plotText =
Owner.Plot
plotText = Owner.Plot.Name .. .. (Owner.PlotReason) ..
plotText = .. (Owner.PlotReason) ..
():(
(Owner.UserId),
tavernText,
plotText
)
()
InfoParagraph
(()
InfoParagraph:(())
)
()
()
(, LocalPlayer.Name, , LocalPlayer.DisplayName)
(, Owner.UserId)
(, .. Owner.TavernName)
(, Owner.Tavern Owner.Tavern:() )
(, Owner.Plot Owner.Plot:() )
(, Owner.PlotReason)
()
names = {}
name (Owner.PlotScores)
.(names, name)
.(names)
#names ==
()
_, name (names)
data = Owner.PlotScores[name]
( .. name, , data.Score, data.Reason )
()
ROLE_PATTERNS = {
{ Role = , Patterns = { , , } },
{ Role = , Patterns = { } },
{ Role = , Patterns = { , , , } },
{ Role = , Patterns = { , , , , } },
}
TARGET_COOLDOWN =
Auto = {
Serve = ,
Collect = ,
Wash = ,
Targets = {},
LastTargetScan = ,
LastUsed = {},
PendingMugs = ,
Stage = ,
Stats = { Taps = , Served = , Collected = , Washed = , Failed = },
}
(text)
tokens = {}
spaced = (text):(, ):()
word spaced:()
tokens[word] =
tokens
(text)
tokens = (text)
_, def (ROLE_PATTERNS)
_, pattern (def.Patterns)
tokens[pattern] tokens[pattern .. ]
def.Role
(inst, scopeRoot)
own = inst.Name
inst:()
own = own .. .. inst.ActionText .. .. inst.ObjectText
role = (own)
role
role
parent = inst.Parent
depth =
parent parent ~= scopeRoot depth <
role = (parent.Name)
role
role
parent = parent.Parent
depth +=
(inst)
parent = inst.Parent
parent
parent:()
parent.WorldPosition
parent:()
parent.Position
(parent)
()
targets = {}
seen = {}
scopes = {}
Owner.Tavern Owner.Tavern.Parent
.(scopes, Owner.Tavern)
Owner.Plot Owner.Plot.Parent
.(scopes, Owner.Plot)
_, scope (scopes)
_, descendant (scope:())
isPrompt = descendant:()
isClick = descendant:()
(isPrompt isClick) seen[descendant]
seen[descendant] =
.(targets, {
= descendant,
Kind = isPrompt ,
Role = (descendant, scope),
Scope = scope,
})
Auto.Targets = targets
Auto.LastTargetScan = .()
targets
(role)
origin = ()
now = .()
best, bestDist = , .huge
_, target (Auto.Targets)
target.Role == role
inst = target.Instance
inst.Parent (target.Kind ~= inst.Enabled)
last = Auto.LastUsed[inst]
last now - last >= TARGET_COOLDOWN
pos = (inst)
pos
dist = (pos - origin).Magnitude
dist < bestDist
best, bestDist = target, dist
best
()
State.Running (Auto.Serve Auto.Collect Auto.Wash)
(pos, stopDistance, timeout, ignoreActiveCheck)
character = LocalPlayer.Character
humanoid = character character:()
root = character character:()
humanoid root
Settings.AutoTeleport
flat = .(root.Position.X - pos.X, , root.Position.Z - pos.Z)
offset = flat.Magnitude > flat.Unit * .(, , )
root.CFrame = .(pos + offset + .(, , ))
startClock = .()
lastMove =
State.Running .() - startClock < timeout
ignoreActiveCheck ()
(root.Position - pos).Magnitude <= stopDistance
.() - lastMove >=
lastMove = .()
humanoid:(pos)
.()
(root.Position - pos).Magnitude <= stopDistance +
(target)
inst = target.Instance
target.Kind ==
() ==
hold = inst.HoldDuration
(()
inst.HoldDuration =
)
ok = (, inst)
(()
inst.HoldDuration = hold
)
ok
(()
inst:()
.(.(inst.HoldDuration, ) + )
inst:()
)
() ==
(, inst)
(target, ignoreActiveCheck)
inst = target.Instance
inst inst.Parent
target.Kind == inst.Enabled
pos = (inst)
pos
reach = .(, inst.MaxActivationDistance * )
(() - pos).Magnitude > reach
arrived = (
pos,
reach * ,
Settings.WalkTimeout,
ignoreActiveCheck
)
arrived
Auto.LastUsed[inst] = .()
Auto.Stats.Failed +=
Auto.LastUsed[inst] = .()
ok = (target)
ok
Auto.Stats.Failed +=
ok
()
.() - Auto.LastTargetScan >=
()
Auto.Wash Auto.PendingMugs >
shouldWash = Auto.PendingMugs >= Settings.WashBatch
Auto.Collect
()
shouldWash
target = ()
target (target)
Auto.PendingMugs = .(, Auto.PendingMugs - )
Auto.Stats.Washed +=
Auto.Collect
target = ()
target (target)
Auto.PendingMugs +=
Auto.Stats.Collected +=
Auto.Serve
Auto.Stage ==
target = ()
target (target)
Auto.Stats.Taps +=
Auto.Stage =
target = ()
target (target)
Auto.Stats.Served +=
Auto.Stage =
BODY_WORDS = {
, , , , , ,
, , , , ,
}
WEAPON_WORDS = {
, , , , , , ,
, , , , ,
}
ATTACK_DELAY =
describeForDump
Hunt = {
Enabled = ,
Current = ,
Blacklist = {},
LastWeaponWarn = ,
Track = {},
SavedCameraType = ,
OriginalSpeed = ,
Stats = { Hunted = , Collected = , Failed = , Shots = },
}
()
character = LocalPlayer.Character
humanoid = character character:()
root = character character:()
character, humanoid, root
(obj)
obj obj.Parent
humanoid = obj:() obj:()
humanoid
humanoid.Health >
health = obj:()
(health) ==
health >
(character, humanoid)
wanted = Settings.WeaponName:()
wanted == Settings.BowMode
wanted =
equipped = character:()
equipped (wanted == equipped.Name:():(wanted, , ))
equipped
backpack = LocalPlayer:()
found =
backpack
_, tool (backpack:())
tool:()
name = tool.Name:()
wanted ~=
name:(wanted, , )
found = tool
_, word (WEAPON_WORDS)
name:(word, , )
found = tool
found
found
(()
humanoid:(found)
)
.()
character:() found
wanted ~=
equipped
()
folder = ()
folder
origin = ()
now = .()
best, bestInfo, bestDist = , , .huge
_, obj ((folder))
expiry = Hunt.Blacklist[obj]
expiry now > expiry
info = (obj.Name)
allowed = info ~= WildState.Selected[info.Name] ==
allowed Settings.SkipHostile
info.Note info.Note:(, , )
allowed =
allowed (obj)
pos = (obj)
pos
dist = (pos - origin).Magnitude
dist <= Settings.HuntRadius dist < bestDist
best, bestInfo, bestDist = obj, info, dist
best, bestInfo
(down, tool)
down
(mouse1press) ==
(mouse1press)
(mouse1release) ==
(mouse1release)
VirtualInputManager
location = UserInputService:()
ok = (()
VirtualInputManager:(location.X, location.Y, , down, , )
)
ok
tool
(()
down
tool:()
tool:()
)
(x, y)
(mousemoveabs) ==
(mousemoveabs, x, y)
VirtualInputManager
(()
VirtualInputManager:(x, y, )
)
()
camera = Workspace.CurrentCamera
camera Hunt.SavedCameraType
(()
camera.CameraType = Hunt.SavedCameraType
)
Hunt.SavedCameraType =
()
()
_, humanoid = ()
Hunt.OriginalSpeed humanoid
(()
humanoid.WalkSpeed = Hunt.OriginalSpeed
)
Hunt.OriginalSpeed =
(obj, pos)
now = .()
last = Hunt.Track[obj]
velocity = .(, , )
last
dt = now - last.Time
dt > dt <
raw = (pos - last.Pos) / dt
velocity = last.Vel:(raw, )
Hunt.Track[obj] = { Pos = pos, Time = now, Vel = velocity }
velocity
(pos, velocity, origin)
dist = (pos - origin).Magnitude
flight = dist / .(Settings.BowSpeed, )
lead = velocity * flight
drop = * Workspace.Gravity * flight * flight * (Settings.BowArc / )
pos + lead + .(, drop, )
(point)
camera = Workspace.CurrentCamera
camera
camera.CFrame = .(camera.CFrame.Position, point)
viewport = camera.ViewportSize
(viewport.X / , viewport.Y / + Settings.AimOffsetY)
(obj, tool)
camera = Workspace.CurrentCamera
_, _, root = ()
camera root
part = (obj)
part
camera.CameraType ~= .CameraType.Scriptable
Hunt.SavedCameraType = camera.CameraType
camera.CameraType = .CameraType.Scriptable
()
current = (obj)
current
pos = current.Position
velocity = (obj, pos)
root.CFrame = .(root.Position, .(pos.X, root.Position.Y, pos.Z))
((pos, velocity, root.Position))
()
.()
(, tool)
holdUntil = .() + Settings.BowCharge
.() < holdUntil Hunt.Enabled State.Running
(obj) ()
.()
()
(, tool)
.()
()
(obj)
deadline = .() + Settings.HuntTimeout
lastPos = (obj)
lastMove =
lastAttack =
killed =
Hunt.Track = {}
Hunt.Enabled State.Running .() < deadline
character, humanoid, root = ()
character humanoid root humanoid.Health <=
(obj)
killed =
part = (obj)
part
pos = part.Position
lastPos = pos
healthPercent = humanoid.MaxHealth >
(humanoid.Health / humanoid.MaxHealth * )
healthPercent < Settings.HuntMinHealth
humanoid:(root.Position)
deadline +=
.()
dist = (root.Position - pos).Magnitude
reach = Settings.BowMode Settings.BowRange Settings.HuntReach
dist > reach
.() - lastMove >=
lastMove = .()
humanoid:(pos)
Settings.BowMode
humanoid:(root.Position)
tool = character:()
(character, humanoid)
tool
ok, err = (bowShoot, obj, tool)
ok
(, tool)
()
( .. (err))
Hunt.Stats.Shots +=
waitUntil = .() + Settings.BowCooldown
.() < waitUntil Hunt.Enabled State.Running
(obj)
.()
root.CFrame = .(
root.Position,
.(pos.X, root.Position.Y, pos.Z)
)
.() - lastAttack >= ATTACK_DELAY
lastAttack = .()
tool = character:()
(character, humanoid)
tool
(()
tool:()
)
.()
killed, lastPos
(center, radius)
results = {}
seen = {}
ok, parts = (()
Workspace:(center, radius, OverlapParams.())
)
ok
results
(inst)
seen[inst]
inst:() inst:()
seen[inst] =
.(results, {
= inst,
Kind = inst:() ,
Role = ,
})
(parent)
_, child (parent:())
(child)
child:()
_, sub (child:())
(sub)
checkedModels = {}
index, part (parts)
index >
(part)
model = part.Parent
model model:() checkedModels[model]
checkedModels[model] =
(model)
results
(inst)
text = inst.Name
inst:()
text = text .. .. inst.ActionText .. .. inst.ObjectText
parent = inst.Parent
depth =
parent parent ~= Workspace depth <
text = text .. .. parent.Name
parent = parent.Parent
depth +=
text
(center, radius)
targets = {}
_, target ((center, radius))
tokens = ((target.Instance))
matched =
_, word (BODY_WORDS)
tokens[word] tokens[word .. ]
matched =
matched
target.Role =
.(targets, target)
targets
(center)
endClock = .() + Settings.CollectWindow
fired = {}
gotAny =
Hunt.Enabled State.Running .() < endClock
acted =
_, target ((center, ))
fired[target.Instance]
fired[target.Instance] =
(target, )
Hunt.Stats.Collected +=
gotAny =
acted =
acted
.()
gotAny
()
character, humanoid, root = ()
character humanoid root humanoid.Health <=
.()
target = ()
target
.()
(character, humanoid)
.() - Hunt.LastWeaponWarn >
Hunt.LastWeaponWarn = .()
()
.()
Hunt.Current = target
killed, lastPos = (target)
Hunt.Current =
killed
Hunt.Stats.Hunted +=
Settings.CollectBodies lastPos
(lastPos)
Hunt.Blacklist[target] = .() +
Hunt.Stats.Failed +=
()
()
(, Hunt.Enabled)
(, Hunt.Current Hunt.Current.Name )
(, Settings.BowMode, , Settings.HuntBoostSpeed Settings.HuntWalkSpeed )
(, Hunt.Stats.Shots)
(, Hunt.Stats.Hunted)
(, Hunt.Stats.Collected)
(, Hunt.Stats.Failed)
(, Settings.SkipHostile)
(, Settings.HuntRadius, , Settings.HuntReach)
()
()
_, _, root = ()
()
root
()
()
list = (root.Position, )
(, #list)
_, target (list)
inst = target.Instance
tokens = ((inst))
match =
_, word (BODY_WORDS)
tokens[word] tokens[word .. ]
match =
(
match ,
target.Kind,
inst:(),
(inst)
)
()
( .. #list .. )
()
()
character = LocalPlayer.Character
backpack = LocalPlayer:()
(tool, where)
(where, tool.Name, .. tool.ClassName .. )
_, child (tool:())
( .. child.Name, .. child.ClassName .. )
key, value (tool:())
( .. (key) .. , value)
character
_, child (character:())
child:()
(child, )
backpack
_, child (backpack:())
child:()
(child, )
()
(entry)
entry.Highlight
(()
entry.Highlight:()
)
entry.Highlight =
(entry)
entry.Highlight entry.Highlight.Parent
highlight = .()
highlight.Name =
highlight.Adornee = entry.Obj
highlight.FillColor = entry.Color
highlight.OutlineColor = entry.Color
highlight.FillTransparency =
highlight.OutlineTransparency =
highlight.DepthMode = .HighlightDepthMode.AlwaysOnTop
highlight.Parent = Container
entry.Highlight = highlight
(obj)
entry = Entries[obj]
entry
(entry)
entry.Gui
(()
entry.Gui:()
)
Entries[obj] =
State.TotalRemoved +=
()
obj (Entries)
(obj)
.(Entries)
(obj, info, displayName)
part = (obj)
part
height =
(()
obj:()
height = obj:().Y /
height = obj.Size.Y /
)
height = .(height + , , )
color = info info.Color UNKNOWN_COLOR
gui = .()
gui.Name =
gui.Adornee = part
gui.Size = .(, )
gui.StudsOffset = .(, height, )
gui.AlwaysOnTop =
gui.LightInfluence =
gui.Enabled = Settings.Labels
gui.Parent = Container
label = .()
label.Size = .(, )
label.BackgroundTransparency =
label.Text = displayName
label.TextColor3 = color
label.TextStrokeTransparency =
label.TextSize =
label.Font = .Font.GothamBold
label.Parent = gui
humanoid =
obj:()
humanoid = obj:()
Entries[obj] = {
Obj = obj,
Info = info,
Display = displayName,
Part = part,
Gui = gui,
Label = label,
Color = color,
Humanoid = humanoid,
Dist = ,
Text = ,
}
State.TotalCreated +=
(entry)
text = entry.Display
info = entry.Info
info info.Price Settings.ShowPrice
text = text .. .. info.Price
info info.Note Settings.ShowNotes
text = text .. .. info.Note ..
Settings.ShowDistance
text = text .. .. .(entry.Dist) ..
Settings.ShowHealth
health, maxHealth
entry.Humanoid entry.Humanoid.Parent
health = entry.Humanoid.Health
maxHealth = entry.Humanoid.MaxHealth
attrHealth = entry.Obj:()
attrMax = entry.Obj:()
(attrHealth) ==
health = attrHealth
maxHealth = (attrMax) == attrMax
health
maxHealth
text = text .. .. .(health) .. .. .(maxHealth)
text = text .. .. .(health) ..
text
()
State.ScanDirty =
missingWarned =
()
WildState.Enabled
()
State.LastScan = .()
folder = ()
folder
()
missingWarned
missingWarned =
()
missingWarned =
origin = ()
seen = {}
_, obj ((folder))
info, displayName = (obj.Name)
(info, displayName)
pos = (obj)
pos (pos - origin).Magnitude <= WildState.MaxDistance
seen[obj] =
Entries[obj]
(obj, info, displayName)
obj (Entries)
seen[obj]
(obj)
State.LastScan = .()
()
origin = ()
list = {}
obj, entry (Entries)
WildState.Enabled obj:(Workspace)
(obj)
entry.Part entry.Part:(Workspace)
entry.Part = (obj)
entry.Part
entry.Gui.Adornee = entry.Part
entry.Part
(obj)
entry.Dist = (entry.Part.Position - origin).Magnitude
entry.Gui.Enabled = Settings.Labels
text = (entry)
text ~= entry.Text
entry.Text = text
entry.Label.Text = text
.(list, entry)
Settings.Highlights
.(list, (a, b)
a.Dist < b.Dist
)
index, entry (list)
index <= Settings.MaxHighlights
(entry)
(entry)
_, entry (list)
(entry)
(folderName)
folder = (folderName)
( .. folderName .. )
folder
()
(folderName .. )
descendants = folder:()
models, parts, folders = , ,
_, object (descendants)
object:()
models +=
object:()
parts +=
object:()
folders +=
(, folder:())
(, #folder:())
(, #descendants)
(, models, , parts, , folders)
()
_, child (folder:())
(child.Name, .. child.ClassName .. , , #child:())
()
(folderName .. )
(obj)
obj
()
(, obj.Name)
(, (obj.Name))
(, obj.ClassName)
(, obj:())
pos = (obj)
(, pos (pos) )
obj:()
anchor = (obj)
(, obj.PrimaryPart obj.PrimaryPart.Name )
(, anchor anchor.Name )
(, #obj:())
(, #obj:())
(, (obj))
humanoid = obj:()
humanoid
(, humanoid.Health .. .. humanoid.MaxHealth)
()
attributes = {}
(()
attributes = obj:()
)
()
hasAttributes =
key, value (attributes)
hasAttributes =
( .. (key) .. , value)
hasAttributes
()
(parent, depth)
depth >
(.(, depth) .. )
_, child (parent:())
(.(, depth) .. child.Name, .. child.ClassName .. )
(child, depth + )
()
(obj, )
()
()
folder = ()
folder
()
origin = ()
nearest, nearestDist = , .huge
_, obj ((folder))
pos = (obj)
pos
dist = (pos - origin).Magnitude
dist < nearestDist
nearest, nearestDist = obj, dist
nearest
()
(():(nearest.Name, .(nearestDist)))
inspectObject(nearest)
addLog("Inspected nearest animal: " .. nearest.Name)
end
-- Prints, for the 6 nearest animals, the distance by each method.
-- If "pivot dist" disagrees with "anchor dist", the model pivot is stale.
local function distanceDebug()
local folder = findFolder("Wildlife")
print("\n========== DISTANCE DEBUG ==========")
local character = LocalPlayer.Character
local root = character and character:FindFirstChild("HumanoidRootPart")
local camera = Workspace.CurrentCamera
print("Player root:", root and tostring(root.Position) or "NONE")
print("Camera:", camera and tostring(camera.CFrame.Position) or "NONE")
if not folder then
print("Workspace.Wildlife not found.")
print("====================================\n")
return
end
local origin = getOrigin()
local rows = {}
for _, obj in ipairs(getTopLevel(folder)) do
local anchor = getAnchorPart(obj)
if anchor then
table.insert(rows, {
Obj = obj,
Anchor = anchor,
Dist = (anchor.Position - origin).Magnitude,
})
end
end
table.sort(rows, function(a, b)
return a.Dist < b.Dist
end)
for index = 1, math.min(6, #rows) do
local row = rows[index]
local obj = row.Obj
local pivotDist = "n/a"
if obj:IsA("Model") then
local ok, cf = pcall(function()
return obj:GetPivot()
end)
if ok then
pivotDist = tostring(math.floor((cf.Position - origin).Magnitude))
end
end
local center = centerOf(obj)
local bboxDist = center and tostring(math.floor((center - origin).Magnitude)) or "n/a"
print(
obj.Name,
"| anchor:", row.Anchor.Name, math.floor(row.Dist),
"| pivot dist:", pivotDist,
"| bbox dist:", bboxDist,
"| PrimaryPart:", obj:IsA("Model") and obj.PrimaryPart and obj.PrimaryPart.Name or "none"
)
end
print("====================================\n")
addLog("Distance debug printed.")
end
local function speciesCensus()
print("\n========== SPECIES CENSUS ==========")
local folder = findFolder("Wildlife")
if not folder then
print("Workspace.Wildlife not found.")
print("====================================\n")
addLog("Wildlife folder not found.")
return
end
local counts = {}
local rawExamples = {}
local total = 0
for _, obj in ipairs(getTopLevel(folder)) do
local info, displayName = identify(obj.Name)
counts[displayName] = (counts[displayName] or 0) + 1
rawExamples[displayName] = rawExamples[displayName] or obj.Name
total += 1
end
local names = {}
for name in pairs(counts) do
table.insert(names, name)
end
table.sort(names)
print("Total animals:", total)
for _, name in ipairs(names) do
local known = SPECIES_BY_LOWER[name:lower()] ~= nil
print(
name,
counts[name],
"(e.g. " .. rawExamples[name] .. ")",
known and "" or "<-- NEW (no price/color set)"
)
end
print("====================================\n")
addLog("Species census completed.")
end
--==================================================
-- TAVERN INSPECTION TOOLS
--==================================================
function describeForDump(inst)
local extra = ""
if inst:IsA("ProximityPrompt") then
extra = (' Action="%s" Object="%s" Enabled=%s Range=%s'):format(
inst.ActionText,
inst.ObjectText,
tostring(inst.Enabled),
tostring(inst.MaxActivationDistance)
)
elseif inst:IsA("ClickDetector") then
extra = " (click, range " .. tostring(inst.MaxActivationDistance) .. ")"
elseif inst:IsA("ValueBase") then
local ok, value = pcall(function()
return inst.Value
end)
if ok then
extra = " = " .. tostring(value)
end
end
local attrParts = {}
local shown = 0
for key, value in pairs(inst:GetAttributes()) do
shown += 1
if shown <= 5 then
table.insert(attrParts, tostring(key) .. "=" .. tostring(value))
end
end
if shown > 0 then
extra = extra .. " {" .. table.concat(attrParts, ", ") .. (shown > 5 and ", ..." or "") .. "}"
end
return extra
end
local function dumpTree(title, root, maxDepth, maxLines)
print("\n========== " .. title .. " ==========")
if not root then
print("Not found.")
print("=====================================\n")
addLog(title .. ": not found.")
return
end
print("Path:", root:GetFullName())
local lines = 0
local function walk(inst, depth)
for _, child in ipairs(inst:GetChildren()) do
if lines >= maxLines then
return
end
lines += 1
print(
string.rep(" ", depth) .. child.Name,
"[" .. child.ClassName .. "]" .. describeForDump(child)
)
if depth < maxDepth then
walk(child, depth + 1)
end
end
end
walk(root, 0)
if lines >= maxLines then
print("... truncated at " .. maxLines .. " lines")
end
print("=====================================\n")
addLog(title .. " dumped.")
end
local function findDescendantLike(roots, needle)
local target = needle:lower()
for _, root in ipairs(roots) do
if root and root.Parent then
for _, descendant in ipairs(root:GetDescendants()) do
local flat = descendant.Name:lower():gsub("%s", "")
if flat:find(target, 1, true) then
return descendant
end
end
end
end
return nil
end
local function tavernRoots()
return { Owner.Tavern, Owner.Plot }
end
local function interactableCensus()
refreshTargets()
print("\n========== INTERACTABLE CENSUS ==========")
if not Owner.Tavern and not Owner.Plot then
print("No tavern or plot detected yet. Use 'Detect Tavern & Plot'.")
print("=========================================\n")
return
end
print("Tavern:", Owner.Tavern and Owner.Tavern:GetFullName() or "none")
print("Plot:", Owner.Plot and Owner.Plot:GetFullName() or "none")
print("Total interactables:", #Auto.Targets)
local counts = {}
for index, target in ipairs(Auto.Targets) do
local role = target.Role or "(no role)"
local inst = target.Instance
counts[role] = (counts[role] or 0) + 1
if index <= 250 then
print(
("[%s] %s | %s |%s"):format(
role,
target.Kind,
inst:GetFullName(),
describeForDump(inst)
)
)
end
end
if #Auto.Targets > 250 then
print("... " .. (#Auto.Targets - 250) .. " more not printed")
end
print("\nBy role:")
for role, count in pairs(counts) do
print(" " .. role .. ":", count)
end
print("=========================================\n")
addLog("Interactable census completed: " .. #Auto.Targets)
end
local function printAutomationStatus()
print("\n========== AUTOMATION STATUS ==========")
print("Serve:", Auto.Serve, "Collect:", Auto.Collect, "Wash:", Auto.Wash)
print("Pending mugs:", Auto.PendingMugs)
print("Taps:", Auto.Stats.Taps, "Served:", Auto.Stats.Served)
print("Collected:", Auto.Stats.Collected, "Washed:", Auto.Stats.Washed)
print("Failed:", Auto.Stats.Failed)
print("fireproximityprompt:", type(fireproximityprompt) == "function")
print("fireclickdetector:", type(fireclickdetector) == "function")
print("=======================================\n")
end
local function printLogs()
print("\n========== TAVERN INSPECTOR LOGS ==========")
if #State.Logs == 0 then
print("No events recorded.")
end
for _, entry in ipairs(State.Logs) do
print("[" .. entry.Time .. "] " .. entry.Message)
end
print("===========================================\n")
end
local function printReport()
local counts = {}
local total = 0
for _, entry in pairs(Entries) do
counts[entry.Display] = (counts[entry.Display] or 0) + 1
total += 1
end
print("\n========== INSPECTOR REPORT ==========")
print("Version:", VERSION)
print("WindUI:", WINDUI_VERSION)
print("Player:", LocalPlayer and LocalPlayer.Name or "Unavailable")
print("UserId:", Owner.UserId)
print("Tavern:", Owner.Tavern and Owner.Tavern.Name or "not found")
print("Plot:", Owner.Plot and Owner.Plot.Name or "not detected")
print("PlaceId:", game.PlaceId)
print("GameId:", game.GameId)
print("ESP enabled:", WildState.Enabled, "Max distance:", WildState.MaxDistance)
print("Active ESP objects:", total)
for name, count in pairs(counts) do
print(" " .. name .. ":", count)
end
print("Total created:", State.TotalCreated)
print("Total removed:", State.TotalRemoved)
print("Last scan:", State.LastScan)
print("======================================\n")
end
--==================================================
-- INITIAL OWNER DETECTION
--==================================================
pcall(detectTavern)
pcall(detectPlot)
addLog("Owner UserId: " .. tostring(Owner.UserId))
addLog("Tavern: " .. (Owner.Tavern and Owner.Tavern.Name or "not found yet"))
addLog("Plot: " .. (Owner.Plot and (Owner.Plot.Name .. " (" .. tostring(Owner.PlotReason) .. ")") or "not detected yet"))
--==================================================
-- WINDOW
--==================================================
Window = WindUI:CreateWindow({
Title = "Tavern Town | Inspector AIO",
Author = "Author: asuralangley - AIO v" .. VERSION,
Icon = "paw-print",
Theme = "Dark",
Size = UDim2.fromOffset(680, 500),
MinSize = Vector2.new(560, 400),
Resizable = true,
HideSearchBar = false,
Folder = "TavernTownInspector",
})
--==================================================
-- CUSTOM TOGGLE KEYBIND
-- (WindUI's built-in ToggleKey is intentionally not used,
-- so only one handler ever toggles the window.)
--==================================================
local TOGGLE_KEYS = {
[Enum.KeyCode.RightShift] = true,
[Enum.KeyCode.RightControl] = true,
}
local windowOpen = true
local lastToggle = 0
local function toggleWindow()
if os.clock() - lastToggle < 0.15 then
return
end
lastToggle = os.clock()
local method = nil
-- 1) WindUI's own toggle.
if pcall(function()
Window:Toggle()
end) then
method = "Window:Toggle()"
end
-- 2) Explicit Open / Close.
if not method then
local ok
if windowOpen then
ok = pcall(function()
Window:Close()
end)
else
ok = pcall(function()
Window:Open()
end)
end
if ok then
method = windowOpen and "Window:Close()" or "Window:Open()"
end
end
-- 3) Last resort: flip the main frame's visibility directly.
if not method then
if pcall(function()
local main = Window.UIElements.Main
main.Visible = not main.Visible
end) then
method = "UIElements.Main.Visible"
end
end
if method then
windowOpen = not windowOpen
log("Window toggled via " .. method)
else
warn("[Tavern Inspector] Could not toggle the window (no usable method).")
end
end
trackConnection(UserInputService.InputBegan:Connect(function(input)
if input.UserInputType ~= Enum.UserInputType.Keyboard then
return
end
if not TOGGLE_KEYS[input.KeyCode] then
return
end
-- Don't toggle while typing in a text box (chat, etc.).
if UserInputService:GetFocusedTextBox() then
return
end
toggleWindow()
end))
log(("Window methods: Toggle=%s Open=%s Close=%s"):format(
tostring(type(Window.Toggle) == "function"),
tostring(type(Window.Open) == "function"),
tostring(type(Window.Close) == "function")
))
pcall(function()
Window:Tag({
Title = "v" .. VERSION,
Color = "Success",
})
end)
local Dashboard = Window:Tab({
Title = "Dashboard",
Icon = "layout-dashboard",
})
local WildlifeTab = Window:Tab({
Title = "Wildlife",
Icon = "paw-print",
})
local TavernTab = Window:Tab({
Title = "Tavern",
Icon = "beer",
})
local HuntTab = Window:Tab({
Title = "Hunt",
Icon = "target",
})
local DiagnosticsTab = Window:Tab({
Title = "Diagnostics",
Icon = "scan-search",
})
local SettingsTab = Window:Tab({
Title = "Settings",
Icon = "settings",
})
--==================================================
-- UI HELPERS
--==================================================
local function addSection(tab, title)
local ok = pcall(function()
tab:Section({ Title = title })
end)
if not ok then
pcall(function()
tab:Paragraph({ Title = title, Desc = "" })
end)
end
end
local function tryElement(description, fn)
local ok, err = pcall(fn)
if not ok then
addLog("UI element failed (" .. description .. "): " .. tostring(err))
end
end
--==================================================
-- DASHBOARD
--==================================================
Dashboard:Paragraph({
Title = "Tavern Town Inspector AIO",
Desc = "Version " .. VERSION .. " | WindUI " .. WINDUI_VERSION,
})
Dashboard:Paragraph({
Title = "Quick Start",
Desc = "Pick animals in the Wildlife tab. The Tavern tab finds your tavern and plot and holds the experimental automation. Auto refresh is always on. Toggle this window with RightShift or RightControl.",
})
Dashboard:Button({
Title = "Rescan Now",
Icon = "refresh-cw",
Callback = function()
requestScan()
safeNotify("Scan", "Rescan requested.")
end,
})
Dashboard:Button({
Title = "Print Full Report",
Icon = "file-text",
Callback = function()
printReport()
safeNotify("Report", "Report printed to console.")
end,
})
Dashboard:Button({
Title = "Show Event Logs",
Icon = "scroll-text",
Callback = printLogs,
})
--==================================================
-- WILDLIFE TAB
--==================================================
addSection(WildlifeTab, "Animal ESP")
WildlifeTab:Toggle({
Title = "Show Animal ESP",
Value = WildState.Enabled,
Callback = function(value)
WildState.Enabled = value
requestScan()
addLog("Animal ESP: " .. tostring(value))
end,
})
WildlifeTab:Toggle({
Title = "Enable Animal Labels",
Value = Settings.Labels,
Callback = function(value)
Settings.Labels = value
addLog("Animal labels: " .. tostring(value))
end,
})
WildlifeTab:Toggle({
Title = "Enable Highlights (nearest 30)",
Value = Settings.Highlights,
Callback = function(value)
Settings.Highlights = value
addLog("Highlights: " .. tostring(value))
end,
})
tryElement("distance slider", function()
WildlifeTab:Slider({
Title = "Max Distance",
Step = 50,
Value = {
Min = 50,
Max = 5000,
Default = WildState.MaxDistance,
},
Callback = function(value)
local number = tonumber(value)
if number then
WildState.MaxDistance = number
requestScan()
end
end,
})
end)
addSection(WildlifeTab, "Species (turn off the ones you don't want)")
local SpeciesToggles = {}
for _, species in ipairs(SPECIES_LIST) do
local title = species.Name .. " - " .. species.Price
if species.Note then
title = title .. " (" .. species.Note .. ")"
end
tryElement(species.Name .. " toggle", function()
SpeciesToggles[species.Name] = WildlifeTab:Toggle({
Title = title,
Value = true,
Callback = function(value)
WildState.Selected[species.Name] = value
requestScan()
end,
})
end)
end
local function setAllSpecies(value)
for _, species in ipairs(SPECIES_LIST) do
WildState.Selected[species.Name] = value
local toggle = SpeciesToggles[species.Name]
if toggle then
pcall(function()
toggle:Set(value)
end)
end
end
requestScan()
end
WildlifeTab:Button({
Title = "Select All Species",
Icon = "check-check",
Callback = function()
setAllSpecies(true)
addLog("All species enabled.")
end,
})
WildlifeTab:Button({
Title = "Deselect All Species",
Icon = "x",
Callback = function()
setAllSpecies(false)
addLog("All species disabled.")
end,
})
WildlifeTab:Button({
Title = "Print Species Census",
Icon = "bar-chart",
Callback = speciesCensus,
})
--==================================================
-- TAVERN TAB
--==================================================
addSection(TavernTab, "Your Tavern")
InfoParagraph = TavernTab:Paragraph({
Title = "Owner Info",
Desc = ownerInfoText(),
})
TavernTab:Button({
Title = "Detect Tavern & Plot",
Icon = "search",
Callback = function()
task.spawn(function()
pcall(detectTavern)
pcall(detectPlot)
updateOwnerInfo()
printOwnerReport()
safeNotify(
"Owner Detection",
(Owner.Tavern and "Tavern found. " or "Tavern NOT found. ")
.. (Owner.Plot and (Owner.Plot.Name .. ".") or "Plot not detected.")
)
end)
end,
})
addSection(TavernTab, "Automation (experimental, off by default)")
local function setAuto(key, label, value)
Auto[key] = value
addLog(label .. ": " .. tostring(value))
if value then
if type(fireproximityprompt) ~= "function" and type(fireclickdetector) ~= "function" then
addLog("Warning: executor has no fireproximityprompt / fireclickdetector.")
end
if not Owner.Tavern and not Owner.Plot then
addLog("Warning: no tavern or plot detected yet, automation has nothing to work on.")
end
end
end
TavernTab:Toggle({
Title = "Auto Serve Drinks",
Value = false,
Callback = function(value)
setAuto("Serve", "Auto Serve", value)
end,
})
TavernTab:Toggle({
Title = "Auto Collect Empty Mugs",
Value = false,
Callback = function(value)
setAuto("Collect", "Auto Collect", value)
end,
})
TavernTab:Toggle({
Title = "Auto Wash Mugs",
Value = false,
Callback = function(value)
setAuto("Wash", "Auto Wash", value)
end,
})
tryElement("action delay slider", function()
TavernTab:Slider({
Title = "Action Delay (seconds)",
Step = 0.1,
Value = {
Min = 0.2,
Max = 3,
Default = Settings.ActionDelay,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.ActionDelay = number
end
end,
})
end)
tryElement("wash batch slider", function()
TavernTab:Slider({
Title = "Wash After N Mugs",
Step = 1,
Value = {
Min = 1,
Max = 10,
Default = Settings.WashBatch,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.WashBatch = math.floor(number)
end
end,
})
end)
TavernTab:Toggle({
Title = "Teleport instead of walking",
Value = Settings.AutoTeleport,
Callback = function(value)
Settings.AutoTeleport = value
addLog("Auto teleport: " .. tostring(value))
end,
})
TavernTab:Button({
Title = "Wash Now (one mug)",
Icon = "droplets",
Callback = function()
task.spawn(function()
refreshTargets()
local target = pickTarget("Wash")
if not target then
addLog("Wash Now: no wash target found.")
return
end
if interact(target, true) then
Auto.Stats.Washed += 1
Auto.PendingMugs = math.max(0, Auto.PendingMugs - 1)
end
end)
end,
})
TavernTab:Button({
Title = "Print Automation Status",
Icon = "activity",
Callback = printAutomationStatus,
})
addSection(TavernTab, "Scan Tools (print to console)")
TavernTab:Button({
Title = "Interactable Census",
Icon = "mouse-pointer-click",
Callback = function()
task.spawn(interactableCensus)
end,
})
TavernTab:Button({
Title = "Dump Tavern Structure",
Icon = "folder-tree",
Callback = function()
dumpTree("TAVERN STRUCTURE", Owner.Tavern, 3, 400)
end,
})
TavernTab:Button({
Title = "Dump Bar Structure",
Icon = "beer",
Callback = function()
local bar = findDescendantLike(tavernRoots(), "starterbar")
if not bar then
addLog("Bar (starterBar) not found in your tavern/plot.")
end
dumpTree("BAR STRUCTURE", bar, 5, 300)
end,
})
TavernTab:Button({
Title = "Dump Plot Structure",
Icon = "map",
Callback = function()
dumpTree("PLOT STRUCTURE", Owner.Plot, 2, 300)
local sign = findDescendantLike({ Owner.Plot }, "ownersign")
if sign then
dumpTree("OWNER SIGN", sign, 4, 100)
end
end,
})
TavernTab:Button({
Title = "Dump Guests Folder",
Icon = "users",
Callback = function()
dumpTree("GUESTS FOLDER", findChildCI(Workspace, "Guests"), 0, 100)
end,
})
--==================================================
-- HUNT TAB
--==================================================
addSection(HuntTab, "Animal Auto Farm (experimental, off by default)")
HuntTab:Paragraph({
Title = "How it works",
Desc = "Hunts the animals switched ON in the Wildlife tab (known species only). It walks to the nearest one, equips a weapon, attacks until it dies, then looks for a collect prompt near the body.",
})
HuntTab:Toggle({
Title = "Auto Hunt",
Value = false,
Callback = function(value)
Hunt.Enabled = value
addLog("Auto Hunt: " .. tostring(value))
if value then
local character = LocalPlayer.Character
if not character or not character:FindFirstChildOfClass("Tool") then
addLog("Hunt: no tool equipped yet, it will try to equip one from your backpack.")
end
-- The menu would swallow the M1 clicks, so hide it.
if Settings.HideMenuWhileHunting and windowOpen then
toggleWindow()
addLog("Menu hidden while hunting. Press RightShift to show it again.")
end
else
task.delay(0.3, restoreHuntState)
end
end,
})
HuntTab:Toggle({
Title = "Hide Menu While Hunting",
Value = Settings.HideMenuWhileHunting,
Callback = function(value)
Settings.HideMenuWhileHunting = value
end,
})
HuntTab:Toggle({
Title = "Boost Walk Speed While Hunting",
Value = Settings.HuntBoostSpeed,
Callback = function(value)
Settings.HuntBoostSpeed = value
addLog("Hunt speed boost: " .. tostring(value))
end,
})
tryElement("hunt walk speed slider", function()
HuntTab:Slider({
Title = "Hunt Walk Speed",
Step = 1,
Value = {
Min = 16,
Max = 40,
Default = Settings.HuntWalkSpeed,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.HuntWalkSpeed = number
end
end,
})
end)
HuntTab:Toggle({
Title = "Collect Bodies After Kill",
Value = Settings.CollectBodies,
Callback = function(value)
Settings.CollectBodies = value
end,
})
HuntTab:Toggle({
Title = "Skip Hostile Animals (Bear / Wolf)",
Value = Settings.SkipHostile,
Callback = function(value)
Settings.SkipHostile = value
addLog("Skip hostile: " .. tostring(value))
end,
})
tryElement("hunt radius slider", function()
HuntTab:Slider({
Title = "Hunt Radius (studs)",
Step = 25,
Value = {
Min = 50,
Max = 1000,
Default = Settings.HuntRadius,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.HuntRadius = number
end
end,
})
end)
tryElement("attack reach slider", function()
HuntTab:Slider({
Title = "Attack Reach (studs)",
Step = 1,
Value = {
Min = 3,
Max = 20,
Default = Settings.HuntReach,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.HuntReach = number
end
end,
})
end)
tryElement("min health slider", function()
HuntTab:Slider({
Title = "Pause Below Health %",
Step = 5,
Value = {
Min = 0,
Max = 90,
Default = Settings.HuntMinHealth,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.HuntMinHealth = number
end
end,
})
end)
tryElement("weapon input", function()
HuntTab:Input({
Title = "Weapon Name (optional)",
Value = "",
Placeholder = "e.g. Spear (blank = auto)",
Callback = function(text)
Settings.WeaponName = tostring(text or "")
addLog("Weapon name: " .. (Settings.WeaponName == "" and "(auto)" or Settings.WeaponName))
end,
})
end)
addSection(HuntTab, "Bow (hold M1 to draw, release to shoot)")
HuntTab:Toggle({
Title = "Bow Mode",
Value = Settings.BowMode,
Callback = function(value)
Settings.BowMode = value
addLog("Bow mode: " .. tostring(value))
end,
})
tryElement("bow range slider", function()
HuntTab:Slider({
Title = "Bow Range (studs)",
Step = 5,
Value = {
Min = 20,
Max = 150,
Default = Settings.BowRange,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.BowRange = number
end
end,
})
end)
tryElement("bow draw time slider", function()
HuntTab:Slider({
Title = "Draw Time (seconds)",
Step = 0.1,
Value = {
Min = 0.2,
Max = 3,
Default = Settings.BowCharge,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.BowCharge = number
end
end,
})
end)
tryElement("bow cooldown slider", function()
HuntTab:Slider({
Title = "Time Between Shots (seconds)",
Step = 0.1,
Value = {
Min = 0.3,
Max = 3,
Default = Settings.BowCooldown,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.BowCooldown = number
end
end,
})
end)
tryElement("arrow speed slider", function()
HuntTab:Slider({
Title = "Arrow Speed (studs/s)",
Step = 10,
Value = {
Min = 50,
Max = 500,
Default = Settings.BowSpeed,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.BowSpeed = number
end
end,
})
end)
tryElement("arc compensation slider", function()
HuntTab:Slider({
Title = "Arc Compensation (%)",
Step = 5,
Value = {
Min = 0,
Max = 200,
Default = Settings.BowArc,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.BowArc = number
end
end,
})
end)
tryElement("cursor offset slider", function()
HuntTab:Slider({
Title = "Aim Cursor Y Offset (pixels)",
Step = 2,
Value = {
Min = -60,
Max = 60,
Default = Settings.AimOffsetY,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.AimOffsetY = number
end
end,
})
end)
addSection(HuntTab, "Hunt Tools (print to console)")
HuntTab:Button({
Title = "Print Hunt Status",
Icon = "activity",
Callback = printHuntStatus,
})
HuntTab:Button({
Title = "Body Scan (stand next to a dead animal)",
Icon = "scan",
Callback = bodyScan,
})
HuntTab:Button({
Title = "Print My Tools",
Icon = "wrench",
Callback = printTools,
})
--==================================================
-- DIAGNOSTICS
--==================================================
DiagnosticsTab:Paragraph({
Title = "Runtime Diagnostics",
Desc = "Everything prints to the executor console (F9).",
})
DiagnosticsTab:Button({
Title = "Distance Debug",
Icon = "ruler",
Callback = distanceDebug,
})
DiagnosticsTab:Button({
Title = "Species Census",
Icon = "bar-chart",
Callback = speciesCensus,
})
DiagnosticsTab:Button({
Title = "Inspect Nearest Animal",
Icon = "crosshair",
Callback = inspectNearest,
})
DiagnosticsTab:Button({
Title = "Inspect Wildlife Folder",
Icon = "folder-search",
Callback = function()
inspectFolder("Wildlife")
end,
})
DiagnosticsTab:Button({
Title = "Inspect World Folder",
Icon = "globe",
Callback = function()
inspectFolder("World")
end,
})
DiagnosticsTab:Button({
Title = "Run Environment Diagnostics",
Icon = "scan",
Callback = function()
local checks = {
{ "WindUI loaded", WindUI ~= nil },
{ "CreateWindow available", type(WindUI.CreateWindow) == "function" },
{ "LocalPlayer available", LocalPlayer ~= nil },
{ "Workspace available", Workspace ~= nil },
{ "RunService available", RunService ~= nil },
{ "Visual container", Container ~= nil and Container.Parent ~= nil },
{ "Wildlife folder available", findFolder("Wildlife") ~= nil },
{ "World folder available", findFolder("World") ~= nil },
{ "Guests folder available", findChildCI(Workspace, "Guests") ~= nil },
{ "Plots folder available", findChildCI(Workspace, "Plots") ~= nil },
{ "Your tavern found", Owner.Tavern ~= nil },
{ "Your plot detected", Owner.Plot ~= nil },
{ "fireproximityprompt available", type(fireproximityprompt) == "function" },
{ "fireclickdetector available", type(fireclickdetector) == "function" },
{ "Window:Toggle available", type(Window.Toggle) == "function" },
{ "Window:Open available", type(Window.Open) == "function" },
{ "Window:Close available", type(Window.Close) == "function" },
}
print("\n========== ENVIRONMENT DIAGNOSTICS ==========")
for _, check in ipairs(checks) do
print(check[1] .. ":", check[2] and "PASS" or "FAIL")
end
print("PlaceId:", game.PlaceId)
print("GameId:", game.GameId)
print("==============================================\n")
addLog("Environment diagnostics completed.")
safeNotify("Diagnostics", "Diagnostics printed to console.")
end,
})
DiagnosticsTab:Button({
Title = "Print Runtime Information",
Icon = "terminal",
Callback = function()
print("\n========== RUNTIME INFORMATION ==========")
print("Version:", VERSION)
print("WindUI:", WINDUI_VERSION)
print("Player:", LocalPlayer and LocalPlayer.Name or "Unavailable")
print("PlaceId:", game.PlaceId)
print("GameId:", game.GameId)
print("Elapsed:", os.clock() - startedAt)
print("==========================================\n")
addLog("Runtime information printed.")
end,
})
DiagnosticsTab:Button({
Title = "Show Event Logs",
Icon = "scroll-text",
Callback = printLogs,
})
--==================================================
-- SETTINGS
--==================================================
SettingsTab:Paragraph({
Title = "General Settings",
Desc = "Auto refresh is always on and cannot be turned off.",
})
SettingsTab:Toggle({
Title = "Show Price",
Value = Settings.ShowPrice,
Callback = function(value)
Settings.ShowPrice = value
end,
})
SettingsTab:Toggle({
Title = "Show Notes (hostile / hits)",
Value = Settings.ShowNotes,
Callback = function(value)
Settings.ShowNotes = value
end,
})
SettingsTab:Toggle({
Title = "Show Distance",
Value = Settings.ShowDistance,
Callback = function(value)
Settings.ShowDistance = value
end,
})
SettingsTab:Toggle({
Title = "Show Health (when available)",
Value = Settings.ShowHealth,
Callback = function(value)
Settings.ShowHealth = value
end,
})
tryElement("scan interval slider", function()
SettingsTab:Slider({
Title = "Refresh Interval (seconds)",
Step = 0.5,
Value = {
Min = 0.5,
Max = 5,
Default = Settings.ScanInterval,
},
Callback = function(value)
local number = tonumber(value)
if number then
Settings.ScanInterval = number
end
end,
})
end)
SettingsTab:Toggle({
Title = "Notifications",
Value = CONFIG.Notifications,
Callback = function(value)
CONFIG.Notifications = value
addLog("Notifications: " .. tostring(value))
if value then
notify("Settings", "Notifications enabled.")
end
end,
})
SettingsTab:Button({
Title = "Clear Event Logs",
Icon = "trash-2",
Callback = function()
table.clear(State.Logs)
log("Event logs cleared.")
safeNotify("Logs", "Event logs cleared.")
end,
})
SettingsTab:Button({
Title = "Print Configuration",
Icon = "settings-2",
Callback = function()
print("\n========== CONFIGURATION ==========")
for key, value in pairs(CONFIG) do
print(key, value)
end
for key, value in pairs(Settings) do
print("Settings." .. key, value)
end
print("WildState.Enabled", WildState.Enabled)
print("WildState.MaxDistance", WildState.MaxDistance)
for _, species in ipairs(SPECIES_LIST) do
print("Species." .. species.Name, WildState.Selected[species.Name])
end
print("===================================\n")
end,
})
--==================================================
-- BACKGROUND LOOPS
--==================================================
-- Auto refresh loop (always on): finds new animals and removes gone ones.
task.spawn(function()
while State.Running do
if State.ScanDirty
or os.clock() - State.LastScanClock >= Settings.ScanInterval then
State.ScanDirty = false
State.LastScanClock = os.clock()
local ok, err = pcall(scanAll)
if not ok then
addLog("Auto refresh error: " .. tostring(err))
end
end
task.wait(0.25)
end
end)
-- Update loop: distances, health text, highlight ranking.
task.spawn(function()
while State.Running do
local ok, err = pcall(updateEntries)
if not ok then
addLog("Update error: " .. tostring(err))
end
task.wait(0.25)
end
end)
-- Owner loop: keeps trying to find your tavern / plot until found,
-- and re-detects if they get replaced.
task.spawn(function()
while State.Running do
local changed = false
if not Owner.Tavern or not Owner.Tavern.Parent then
local before = Owner.Tavern
pcall(detectTavern)
if Owner.Tavern ~= before then
changed = true
addLog("Tavern: " .. (Owner.Tavern and Owner.Tavern.Name or "lost"))
end
end
if not Owner.Plot or not Owner.Plot.Parent then
local before = Owner.Plot
pcall(detectPlot)
if Owner.Plot ~= before then
changed = true
addLog("Plot: " .. (Owner.Plot and (Owner.Plot.Name .. " (" .. tostring(Owner.PlotReason) .. ")") or "lost"))
end
end
if changed then
updateOwnerInfo()
end
for _ = 1, 20 do
if not State.Running then
break
end
task.wait(0.5)
end
end
end)
-- Automation loop (only does anything while a toggle is on).
task.spawn(function()
while State.Running do
if Auto.Serve or Auto.Collect or Auto.Wash then
local ok, err = pcall(automationStep)
if not ok then
addLog("Automation error: " .. tostring(err))
end
end
task.wait(Settings.ActionDelay)
end
end)
-- Hunt loop (only does anything while Auto Hunt is on).
task.spawn(function()
while State.Running do
if Hunt.Enabled then
local ok, err = pcall(huntStep)
if not ok then
addLog("Hunt error: " .. tostring(err))
task.wait(1)
end
end
task.wait(0.3)
end
end)
-- Walk speed loop: while hunting, keeps WalkSpeed at the chosen value
-- (the game may reset it); puts it back when hunting stops.
task.spawn(function()
while State.Running do
local _, humanoid = getCharacterParts()
if Hunt.Enabled and Settings.HuntBoostSpeed then
if humanoid then
if Hunt.OriginalSpeed == nil
and humanoid.WalkSpeed ~= Settings.HuntWalkSpeed then
Hunt.OriginalSpeed = humanoid.WalkSpeed
end
if humanoid.WalkSpeed ~= Settings.HuntWalkSpeed then
pcall(function()
humanoid.WalkSpeed = Settings.HuntWalkSpeed
end)
end
end
elseif Hunt.OriginalSpeed then
if humanoid then
pcall(function()
humanoid.WalkSpeed = Hunt.OriginalSpeed
end)
end
Hunt.OriginalSpeed = nil
end
task.wait(0.2)
end
end)
--==================================================
-- CLEANUP / UNLOAD
--==================================================
local function unload()
if not State.Running then
return
end
State.Running = false
Auto.Serve = false
Auto.Collect = false
Auto.Wash = false
Hunt.Enabled = false
pcall(restoreHuntState)
if ENV[INSTANCE_KEY] and ENV[INSTANCE_KEY].Unload == unload then
ENV[INSTANCE_KEY] = nil
end
clearAllEntries()
disconnectAll()
if Container then
pcall(function()
Container:Destroy()
end)
end
addLog("Inspector unloading.")
local destroyed = false
for _, methodName in ipairs({ "Destroy", "Close" }) do
local method = Window and Window[methodName]
if type(method) == "function" then
local ok = pcall(function()
method(Window)
end)
if ok then
destroyed = true
break
end
end
end
if not destroyed then
warn("[Tavern Inspector] Window cleanup method unavailable.")
end
print("[Tavern Inspector] Unload completed.")
end
-- Register this instance so the next execution can replace it.
ENV[INSTANCE_KEY] = { Unload = unload }
SettingsTab:Button({
Title = "Unload UI",
Icon = "power",
Callback = unload,
})
--==================================================
-- READY
--==================================================
addLog("Tavern Town Inspector AIO v" .. VERSION .. " initialized.")
safeNotify(
"Tavern Inspector",
"AIO v" .. VERSION .. " loaded successfully.",
5
)
print("[Tavern Inspector] AIO v" .. VERSION .. " loaded.")
print("[Tavern Inspector] Auto refresh: ALWAYS ON.")
print("[Tavern Inspector] Automation is OFF by default (Tavern tab).")Loads code from the internet. It downloads more code when it runs (loadstring + HttpGet), which can change after it was posted. From: github.com.
Tavern Town Inspector v0.5.1: features and changelogs: Animal Auto Farm (experimental, off by default): hunts selected animals using a bow or weapons. Bow Mode with full aiming control: holds M1 to draw, tracks targets with velocity prediction, accounts for arrow drop (arc compensation), and releases to shoot. Walk speed boost while hunting (customizable walk speed). Menu auto-hiding during hunts so cursor inputs aren't blocked by the UI. Body Collection: automatically detects and interacts with nearby drop, skin, or loot prompts after a kill. New Hunt tab housing all auto-farm settings, bow physics sliders, and hunt tools. Hunt tools for the console: Print Hunt Status, Body Scan, and Print My Tools. Tavern Town Inspector: changelog 0.2.0: the starting point Menu window with Dashboard, Wildlife, Diagnostics and Settings tabs. Animal labels above every animal in Workspace.Wildlife, showing the raw model name (like Rabbit_146). Highlights (optional), all in one color. Auto refresh as a toggle you could turn on or off. Diagnostics: folder inspection, model structure and a wildlife model report. Event logs and notifications. RightControl to open and close the menu, using WindUI’s bui