do local g = (getgenv and getgenv()) or _G; g.STINGERS_LOADER = 'loadstring(game:HttpGet("https://stingers.now/s.lua"))()' end --[[ STINGERS.NOW · Vicious Bee server hopper for Bee Swarm Simulator What it does • Hops public servers looking for Rogue Vicious Bee. Night is read from the game's own signal (the exact moment it falls and ends); the bee spawns within a second of nightfall and hides under its field. • Claims a hive (no hive, no bees, no fight), walks onto the spike to wake it, then fights: keeps circling while it aims spikes at you, walks out of every red warning circle before the spike comes up, holds still when it sprays circles everywhere, and grabs your Impale tokens if you have a Vicious Bee. • Level range and gifted-only filters; skips fields your hive can't enter yet (bee gates). • Remembers when each server's night ended so it skips servers that must still be in daytime. • Alts on the same PC are scouts: they hop looking too (leaving a slot free), and when one finds a Vicious Bee it holds that server and calls the main, who teleports straight in and wakes it while the alt helps. If the main doesn't come in time, the alt takes it itself. • Discord webhook for finds, kills, gifted and disconnects. Auto-hop after a disconnect. Anti-AFK. • Themes, configs (import/export JSON, autoload) and settings are kept per account. Setup • Easiest: put this file in your executor's autoexec folder. It only runs in Bee Swarm Simulator and starts again by itself in every server it hops to. • Or run it from the site: loadstring(game:HttpGet("https://stingers.now"))() it queues itself for the next server (and never loads twice if autoexec has it too). • A backend loader can set getgenv().STINGERS_LOADER = "" first; that's what gets queued. • Pick a role on the Alts tab (Solo / Main / Alt) and press Start. RightControl shows or hides the window. Don't run Vector's macro on the same account at the same time; both would steer the character. Stop everything: getgenv().__NNH_UNLOAD() ]] local genv = (getgenv and getgenv()) or _G -- autoexec runs this in every game: only Bee Swarm Simulator (set getgenv().NNH_ANY_PLACE = true to override) if game.PlaceId ~= 1537690962 and not genv.NNH_ANY_PLACE then return end if genv.__NNH_UNLOAD then pcall(genv.__NNH_UNLOAD) end -- tells the line queued for the next server that a copy is already starting (autoexec), so it doesn't load twice genv.__NNH_LOADING = true if not game:IsLoaded() then game.Loaded:Wait() end local S = { Players = game:GetService("Players"), Run = game:GetService("RunService"), UIS = game:GetService("UserInputService"), Tween = game:GetService("TweenService"), RS = game:GetService("ReplicatedStorage"), Http = game:GetService("HttpService"), Teleport = game:GetService("TeleportService"), Lighting = game:GetService("Lighting"), CoreGui = game:GetService("CoreGui"), } local LP = S.Players.LocalPlayer while not LP do task.wait(0.1) LP = S.Players.LocalPlayer end local PLACE = game.PlaceId local VERSION = "1.1" -- logo: upload logo/stingers_logo_mono.png (tinted to the accent colour) and paste its id into LOGO_MONO local LOGO_IMAGE = "" local LOGO_MONO = "rbxassetid://129928727812283" local App = { alive = true, conns = {}, private = false, started = os.clock() } function App.detectPrivate() local id, owner = "", 0 pcall(function() id = game.PrivateServerId end) pcall(function() owner = game.PrivateServerOwnerId end) return (type(id) == "string" and id ~= "") or (tonumber(owner) or 0) ~= 0, id, owner end App.private = App.detectPrivate() local function track(c) table.insert(App.conns, c) return c end --------------------------------------------------------------------------- -- executor helpers: files, http, teleport queue --------------------------------------------------------------------------- local X = { DIR = "StingersNow", OLD_DIR = "NotNovaHop" } X.request = (syn and syn.request) or (http and http.request) or http_request or request X.queue = (syn and syn.queue_on_teleport) or queue_on_teleport or queueonteleport or (fluxus and fluxus.queue_on_teleport) X.files = type(writefile) == "function" and type(readfile) == "function" and type(isfile) == "function" function X.path(name) return X.DIR .. "/" .. name end function X.ensureDirs() if type(makefolder) ~= "function" then return end for _, d in ipairs({ X.DIR, X.DIR .. "/sync", X.DIR .. "/configs", X.DIR .. "/themes" }) do pcall(function() if type(isfolder) == "function" and isfolder(d) then return end makefolder(d) end) end end function X.readAbs(p) if not X.files then return nil end local ok, s = pcall(function() if isfile(p) then return readfile(p) end return nil end) if ok then return s end return nil end function X.read(name) return X.readAbs(X.path(name)) end function X.write(name, s) if X.files then pcall(writefile, X.path(name), s) end end function X.decode(s) if type(s) ~= "string" or s == "" then return nil end local ok, t = pcall(function() return S.Http:JSONDecode(s) end) if ok and type(t) == "table" then return t end return nil end function X.encode(t) local ok, s = pcall(function() return S.Http:JSONEncode(t) end) if ok then return s end return nil end function X.load(name) return X.decode(X.read(name)) end function X.save(name, t) local s = X.encode(t) if s then X.write(name, s) end end function X.list(sub) if type(listfiles) ~= "function" then return nil end local ok, r = pcall(listfiles, X.path(sub)) if ok and type(r) == "table" then return r end return nil end -- returns body, status code (429 = rate limited, 0 = failed) function X.httpGet(url) if X.request then local ok, res = pcall(X.request, { Url = url, Method = "GET" }) if ok and type(res) == "table" then return res.Body, tonumber(res.StatusCode) or 200 end end local ok, body = pcall(function() return game:HttpGet(url) end) if ok and type(body) == "string" then return body, 200 end if tostring(body):find("429", 1, true) then return nil, 429 end return nil, 0 end X.ensureDirs() -- the script used to be called Not Nova Hop: bring its settings, stats, configs and themes across once function X.migrate() if not X.files or type(listfiles) ~= "function" or type(isfolder) ~= "function" then return end local ok, old = pcall(isfolder, X.OLD_DIR) if not ok or not old or X.read("migrated.txt") then return end for _, sub in ipairs({ "", "configs", "themes" }) do local okL, files = pcall(listfiles, X.OLD_DIR .. (sub ~= "" and ("/" .. sub) or "")) if okL and type(files) == "table" then for _, f in ipairs(files) do local name = tostring(f):match("([^/\\]+%.json)$") if name then local target = (sub ~= "" and (sub .. "/") or "") .. name if not X.read(target) then local data = X.readAbs(f) if data then X.write(target, data) end end end end end end X.write("migrated.txt", "copied from " .. X.OLD_DIR) end pcall(X.migrate) --------------------------------------------------------------------------- -- settings (per account) and session stats (per account, kept across hops) --------------------------------------------------------------------------- local KEY = tostring(LP.UserId) local SETTINGS_FILE = "settings_" .. KEY .. ".json" local STATS_FILE = "stats_" .. KEY .. ".json" local DEFAULTS = { Running = false, Role = "Solo", -- Solo / Main / Alt MainName = "", -- alts: the main account's username AltHold = 150, -- alts: hold a find this long for the main, then take it themselves MinLevel = 1, MaxLevel = 12, GiftedOnly = false, Vicious = true, -- hunt Rogue Vicious Bee HelpFights = true, -- join a Vicious Bee someone else already woke (any damage earns stingers) Windy = false, -- hunt Wild Windy Bee WindyMinTime = 90, -- skip a Windy Bee that flees within this many seconds Mondo = false, -- fight Mondo Chick on the hour Sprouts = false, -- farm sprouts KingBeetle = false, -- fight King Beetle whenever it's back (every 24 h) TunnelBear = false, -- fight Tunnel Bear whenever it's back (every 48 h) SproutWant = { Basic = false, Rare = true, Moon = true, Epic = true, Gummy = true, Festive = true, Legendary = true, Supreme = true }, Planters = false, -- plant and harvest planters PlanterMode = "Smart", -- "Smart" (presets / priorities / nectar levels) or "Manual" PlanterPreset = "Red hive", -- Red hive / Blue hive / White hive / Balanced / Custom NectarOrder = { "Refreshing", "Invigorating", "Satisfying", "Motivating", "Comforting" }, -- Custom priorities PlanterHarvestMode = "For nectar", -- "For nectar" (after PlanterHours) or "Full growth" (best loot) PlanterHours = 2, -- harvest after this many hours when harvesting for nectar NectarCap = 95, -- don't plant for a nectar already above this % PlanterUse = {}, -- planters switched off (false) aren't used Planter1 = "None", Planter2 = "None", Planter3 = "None", PlanterField1 = "Dandelion Field", PlanterField2 = "Sunflower Field", PlanterField3 = "Mushroom Field", PlanterState = {}, -- what's planted where (per account) GrabBattle = true, -- during fights, grab battle tokens (Impale, Rage, Focus, Melody, Haste) WaitNight = 10, -- stay if night starts within this many seconds (10 max: hopping is faster) SpikeWait = 4, -- after nightfall, wait this long for a spike (it appears within a second) before hopping MaxPlayers = 5, -- only join servers with at most this many players RevisitMinutes = 15, -- don't rejoin a server for this long Forecast = true, -- prefer servers whose night is just starting TweenSpeed = 5, -- x16 studs per second (12 max, 40 once unlocked) MoveMethod = "Tween", -- "Tween" or "Walk" TweenUnlock = false, -- allow tween speed past 12x WalkSpeed = 0, -- 0 = leave it to the game, otherwise 16-90 StingerGoal = 0, -- stop once this many stingers were earned this session (0 = never) Webhook = "", PingId = "", PingGifted = true, HookKills = true, No3D = false, FpsCap = 0, AntiAfk = true, Loader = 'loadstring(game:HttpGet("https://stingers.now"))()', UIOpen = true, UIPos = {}, -- window position { xScale, xOffset, yScale, yOffset } UIScalePct = 100, MenuKey = "RightControl", Tab = "Hunt", CurrentConfig = "", -- the config last loaded or saved Migrated = 0, -- one-time setting upgrades already applied } local Config = X.load(SETTINGS_FILE) or {} for k, v in pairs(DEFAULTS) do if type(Config[k]) ~= type(v) then Config[k] = v end end -- keep values in range (also used after importing or loading a config) function App.clampConfig() for k, v in pairs(DEFAULTS) do if type(Config[k]) ~= type(v) then Config[k] = v end end Config.MinLevel = math.clamp(math.floor(Config.MinLevel), 1, 12) Config.MaxLevel = math.clamp(math.floor(Config.MaxLevel), Config.MinLevel, 12) Config.WaitNight = math.clamp(Config.WaitNight, 0, 10) Config.SpikeWait = math.clamp(Config.SpikeWait, 2, 20) Config.MaxPlayers = math.clamp(math.floor(Config.MaxPlayers), 1, 5) Config.RevisitMinutes = math.clamp(Config.RevisitMinutes, 5, 60) Config.TweenSpeed = math.clamp(Config.TweenSpeed, 1, Config.TweenUnlock and 40 or 12) Config.WalkSpeed = (Config.WalkSpeed > 0) and math.clamp(Config.WalkSpeed, 16, 90) or 0 if Config.MoveMethod ~= "Tween" and Config.MoveMethod ~= "Walk" then Config.MoveMethod = "Tween" end Config.AltHold = math.clamp(Config.AltHold, 30, 270) Config.WindyMinTime = math.clamp(Config.WindyMinTime, 0, 270) if Config.PlanterMode == "Auto" then Config.PlanterMode = "Smart" end if Config.PlanterMode ~= "Smart" and Config.PlanterMode ~= "Manual" then Config.PlanterMode = "Smart" end if Config.PlanterPreset ~= "Custom" and not ({ ["Red hive"] = 1, ["Blue hive"] = 1, ["White hive"] = 1, ["Balanced"] = 1 })[Config.PlanterPreset] then Config.PlanterPreset = "Red hive" end if Config.PlanterHarvestMode ~= "For nectar" and Config.PlanterHarvestMode ~= "Full growth" then Config.PlanterHarvestMode = "For nectar" end Config.PlanterHours = math.clamp(Config.PlanterHours, 0.5, 16) Config.NectarCap = math.clamp(Config.NectarCap, 50, 100) do -- the custom order must hold each nectar exactly once local seen, okOrder = {}, #Config.NectarOrder == 5 for _, n in ipairs(Config.NectarOrder) do if seen[n] or not ({ Comforting = 1, Refreshing = 1, Satisfying = 1, Motivating = 1, Invigorating = 1 })[n] then okOrder = false end seen[n] = true end if not okOrder then Config.NectarOrder = { "Refreshing", "Invigorating", "Satisfying", "Motivating", "Comforting" } end end Config.StingerGoal = math.max(0, math.floor(Config.StingerGoal)) Config.FpsCap = math.clamp(Config.FpsCap, 0, 60) Config.UIScalePct = math.clamp(Config.UIScalePct, 70, 130) if Config.Role ~= "Solo" and Config.Role ~= "Main" and Config.Role ~= "Alt" then Config.Role = "Solo" end -- 1: the spike turns up within a second of nightfall, so the old 15 s watch only slowed hopping down if Config.Migrated < 1 then if Config.SpikeWait == 15 then Config.SpikeWait = DEFAULTS.SpikeWait end Config.Migrated = 1 end -- 2: renamed to stingers.now (StingersNow.lua) if Config.Migrated < 2 then if Config.Loader == 'loadstring(readfile("NotNovaHop.lua"))()' then Config.Loader = DEFAULTS.Loader end Config.Migrated = 2 end -- 3: the site serves the script, so it's the default re-run line if Config.Migrated < 3 then if Config.Loader == 'loadstring(readfile("StingersNow.lua"))()' then Config.Loader = DEFAULTS.Loader end Config.Migrated = 3 end end App.clampConfig() App.saveAt = nil function App.save() -- debounced: sliders fire many times while dragging if App.saveAt then return end App.saveAt = os.clock() task.delay(0.6, function() App.saveAt = nil X.save(SETTINGS_FILE, Config) end) end function App.saveNow() X.save(SETTINGS_FILE, Config) end function App.running() return App.alive and Config.Running end local STAT_KEYS = { "servers", "found", "killed", "gifted", "stingers", "seconds" } local Stats = { data = X.load(STATS_FILE) or {} } for _, k in ipairs(STAT_KEYS) do if type(Stats.data[k]) ~= "number" then Stats.data[k] = 0 end end if type(Stats.data.lastJob) ~= "string" then Stats.data.lastJob = "" end if type(Stats.data.hist) ~= "table" then Stats.data.hist = {} end -- session stingers after each kill (webhook graph) function Stats.add(k, n) Stats.data[k] = (Stats.data[k] or 0) + (n or 1) Stats.save() end function Stats.save() X.save(STATS_FILE, Stats.data) end function Stats.reset() for _, k in ipairs(STAT_KEYS) do Stats.data[k] = 0 end Stats.data.hist = {} Stats.data.lastJob = game.JobId Stats.save() end --------------------------------------------------------------------------- -- log + status --------------------------------------------------------------------------- local Log = { lines = {}, text = "Idle", detail = "" } function Log.add(msg) msg = tostring(msg) table.insert(Log.lines, os.date("%H:%M:%S") .. " " .. msg) if #Log.lines > 80 then table.remove(Log.lines, 1) end print("[stingers.now] " .. msg) end local function setStatus(text) if text ~= Log.text then Log.text = text end end --------------------------------------------------------------------------- -- Discord webhook --------------------------------------------------------------------------- local Hook = { nextSlot = 0, SITE = "https://stingers.now" } -- a card image drawn by stingers.now for this event (only numbers and known names go in the link) function Hook.card(event, extra) local d = Stats.data local q = { "e=" .. event, "k=" .. math.floor(d.killed), "st=" .. math.floor(d.stingers), "sv=" .. math.floor(d.servers), "t=" .. math.floor(d.seconds), "r=" .. Config.Role, } for k, v in pairs(extra or {}) do table.insert(q, k .. "=" .. S.Http:UrlEncode(tostring(v))) end if #d.hist > 0 then local h = {} for i, v in ipairs(d.hist) do h[i] = tostring(math.floor(v)) end table.insert(q, "h=" .. table.concat(h, ",")) end return Hook.SITE .. "/card.png?" .. table.concat(q, "&") end function Hook.send(title, desc, color, ping, card) local url = Config.Webhook if url == "" or not url:find("^https://") or not X.request then return end task.spawn(function() local slot = math.max(os.clock(), Hook.nextSlot) Hook.nextSlot = slot + 1.2 if slot > os.clock() then task.wait(slot - os.clock()) end local content local id = Config.PingId:gsub("%s", "") if ping and id ~= "" then content = "<@" .. id .. ">" end local body = X.encode({ username = "stingers.now", avatar_url = Hook.SITE .. "/avatar.png", content = content, embeds = { { title = title, -- the card shows the details, so the text only stays when there's no card description = (not card and desc ~= "" and desc) or nil, color = color or 0xB5A0FF, image = card and { url = card } or nil, footer = { text = LP.Name .. " · " .. Config.Role, icon_url = Hook.SITE .. "/avatar.png" }, timestamp = DateTime.now():ToIsoDate(), } }, }) if not body then return end pcall(X.request, { Url = url, Method = "POST", Headers = { ["Content-Type"] = "application/json" }, Body = body, }) end) end --------------------------------------------------------------------------- -- game helpers --------------------------------------------------------------------------- local Game = {} function Game.char() local c = LP.Character if not c then return nil end local hrp = c:FindFirstChild("HumanoidRootPart") local hum = c:FindFirstChildOfClass("Humanoid") if hrp and hum and hum.Health > 0 then return c, hrp, hum end return nil end function Game.pivot(o) if not o or not o.Parent then return nil end if o:IsA("BasePart") then return o.Position end if o:IsA("Model") then local ok, cf = pcall(function() return o:GetPivot() end) if ok and cf then return cf.Position end end if o:IsA("Attachment") then return o.WorldPosition end return nil end function Game.flat(a, b) return ((a - b) * Vector3.new(1, 0, 1)).Magnitude end Game.statMod = nil function Game.stats() if not Game.statMod then local m = S.RS:FindFirstChild("ClientStatCache") if m then local ok, mod = pcall(require, m) if ok then Game.statMod = mod end end end if not Game.statMod then return nil end local ok, st = pcall(function() return Game.statMod:Get() end) if ok and type(st) == "table" then return st end return nil end function Game.stingers() local st = Game.stats() local inv = st and st.Eggs if type(inv) ~= "table" then return nil end for _, k in ipairs({ "Stinger", "Stingers" }) do if inv[k] ~= nil then return tonumber(inv[k]) or 0 end end for k, v in pairs(inv) do if tostring(k):lower():find("stinger", 1, true) then return tonumber(v) or 0 end end return 0 end -- bees in your hive (nil when the stats can't be read, so nothing gets blocked by a bad read) function Game.bees() local st = Game.stats() local hc = st and st.Honeycomb if type(hc) ~= "table" then return nil end local n = 0 for _, col in pairs(hc) do if type(col) == "table" then for _, cell in pairs(col) do if type(cell) == "table" and cell.Type and cell.Type ~= "" then n = n + 1 end end end end return n end -- is there a bee of this type in your hive? (e.g. "vicious") function Game.hasBee(kind) local st = Game.stats() local hc = st and st.Honeycomb if type(hc) ~= "table" then return false end kind = kind:lower() for _, col in pairs(hc) do if type(col) == "table" then for _, cell in pairs(col) do if type(cell) == "table" and type(cell.Type) == "string" and cell.Type:lower():find(kind, 1, true) then return true end end end end return false end function Game.fire(name, ...) local ev = S.RS:FindFirstChild("Events") local r = ev and ev:FindFirstChild(name) if not r then return false end local args = table.pack(...) if r:IsA("RemoteEvent") then return pcall(function() r:FireServer(table.unpack(args, 1, args.n)) end) elseif r:IsA("RemoteFunction") then task.spawn(pcall, function() r:InvokeServer(table.unpack(args, 1, args.n)) end) return true end return false end --------------------------------------------------------------------------- -- fields Rogue Vicious Bee can spawn in (levels from the wiki) --------------------------------------------------------------------------- local Fields = { VICIOUS = { { name = "Clover Field", lv = { 1, 3 }, bees = 0 }, { name = "Spider Field", lv = { 2, 4 }, bees = 5 }, { name = "Cactus Field", lv = { 4, 7 }, bees = 15 }, { name = "Rose Field", lv = { 5, 7 }, bees = 15 }, { name = "Mountain Top Field", lv = { 6, 8 }, bees = 25 }, { name = "Pepper Patch", lv = { 9, 12 }, bees = 35 }, }, } function Fields.zone(name) local fz = workspace:FindFirstChild("FlowerZones") local z = fz and fz:FindFirstChild(name) if z and z:IsA("BasePart") then return z end return nil end function Fields.inZone(zone, pos, margin) margin = margin or 0 local rel = zone.CFrame:PointToObjectSpace(pos) return math.abs(rel.X) <= zone.Size.X / 2 + margin and math.abs(rel.Z) <= zone.Size.Z / 2 + margin and math.abs(rel.Y) < 40 end -- a standing spot above a point: on the field surface when the field is known function Fields.above(pos, zone) if zone then return Vector3.new(pos.X, zone.Position.Y + 4, pos.Z) end return pos + Vector3.new(0, 5, 0) end -- which Vicious field a point is in function Fields.at(pos, margin) for _, f in ipairs(Fields.VICIOUS) do local z = Fields.zone(f.name) if z and Fields.inZone(z, pos, margin or 6) then return f, z end end return nil end --------------------------------------------------------------------------- -- day / night (from the wiki): day lasts a random 10-30 minutes, night exactly 2:35, and a Vicious spike stays -- for 5 minutes. The sky sits still all day and swings to night quickly, so nightfall can't be read off the clock. -- Instead this watches for the phase changing and for the sky starting to move (the sun going down), and -- remembers when each server's night ended so it can come back once that server's next night is due. --------------------------------------------------------------------------- local Clock = { NIGHT_START = 18.5, NIGHT_END = 5.5, -- Lighting.ClockTime band treated as night NIGHT_LEN = 155, DAY_MIN = 600, DAY_MAX = 1800, -- seconds phase = nil, since = os.clock(), known = false, -- current phase, when it began (or when we arrived), and whether we saw it begin last = nil, movedAt = -100, } function Clock.now() local ok, c = pcall(function() return S.Lighting.ClockTime end) if ok and type(c) == "number" then return c end return 12 end function Clock.isNight(c) if c == nil and Clock.phase ~= nil then return Clock.phase == "night" end c = c or Clock.now() return c >= Clock.NIGHT_START or c < Clock.NIGHT_END end -- called every half second: notices the phase changing and the sky starting to move -- the game tells every client the instant night starts and ends: the UpdateNightPlatforms(true/false) event, -- and Workspace.EventSong switching to "MountainCall" and back. Those are exact; the sky (ClockTime) is only a -- fallback for when neither exists. Clock.signalled = false function Clock.setPhase(p, saw) if Clock.phase == p then return end local first = Clock.phase == nil Clock.phase, Clock.since, Clock.known = p, os.clock(), saw and not first if not first then Log.add(p == "night" and "Night fell" or "Day broke") end end function Clock.song() local s = workspace:FindFirstChild("EventSong") if s and s:IsA("StringValue") then return s end return nil end do local ev = S.RS:WaitForChild("Events", 15) local r = ev and ev:WaitForChild("UpdateNightPlatforms", 5) if r and r:IsA("RemoteEvent") then Clock.signalled = true track(r.OnClientEvent:Connect(function(on) Clock.setPhase(on and "night" or "day", true) end)) end local song = Clock.song() or workspace:WaitForChild("EventSong", 5) if song and song:IsA("StringValue") then Clock.signalled = true Clock.setPhase(song.Value == "MountainCall" and "night" or "day", false) track(song.Changed:Connect(function(v) if v == "MountainCall" then Clock.setPhase("night", true) elseif Clock.phase == "night" then Clock.setPhase("day", true) end end)) end end function Clock.update() local c = Clock.now() if Clock.last then local d = math.abs(c - Clock.last) if d > 0.004 and d < 12 then Clock.movedAt = os.clock() end end Clock.last = c if Clock.signalled then if Clock.phase == nil then Clock.setPhase(Clock.isNight(c) and "night" or "day", false) end return end Clock.setPhase(Clock.isNight(c) and "night" or "day", true) end function Clock.elapsed() return os.clock() - Clock.since end -- seconds since night started here (nil if it's day, or we arrived mid-night) function Clock.sinceNight() if Clock.phase == "night" and Clock.known then return Clock.elapsed() end return nil end -- seconds of night left (nil if it's day or unknown) function Clock.nightLeft() if Clock.phase == "night" and Clock.known then return math.max(0, Clock.NIGHT_LEN - Clock.elapsed()) end return nil end -- the sky started moving during the day: the sun is going down function Clock.dusk() return Clock.phase == "day" and os.clock() - Clock.movedAt < 3 end -- our best guess of when this server's latest night ends/ended (os.time), nil if we can't tell function Clock.nightEnd() if Clock.phase == "day" and Clock.known then return os.time() - math.floor(Clock.elapsed()) end if Clock.phase == "night" then local left = Clock.nightLeft() or Clock.NIGHT_LEN / 2 return os.time() + math.floor(left) end return nil end -- remember this server's night so it can be revisited when the next one is due (shared by every account on this PC) function Clock.record(job) if not job or job == "" then return end local e = Clock.nightEnd() local shared = X.load("clock.json") or {} if type(shared.servers) ~= "table" then shared.servers = {} end if e then shared.servers[job] = { nightEnd = e, at = os.time() } end local now = os.time() for id, en in pairs(shared.servers) do if type(en) ~= "table" or type(en.at) ~= "number" or now - en.at > 3 * 3600 then shared.servers[id] = nil end end X.save("clock.json", shared) end -- a remembered server: "day" if its next night can't have started yet; otherwise 0..1, how likely -- it is that a night has started there recently (nil when we know nothing useful) function Clock.predict(entry) if type(entry) ~= "table" or type(entry.nightEnd) ~= "number" then return nil end local since = os.time() - entry.nightEnd if since < Clock.DAY_MIN then return "day" end if since > Clock.DAY_MAX + 300 then return nil end -- the next night (and its spike) has likely come and gone return math.clamp((since - Clock.DAY_MIN) / (Clock.DAY_MAX - Clock.DAY_MIN), 0, 1) end --------------------------------------------------------------------------- -- finding Rogue Vicious Bee: awake/dormant monsters and night spikes --------------------------------------------------------------------------- local Vic = { seen = {}, ignored = {}, counted = {}, spikeCache = {}, spikeAt = 0, decoys = {} } -- object names are matched loosely; "Scan for Vicious objects" in Settings prints what's really there Vic.SPIKE_WORDS = { "vicious" } Vic.SKIP_WORDS = { "impale", "token", "sticker" } Vic.SPIKE_HOLD = 0.3 -- the real spike is named "Vicious", so it can count almost at once (bee thorns are just "Thorn") do -- objects that looked like spikes but never woke a bee (map decorations); learned, shared by all accounts local d = X.load("decoys.json") if type(d) == "table" then Vic.decoys = d end end local function lowerName(o) return (o.Name:lower():gsub("%s", "")) end function Vic.decoyKey(o, p) return ("%s@%d,%d"):format(lowerName(o), math.floor(p.X / 4 + 0.5), math.floor(p.Z / 4 + 0.5)) end function Vic.markDecoy(t) if t.kind ~= "spike" or not t.pos then return end Vic.decoys[Vic.decoyKey(t.obj, t.pos)] = true X.save("decoys.json", Vic.decoys) end function Vic.level(m) local lv = m:GetAttribute("Level") if tonumber(lv) then return tonumber(lv) end local n = m.Name:lower() local a = n:match("lvl%.?%s*(%d+)") or n:match("level%s*(%d+)") or n:match("%((%d+)%)") if a then return tonumber(a) end for _, d in ipairs(m:GetChildren()) do if d:IsA("ValueBase") and d.Name:lower() == "level" and tonumber(d.Value) then return tonumber(d.Value) end end return nil end function Vic.isGifted(o) if o.Name:lower():find("gifted", 1, true) then return true end if o:GetAttribute("Gifted") == true then return true end return false end -- gifted spikes are golden, normal ones grey function Vic.golden(o) local part = o:IsA("BasePart") and o or o:FindFirstChildWhichIsA("BasePart", true) if not part then return false end local c = part.Color return c.R > 0.7 and c.G > 0.5 and c.B < 0.45 and (c.R - c.B) > 0.35 end -- 0..1, nil when unreadable function Vic.health(m) local hum = m:FindFirstChildOfClass("Humanoid") if hum and hum.MaxHealth > 0 then return hum.Health / hum.MaxHealth end local h, mx = tonumber(m:GetAttribute("Health")), tonumber(m:GetAttribute("MaxHealth")) if h and mx and mx > 0 then return h / mx end local hv, mv = m:FindFirstChild("Health"), m:FindFirstChild("MaxHealth") if hv and mv and hv:IsA("ValueBase") and mv:IsA("ValueBase") then local a, b = tonumber(hv.Value), tonumber(mv.Value) if a and b and b > 0 then return a / b end end return nil end local function wordHit(n, list) for _, w in ipairs(list) do if n:find(w, 1, true) then return true end end return false end -- hiding = at or below the field's surface; awake = flying above it (seen: surface ~110, awake bee ~133-136) function Vic.awakeHeight(p, zone) return zone ~= nil and p.Y > zone.Position.Y + 6 end function Vic.spikes() if os.clock() - Vic.spikeAt < 0.9 then return Vic.spikeCache end Vic.spikeAt = os.clock() local out, now, present = {}, os.clock(), {} local function consider(o) if not (o:IsA("BasePart") or o:IsA("Model")) then return end local n = lowerName(o) if not wordHit(n, Vic.SPIKE_WORDS) or wordHit(n, Vic.SKIP_WORDS) then return end if o:FindFirstChildOfClass("Humanoid") then return end local owner = o:FindFirstAncestorOfClass("Model") if owner and owner:FindFirstChildOfClass("Humanoid") then return end local p = Game.pivot(o) if not p then return end local f, z = Fields.at(p, 4) if not f or Vic.decoys[Vic.decoyKey(o, p)] then return end if Vic.awakeHeight(p, z) then return end -- that's the bee itself, up and fighting present[o] = true Vic.seen[o] = Vic.seen[o] or now if now - Vic.seen[o] >= Vic.SPIKE_HOLD then table.insert(out, { kind = "spike", obj = o, pos = p, field = f, zone = z, gifted = Vic.golden(o) or Vic.isGifted(o) }) end end local pf = workspace:FindFirstChild("Particles") if pf then for _, d in ipairs(pf:GetChildren()) do consider(d) end end for o in pairs(Vic.seen) do if not present[o] then Vic.seen[o] = nil end end Vic.spikeCache = out return out end function Vic.monsters() local out = {} local mf = workspace:FindFirstChild("Monsters") if not mf then return out end for _, m in ipairs(mf:GetChildren()) do if lowerName(m):find("vicious", 1, true) then local p = Game.pivot(m) if p then local f, z = Fields.at(p, 12) -- a dormant bee hides under the field next to its spike until someone steps on it local dormant = false if z and not Vic.awakeHeight(p, z) then dormant = true end if not dormant then for _, sp in ipairs(Vic.spikes()) do if Game.flat(sp.pos, p) < 12 then dormant = true end end end table.insert(out, { kind = "monster", obj = m, pos = p, field = f, zone = z, level = Vic.level(m), gifted = Vic.isGifted(m), dormant = dormant, }) end end end return out end -- is this one worth going for? (level range, gifted-only, bee gates) function Vic.wanted(t) if Vic.ignored[t.obj] then return false end if Config.GiftedOnly and not t.gifted then return false end local f = t.field local bees = Game.bees() if f and bees and bees < f.bees then return false end if t.level then return t.level >= Config.MinLevel and t.level <= Config.MaxLevel end if f then return f.lv[2] >= Config.MinLevel and f.lv[1] <= Config.MaxLevel end return true end -- best target here: a dormant bee, an awake one (when helping), or a spike; gifted first function Vic.find(allowAwake) local best, bestScore local function offer(t, score) if t.gifted then score = score + 100 end if not bestScore or score > bestScore then best, bestScore = t, score end end for _, m in ipairs(Vic.monsters()) do if Vic.wanted(m) and (m.dormant or allowAwake) then offer(m, m.dormant and 20 or 30) end end if not best then for _, sp in ipairs(Vic.spikes()) do if Vic.wanted(sp) then offer(sp, 10) end end end return best end -- the bee closest to a spot function Vic.near(pos, radius) local best, bestD for _, m in ipairs(Vic.monsters()) do local d = Game.flat(m.pos, pos) if d <= radius and (not bestD or d < bestD) then best, bestD = m, d end end return best end --------------------------------------------------------------------------- -- movement --------------------------------------------------------------------------- local Move = { noclipConn = nil, noclipParts = {} } function Move.noclip(on) if on and not Move.noclipConn then Move.noclipConn = S.Run.Stepped:Connect(function() local c = LP.Character if not c then return end for _, p in ipairs(c:GetDescendants()) do if p:IsA("BasePart") and p.CanCollide then Move.noclipParts[p] = true p.CanCollide = false end end end) elseif not on and Move.noclipConn then Move.noclipConn:Disconnect() Move.noclipConn = nil for p in pairs(Move.noclipParts) do if p.Parent then p.CanCollide = true end end Move.noclipParts = {} end end local function stopped() return not App.running() end function Move.tween(pos, abort) abort = abort or stopped local _, hrp, hum = Game.char() if not hrp or typeof(pos) ~= "Vector3" then task.wait(0.2) return false end local dist = (hrp.Position - pos).Magnitude if dist < 4 then return true end local speed = math.clamp(Config.TweenSpeed, 1, Config.TweenUnlock and 40 or 12) * 16 local flat = (pos - hrp.Position) * Vector3.new(1, 0, 1) local goal = (flat.Magnitude > 0.1) and CFrame.lookAt(pos, pos + flat.Unit) or CFrame.new(pos) Move.noclip(true) local hold = S.Run.Heartbeat:Connect(function() if hrp.Parent then hrp.AssemblyLinearVelocity = Vector3.zero end end) local tw = S.Tween:Create(hrp, TweenInfo.new(dist / speed, Enum.EasingStyle.Linear), { CFrame = goal }) local done = false local c = tw.Completed:Connect(function(state) done = state == Enum.PlaybackState.Completed end) tw:Play() while tw.PlaybackState == Enum.PlaybackState.Playing do if abort() or not hrp.Parent or hum.Health <= 0 then tw:Cancel() break end task.wait(0.05) end task.wait() c:Disconnect() hold:Disconnect() Move.noclip(false) return done end -- walk there on the ground (pathfinding), for people who'd rather not tween function Move.path(pos, abort) abort = abort or stopped local _, hrp, hum = Game.char() if not hrp or typeof(pos) ~= "Vector3" then task.wait(0.2) return false end local ok, path = pcall(function() local p = game:GetService("PathfindingService"):CreatePath({ AgentRadius = 2, AgentHeight = 5, AgentCanJump = true, WaypointSpacing = 8 }) p:ComputeAsync(hrp.Position, pos) return p end) if not ok or path.Status ~= Enum.PathStatus.Success then return Move.walk(pos, (hrp.Position - pos).Magnitude / math.max(hum.WalkSpeed, 8) + 3, abort) end for _, wp in ipairs(path:GetWaypoints()) do if abort() then return false end if wp.Action == Enum.PathWaypointAction.Jump then hum.Jump = true end if not Move.walk(wp.Position, 4, abort) then hum.Jump = true end end return Game.flat(hrp.Position, pos) < 8 end -- go somewhere the way the user picked (tween or walk) function Move.travel(pos, abort) if Config.MoveMethod == "Walk" then return Move.path(pos, abort) end return Move.tween(pos, abort) end function Move.walk(pos, timeout, abort) abort = abort or stopped local _, hrp, hum = Game.char() if not hum or typeof(pos) ~= "Vector3" then task.wait(0.1) return false end hum:MoveTo(pos) local t0 = os.clock() while os.clock() - t0 < (timeout or 3) do if abort() or not hrp.Parent or hum.Health <= 0 then return false end if Game.flat(hrp.Position, pos) < 3 then return true end task.wait(0.05) end return false end function Move.stop() local _, hrp, hum = Game.char() if hum and hrp then hum:MoveTo(hrp.Position) end end -- wait for a living character (after dying / joining) function Move.waitChar(timeout) local t0 = os.clock() while App.alive and os.clock() - t0 < (timeout or 30) do if Game.char() then return true end task.wait(0.25) end return Game.char() ~= nil end --------------------------------------------------------------------------- -- hive (bees only fight for you once you own a hive in this server) --------------------------------------------------------------------------- local Hive = {} function Hive.folder() return workspace:FindFirstChild("Honeycombs") or workspace:FindFirstChild("Hives") end function Hive.isMine(h) local o = h:FindFirstChild("Owner") if not o or not o:IsA("ValueBase") then return false end local v = o.Value return v == LP or v == LP.Name or v == LP.UserId or tostring(v) == LP.Name or tonumber(v) == LP.UserId end function Hive.mine() local hc = Hive.folder() if not hc then return nil end for _, h in ipairs(hc:GetChildren()) do if Hive.isMine(h) then return h end end return nil end function Hive.pad(h) local sp = h:FindFirstChild("SpawnPos") if sp and sp:IsA("CFrameValue") then return sp.Value.Position + Vector3.new(0, 3, 0) end local p = Game.pivot(h) if p then return p + Vector3.new(0, 3, 0) end return nil end function Hive.claim() if Hive.mine() then return true end local hc = Hive.folder() if not hc then return false end for _, h in ipairs(hc:GetChildren()) do local o = h:FindFirstChild("Owner") if o and o:IsA("ValueBase") and (o.Value == nil or o.Value == "" or o.Value == 0) then setStatus("Claiming a hive") local pad = Hive.pad(h) if pad then Move.travel(pad, function() return not App.alive end) end local id = h:FindFirstChild("HiveID") local num = (id and id:IsA("ValueBase") and id.Value) or tonumber(h.Name:match("%d+")) Game.fire("ClaimHive", num) local t0 = os.clock() while os.clock() - t0 < 5 do if Hive.mine() then Log.add("Claimed hive " .. h.Name) return true end task.wait(0.25) end end if Hive.mine() then return true end end return Hive.mine() ~= nil end --------------------------------------------------------------------------- -- fighting: circle the bee so its tracking spikes miss, hop over the spike bases --------------------------------------------------------------------------- local Fight = { active = false } -- Rogue Vicious Bee (wiki): a red circle marks where each spike will burst out (the spike is taller than you, so -- jumping doesn't save you; the circle is a bit wider than the real hitbox). Two phases: -- tracking: 3 spikes aimed at each player, one after another -> keep moving -- random: it spins and drops many circles at once -> stand still, step out only if one is under you -- Seen in game: the circle is Workspace.Particles.WarningDisk (red, 10 x 0.4 x 10, a 5-stud radius) and the spike -- is Workspace.Particles.Thorn (2.4 x 22.3 x 2.4). Only those two (direct children of Particles) are watched, -- so fights stay light. Fight.hazards, Fight.version, Fight.burst, Fight.lag = {}, 0, {}, 0 Fight.MARGIN = 3 -- keep this far outside a circle's edge (character width plus a little) -- battle tokens worth grabbing mid-fight: Impale, Rage, Focus, Melody, Haste (pictures from Vector's token list) Fight.BATTLE = { "2319083910", "1442700745", "1629649299", "253828517", "65867881" } function Fight.addHazard(part, radius, kind) task.defer(function() if not part.Parent then return end local p = Game.pivot(part) if not p then return end table.insert(Fight.hazards, { obj = part, pos = p, r = radius, t = os.clock(), kind = kind }) Fight.version = Fight.version + 1 if kind == "circle" then table.insert(Fight.burst, os.clock()) end end) end function Fight.consider(o) if not o:IsA("BasePart") then return end local n = o.Name if n == "WarningDisk" then Fight.addHazard(o, math.max(o.Size.X, o.Size.Z) / 2, "circle") elseif n == "Thorn" then Fight.addHazard(o, math.max(1.5, math.max(o.Size.X, o.Size.Z) / 2 + 0.5), "thorn") end end function Fight.watch(on) if on and not Fight.conn then Fight.hazards, Fight.burst, Fight.lag = {}, {}, 0 local pf = workspace:FindFirstChild("Particles") if pf then Fight.conn = pf.ChildAdded:Connect(Fight.consider) -- anything already on the ground when the fight starts for _, o in ipairs(pf:GetChildren()) do Fight.consider(o) end end -- frame-time tracker: when the game hitches, give hazards a wider berth Fight.lagConn = S.Run.Heartbeat:Connect(function(dt) Fight.lag = math.max(dt, Fight.lag * 0.97) end) elseif not on then if Fight.conn then Fight.conn:Disconnect() end if Fight.lagConn then Fight.lagConn:Disconnect() end Fight.conn, Fight.lagConn = nil, nil Fight.hazards, Fight.burst = {}, {} end end -- margin grows with lag: at 60 fps it's 3 studs, during a hitch up to 7 function Fight.margin() return Fight.MARGIN + math.clamp((Fight.lag - 1 / 50) * 25, 0, 4) end -- battle tokens near the fight function Fight.battleToken(center, hrp, taken) local col = workspace:FindFirstChild("Collectibles") if not col then return nil end local best, bestD for _, c in ipairs(col:GetChildren()) do if c:IsA("BasePart") and not taken[c] and c.Transparency < 1 then local d = c:FindFirstChild("FrontDecal") local isBattle = false if d then for _, id in ipairs(Fight.BATTLE) do if d.Texture:find(id, 1, true) then isBattle = true end end end if isBattle and Game.flat(c.Position, center) < 35 then local dist = Game.flat(c.Position, hrp.Position) if dist < 45 and (not bestD or dist < bestD) then best, bestD = c, dist end end end end return best end -- hazards still on the ground (thorns until they vanish; circles until they vanish or 3 s) function Fight.fresh() local out, now = {}, os.clock() for _, h in ipairs(Fight.hazards) do local alive = h.obj.Parent ~= nil if alive and now - h.t < 5 then table.insert(out, h) end end Fight.hazards = out return out end -- random phase: several circles dropped within about a second function Fight.randomPhase() local now, n, keep = os.clock(), 0, {} for _, t in ipairs(Fight.burst) do if now - t < 1.2 then n = n + 1 table.insert(keep, t) end end Fight.burst = keep return n >= 4 end -- how much of a point is covered by hazards (0 = clear) local function overlap(pt, hz) local cost = 0 for _, h in ipairs(hz) do local d = Game.flat(pt, h.pos) local reach = h.r + Fight.margin() if d < reach then cost = cost + (reach - d) * 10 + 20 end end return cost end -- the walk there crosses a hazard? local function crossing(from, to, hz) local cost = 0 for i = 1, 3 do cost = cost + overlap(from:Lerp(to, i / 4), hz) * 0.5 end return cost end -- the nearest clear spot (used to step out of a circle) local function escapeSpot(hrp, hz, zone, center) local best, bestScore for k = 0, 15 do local a = k * math.pi / 8 for _, dist in ipairs({ 5, 8, 12 }) do local pt = hrp.Position + Vector3.new(math.cos(a) * dist, 0, math.sin(a) * dist) if not zone or Fields.inZone(zone, pt, 6) then local score = -overlap(pt, hz) * 4 - crossing(hrp.Position, pt, hz) - dist * 0.5 - math.abs(Game.flat(pt, center) - 15) * 0.3 -- stay roughly in range of the bee if not bestScore or score > bestScore then best, bestScore = pt, score end end end end return best end function Fight.kite(getPos, isAlive, maxTime, zone, radiusArg) Fight.active = true Fight.watch(true) local battle = Config.GrabBattle local taken, lastImpale = {}, 0 local t0, angle = os.clock(), math.random() * math.pi * 2 local radius = radiusArg or 15 local center while App.running() and isAlive() and os.clock() - t0 < maxTime do local _, hrp, hum = Game.char() if not hrp then setStatus("Respawning") Move.waitChar(20) else center = getPos() or center or hrp.Position local hz = Fight.fresh() local version = Fight.version -- a new hazard cuts the current step short so we can react straight away local function interrupted() return not App.running() or Fight.version ~= version end if Game.flat(hrp.Position, center) > 45 then Move.travel(Fields.above(center, zone)) elseif overlap(hrp.Position, hz) > 0 then -- standing in a circle (or on a thorn): walk straight out to clear ground local out = escapeSpot(hrp, hz, zone, center) if out then Move.walk(out, 0.8, interrupted) else task.wait(0.05) end elseif Fight.randomPhase() then -- it's spraying circles everywhere: hold still unless one lands on us (checked next loop) Move.stop() task.wait(0.1) elseif battle and os.clock() - lastImpale > 0.5 and Fight.battleToken(center, hrp, taken) then -- Impale, Rage, Focus and the like make the fight shorter: grab them when the way there is clear lastImpale = os.clock() local tok = Fight.battleToken(center, hrp, taken) local spot = Vector3.new(tok.Position.X, hrp.Position.Y, tok.Position.Z) taken[tok] = true if overlap(spot, hz) == 0 and crossing(hrp.Position, spot, hz) == 0 then Move.walk(spot, 2, interrupted) end else -- tracking phase: keep circling so its aimed spikes land behind us, on clear ground local best, bestA, bestScore for k = 0, 11 do local a = angle + k * (math.pi / 6) local r = radius * ((k % 2 == 0) and 1 or 0.75) local pt = Vector3.new(center.X + math.cos(a) * r, hrp.Position.Y, center.Z + math.sin(a) * r) if not zone or Fields.inZone(zone, pt, 6) then local score = -math.abs(k - 2) * 0.6 - overlap(pt, hz) - crossing(hrp.Position, pt, hz) if not bestScore or score > bestScore then best, bestA, bestScore = pt, a, score end end end if not best then angle = angle + math.pi best = Vector3.new(center.X + math.cos(angle) * radius * 0.6, hrp.Position.Y, center.Z + math.sin(angle) * radius * 0.6) else angle = bestA end Move.walk(best, 1, interrupted) end end end Move.stop() Fight.watch(false) Fight.active = false end local Jobs -- the jobs further down (Mondo, Windy, sprouts, planters); Sync uses it for sprout reports --------------------------------------------------------------------------- -- alt sync (files in the executor workspace, so accounts on this PC only) --------------------------------------------------------------------------- local Sync = { FRESH = 120, lastMain = nil } local function cleanName(s) local n = tostring(s or ""):lower() n = n:gsub("^%s*@?", "") n = n:gsub("%s+$", "") return n end function Sync.me() return LP.Name:lower() end -- main: tell alts where it is and what it's doing function Sync.publishMain(state, t) if Config.Role ~= "Main" then return end local rec = { name = LP.Name, job = game.JobId, private = App.private, state = state, t = os.time() } if t and t.pos then rec.field = t.field and t.field.name or nil rec.x, rec.y, rec.z = t.pos.X, t.pos.Y, t.pos.Z rec.gifted = t.gifted == true end Sync.lastMain = rec X.save("sync/main_" .. Sync.me() .. ".json", rec) end -- main: refresh the heartbeat without changing what it says function Sync.beatMain() if Config.Role ~= "Main" then return end local rec = Sync.lastMain or { name = LP.Name, job = game.JobId, private = App.private, state = "hunting" } rec.t, rec.job = os.time(), game.JobId Sync.lastMain = rec X.save("sync/main_" .. Sync.me() .. ".json", rec) end -- mains running stingers.now on this PC right now (fresh heartbeats) function Sync.mains() local out = {} local files = X.list("sync") if not files then return out end for _, f in ipairs(files) do if tostring(f):match("main_[^/\\]+%.json$") then local rec = X.decode(X.readAbs(f)) if rec and type(rec.name) == "string" and type(rec.t) == "number" and os.time() - rec.t < 30 and rec.name ~= LP.Name then table.insert(out, rec) end end end table.sort(out, function(a, b) return a.name:lower() < b.name:lower() end) return out end function Sync.readMain() local n = cleanName(Config.MainName) if n == "" then return nil end return X.load("sync/main_" .. n .. ".json") end -- alts are scouts. Their record says what they're doing and, once they've found one, where it is: -- { name, main, job, private, state = "searching" | "found" | "fighting" | "stopped", report, t, running } Sync.alt = { state = "searching", report = nil } Sync.skipJobs = {} function Sync.publishAlt(state, report) if Config.Role ~= "Alt" then return end if state then Sync.alt.state = state if state ~= "found" and state ~= "fighting" then Sync.alt.report = nil end end if report then Sync.alt.report = report end X.save("sync/alt_" .. Sync.me() .. ".json", { name = LP.Name, main = cleanName(Config.MainName), job = game.JobId, private = App.private, state = Sync.alt.state, report = Sync.alt.report, t = os.time(), running = App.running(), }) end -- main: alts linked to this account (fresh heartbeats); nil if this executor can't list files function Sync.alts() local files = X.list("sync") if not files then return nil end local out, me = {}, Sync.me() for _, f in ipairs(files) do if tostring(f):match("alt_[^/\\]+%.json$") then local rec = X.decode(X.readAbs(f)) if rec and rec.main == me and type(rec.t) == "number" and os.time() - rec.t < Sync.FRESH then table.insert(out, rec) end end end table.sort(out, function(a, b) return tostring(a.name):lower() < tostring(b.name):lower() end) return out end -- room to keep free in a server: alts leave a slot for the main to join them function Sync.slots() if Config.Role == "Alt" and cleanName(Config.MainName) ~= "" then return 1 end return 0 end -- would the main want this find? (its own level range, gifted-only and bee gates) function Sync.reportWanted(r) if r.kind == "sprout" then if not Jobs.sproutWanted(tostring(r.rarity)) then return false end local bees = Game.bees() for _, f in ipairs(Jobs.FIELDS) do if f[1] == r.field and bees and bees < f[2] then return false end end return true end if not Config.Vicious then return false end if Config.GiftedOnly and not r.gifted then return false end local lv = tonumber(r.level) if lv then return lv >= Config.MinLevel and lv <= Config.MaxLevel end for _, f in ipairs(Fields.VICIOUS) do if f.name == r.field then local bees = Game.bees() if bees and bees < f.bees then return false end return f.lv[2] >= Config.MinLevel and f.lv[1] <= Config.MaxLevel end end return true end -- main: live finds from its alts, best first (gifted, then the oldest find, since its spike runs out first) function Sync.reports() local out, now = {}, os.time() for _, a in ipairs(Sync.alts() or {}) do local r = a.report local skip = Sync.skipJobs[a.job] if (a.state == "found" or a.state == "fighting") and type(r) == "table" and type(a.job) == "string" and a.job ~= "" and a.job ~= game.JobId and not a.private and now - a.t < 15 and type(r.at) == "number" and now - r.at < ((r.kind == "sprout") and 1200 or 270) and a.running ~= false and not (skip and os.clock() - skip < 60) and Sync.reportWanted(r) then table.insert(out, { name = a.name, job = a.job, state = a.state, r = r }) end end -- Vicious first (its spike runs out), gifted before normal; then sprouts, rarest first table.sort(out, function(x, y) local xs, ys = x.r.kind == "sprout", y.r.kind == "sprout" if xs ~= ys then return not xs end if xs then local a, b = Jobs.rarityRank(tostring(x.r.rarity)), Jobs.rarityRank(tostring(y.r.rarity)) if a ~= b then return a > b end return x.r.at < y.r.at end if (x.r.gifted == true) ~= (y.r.gifted == true) then return x.r.gifted == true end return x.r.at < y.r.at end) return out end --------------------------------------------------------------------------- -- server hopping --------------------------------------------------------------------------- local Hop = { busy = false, failed = nil, queued = false, bad = {}, lastTry = 0, tpState = nil, reason = "" } track(S.Teleport.TeleportInitFailed:Connect(function(player, result, msg) if player == LP then Hop.failed = (typeof(result) == "EnumItem" and result.Name) or "Failure" local extra = "" if type(msg) == "string" and msg ~= "" then extra = " (" .. msg .. ")" end Log.add("Teleport failed: " .. Hop.failed .. extra) end end)) track(LP.OnTeleport:Connect(function(state) Hop.tpState = state if state == Enum.TeleportState.Failed then Hop.failed = Hop.failed or "Failed" end end)) function Hop.visited() local v = X.load("visited.json") if type(v) ~= "table" then v = {} end return v end function Hop.markVisited(job) if not job or job == "" then return end local v = Hop.visited() v[job] = os.time() local now = os.time() for id, at in pairs(v) do if type(at) ~= "number" or now - at > 3 * 3600 then v[id] = nil end end X.save("visited.json", v) end -- public server list, cached for a minute and shared by every account on this PC function Hop.fetch(force) local cache = X.load("servers.json") if not force and cache and type(cache.list) == "table" and #cache.list > 0 and type(cache.at) == "number" and os.time() - cache.at < 60 then return cache.list end local list, cursor = {}, nil for _ = 1, 3 do local url = ("https://games.roblox.com/v1/games/%d/servers/Public?sortOrder=Asc&excludeFullGames=true&limit=100"):format(PLACE) if cursor then url = url .. "&cursor=" .. S.Http:UrlEncode(cursor) end local body, code = X.httpGet(url) if code == 429 then if #list > 0 then break end return nil, "rate" end local data = X.decode(body) if not data or type(data.data) ~= "table" then if #list > 0 then break end return nil, "fail" end for _, s in ipairs(data.data) do if type(s) == "table" and type(s.id) == "string" and tonumber(s.playing) and tonumber(s.maxPlayers) then table.insert(list, { id = s.id, playing = tonumber(s.playing), max = tonumber(s.maxPlayers) }) end end cursor = data.nextPageCursor if type(cursor) ~= "string" or cursor == "" then break end end X.save("servers.json", { at = os.time(), list = list }) return list end -- servers worth trying, best first function Hop.candidates() local list, why = Hop.fetch(false) if not list then return {}, why end local need = 1 + Sync.slots() local visited = Hop.visited() local shared = Config.Forecast and X.load("clock.json") or nil local forecast = (shared and type(shared.servers) == "table") and shared.servers or {} local now = os.time() local out = {} for _, s in ipairs(list) do if s.id ~= game.JobId and not Hop.bad[s.id] and s.max - s.playing >= need and s.playing <= Config.MaxPlayers then local last = tonumber(visited[s.id]) local p = Clock.predict(forecast[s.id]) local score, night = nil, false if p == "day" then score = nil -- its last night ended under 10 minutes ago: certainly still day there elseif type(p) == "number" and (not last or now - last > 120) then -- inside its 10-30 minute window: the deeper in, the likelier a night (and a spike) has started score, night = 200 + p * 800, p > 0.5 elseif not last or now - last > Config.RevisitMinutes * 60 then score = math.random() * 100 - s.playing * 8 end if score then table.insert(out, { id = s.id, score = score, playing = s.playing, night = night }) end end end table.sort(out, function(a, b) return a.score > b.score end) return out end -- what runs in the next server: a backend loader sets getgenv().STINGERS_LOADER before loading this script; -- stingers.now does this; without one (autoexec / workspace file) it's the "Re-run line" setting function Hop.loader() local b = genv.STINGERS_LOADER or genv.NNH_LOADER if type(b) == "string" and b ~= "" then return b, "backend" end return Config.Loader, "file" end function Hop.queue() local line = Hop.loader() if Hop.queued or not X.queue or line == "" then return end -- in the next server: give autoexec a few seconds to start its copy; only load if nothing did local guarded = "local g = (getgenv and getgenv()) or _G; if not game:IsLoaded() then game.Loaded:Wait() end; " .. "task.wait(4); if g.__NNH_LOADING or g.__NNH_UNLOAD then return end; " .. line local ok = pcall(X.queue, guarded) if ok then Hop.queued = true end end -- one teleport attempt to a specific server; only returns if it failed (we're still here) function Hop.toJob(id) while os.clock() - Hop.lastTry < 2.5 do task.wait(0.1) end Hop.queue() Hop.failed, Hop.tpState, Hop.lastTry = nil, nil, os.clock() local ok, err = pcall(function() S.Teleport:TeleportToPlaceInstance(PLACE, id, LP) end) if not ok then Log.add("Teleport error: " .. tostring(err)) return false end local t0 = os.clock() while App.alive and not Hop.failed do local slow = Hop.tpState == Enum.TeleportState.InProgress or Hop.tpState == Enum.TeleportState.WaitingForServer if os.clock() - t0 > (slow and 45 or 20) then break end task.wait(0.25) end if Hop.failed == "Flooded" then task.wait(8) end return false end function Hop.go(reason) if Hop.busy then return end Hop.busy, Hop.reason = true, reason or "" Log.add("Hopping: " .. Hop.reason) Clock.record(game.JobId) Hop.markVisited(game.JobId) Sync.publishMain("hopping") Move.stop() Hop.called = false for round = 1, 4 do if not App.running() or Hop.called then break end local list, why = Hop.candidates() if #list == 0 then if why == "rate" then setStatus("Server list is rate limited, waiting") task.wait(8 * round) else setStatus("Refreshing the server list") Hop.fetch(true) task.wait(3) end else for i = 1, math.min(#list, 6) do if not App.running() then break end if Config.Role == "Main" and Sync.reports()[1] then Hop.called = true break end local s = list[i] setStatus(("Joining a server (%d players%s)"):format(s.playing, s.night and ", night just started" or "")) Hop.toJob(s.id) Hop.bad[s.id] = true end end end if App.running() and not Hop.called then -- nothing worked: let Roblox pick any server setStatus("Joining a random server") Hop.queue() pcall(function() S.Teleport:Teleport(PLACE, LP) end) task.wait(25) end Hop.busy = false end --------------------------------------------------------------------------- -- jobs done in whatever server we're in: Mondo Chick (on the hour), Wild Windy Bee and sprouts (both worth -- hopping for), and planters (they stay put while you hop, so they're tended from any server) --------------------------------------------------------------------------- Jobs = { windyFoundAt = -1000, mondoDoneFor = nil, sproutSkip = {}, windySkip = {}, planterRetry = {}, planterCheck = 0 } Jobs.RARITIES = { "Any", "Basic", "Rare", "Moon", "Epic", "Gummy", "Festive", "Legendary", "Supreme" } Jobs.MONDO_FIELD = "Mountain Top Field" -- every field: bees needed and its nectar (for planters) Jobs.FIELDS = { { "Sunflower Field", 0, "Satisfying" }, { "Dandelion Field", 0, "Comforting" }, { "Mushroom Field", 0, "Motivating" }, { "Blue Flower Field", 0, "Refreshing" }, { "Clover Field", 0, "Invigorating" }, { "Strawberry Field", 5, "Refreshing" }, { "Spider Field", 5, "Motivating" }, { "Bamboo Field", 5, "Comforting" }, { "Pineapple Patch", 10, "Satisfying" }, { "Stump Field", 10, "Motivating" }, { "Cactus Field", 15, "Invigorating" }, { "Pumpkin Patch", 15, "Satisfying" }, { "Pine Tree Forest", 15, "Comforting" }, { "Rose Field", 15, "Motivating" }, { "Mountain Top Field", 25, "Invigorating" }, { "Coconut Field", 35, "Refreshing" }, { "Pepper Patch", 35, "Invigorating" }, } -- monsters whose name contains a word ("mondo", "windy") function Jobs.monsters(word) local out = {} local mf = workspace:FindFirstChild("Monsters") if not mf then return out end for _, m in ipairs(mf:GetChildren()) do if m.Name:lower():gsub("%s", ""):find(word, 1, true) then table.insert(out, m) end end return out end -- which field a point is in (any field) function Jobs.fieldAt(pos) local fz = workspace:FindFirstChild("FlowerZones") if not fz then return nil end for _, z in ipairs(fz:GetChildren()) do if z:IsA("BasePart") and Fields.inZone(z, pos, 6) then return z end end return nil end -- pick up tokens near a spot until none are left (or time runs out) function Jobs.loot(center, seconds, radius) local col = workspace:FindFirstChild("Collectibles") if not col or not center then return end local t0, idle, taken = os.clock(), nil, {} while App.running() and os.clock() - t0 < (seconds or 10) do local _, hrp = Game.char() if not hrp then return end local best, bestD for _, c in ipairs(col:GetChildren()) do if c:IsA("BasePart") and not taken[c] and c.Transparency < 1 and Game.flat(c.Position, center) < (radius or 40) then local d = Game.flat(c.Position, hrp.Position) if not bestD or d < bestD then best, bestD = c, d end end end if best then idle = nil taken[best] = true Move.walk(Vector3.new(best.Position.X, hrp.Position.Y, best.Position.Z), math.min(3, bestD / 14 + 0.6)) else idle = idle or os.clock() if os.clock() - idle > 1.5 then return end task.wait(0.2) end end end -- bag, converting, inventory ----------------------------------------------------------------------------- function Jobs.core(name) local cs = LP:FindFirstChild("CoreStats") local v = cs and cs:FindFirstChild(name) return (v and tonumber(v.Value)) or 0 end function Jobs.bagFull() local cap = Jobs.core("Capacity") return cap > 0 and Jobs.core("Pollen") / cap >= 0.95 end function Jobs.convert() setStatus("Making honey") Move.waitChar(30) if not Hive.claim() then return end local pad = Hive.pad(Hive.mine()) if not pad or not Move.travel(pad) then return end task.wait(0.2) Game.fire("PlayerHiveCommand", "ToggleHoneyMaking") local t0, last, lastChange, nudged = os.clock(), Jobs.core("Pollen"), os.clock(), false while App.running() and Jobs.core("Pollen") > 0 and os.clock() - t0 < 300 do task.wait(0.3) local now = Jobs.core("Pollen") if now < last then lastChange = os.clock() end if not nudged and os.clock() - t0 > 5 and now >= last then Game.fire("PlayerHiveCommand", "ToggleHoneyMaking") nudged = true end if os.clock() - lastChange > 25 then break end last = now end end -- the game's inventory keys differ from the names players see (Planter Of Plenty is "PlentyPlanter") Jobs.ITEM_KEYS = { ["Planter Of Plenty"] = { "PlentyPlanter", "PlanterOfPlenty" } } -- how many of an item you have (nil when the game's stats can't be read yet) function Jobs.count(name) local st = Game.stats() local inv = st and st.Eggs if type(inv) ~= "table" then return nil end local want = {} for _, n in ipairs({ name, table.unpack(Jobs.ITEM_KEYS[name] or {}) }) do local k = n:lower():gsub("[^%w]", "") want[k], want[k .. "s"] = true, true end for k, v in pairs(inv) do if want[(tostring(k):lower():gsub("[^%w]", ""))] then return tonumber(v) or 0 end end return 0 end -- the planters in your inventory, best first, e.g. "Petal x2 · Tacky x1" function Jobs.ownedPlanters() local out = {} for _, name in ipairs(Jobs.PLANTER_RANK) do local n = Jobs.count(name) if n == nil then return nil end if n > 0 then table.insert(out, ("%s x%d"):format((name:gsub(" Planter", "")), n)) end end return out end -- swing the collector while gathering function Jobs.swing(on) Jobs.swinging = on if on and not Jobs.swingTask then Jobs.swingTask = task.spawn(function() while Jobs.swinging and App.alive do local c = LP.Character local tool = c and c:FindFirstChildOfClass("Tool") if tool then pcall(function() tool:Activate() end) end task.wait(0.25) end Jobs.swingTask = nil end) end end -- Mondo Chick --------------------------------------------------------------------------------------------- -- spawns on the hour (UTC) in Mountain Top Field and gets away after 15 minutes; faster kills give more blessings function Jobs.mondoDue() if not Config.Mondo then return nil end local bees = Game.bees() if bees and bees < 25 then return nil end local now = os.date("!*t") local sec = now.min * 60 + now.sec local hourStart = os.time() - sec local key, early = hourStart, false if sec >= 3600 - 45 then key, early = hourStart + 3600, true -- head over a little before it spawns elseif sec > 13 * 60 then return nil end if Jobs.mondoDoneFor == key then return nil end -- past the first minute, only if it's actually still up if not early and sec > 60 and #Jobs.monsters("mondo") == 0 then return nil end return key end function Jobs.mondoIn() local now = os.date("!*t") return 3600 - (now.min * 60 + now.sec) end function Jobs.mondo(key) Jobs.mondoDoneFor = key local zone = Fields.zone(Jobs.MONDO_FIELD) if not zone then return end Move.waitChar(30) if not Hive.claim() then Log.add("Mondo Chick: couldn't claim a hive, so bees can't fight") return end setStatus("Going to Mondo Chick") Move.travel(Fields.above(zone.Position, zone)) local t0, m = os.clock(), nil while App.running() and os.clock() - t0 < 75 and not m do m = Jobs.monsters("mondo")[1] if not m then setStatus(("Waiting for Mondo Chick (%ds)"):format(math.max(0, math.floor(Jobs.mondoIn() % 3600)))) task.wait(0.5) end end if not m then Log.add("Mondo Chick didn't show up") return end Log.add("Fighting Mondo Chick") local last, started = Game.pivot(m) or zone.Position, os.clock() Fight.kite(function() local p = Game.pivot(m) if p then last = p end local h = Vic.health(m) setStatus("Mondo Chick" .. (h and (" · " .. math.floor(h * 100 + 0.5) .. "% health") or "")) return last end, function() return m.Parent ~= nil end, 15 * 60, zone, 24) if not m.Parent then Log.add(("Mondo Chick done in %ds; collecting loot"):format(math.floor(os.clock() - started))) Jobs.loot(last, 20, 70) end end -- King Beetle and Tunnel Bear ------------------------------------------------------------------------------ -- their timers are per player, so they're fought between hops whenever they're back. The game shows each one's -- countdown on its spawner; the stats' MonsterTimes is the fallback. Jobs.BOSSES = { { key = "KingBeetle", label = "King Beetle", match = "kingbeetle", cd = 86400, bees = 10 }, { key = "TunnelBear", label = "Tunnel Bear", match = "tunnelbear", cd = 172800, bees = 15 }, } Jobs.bossRetry = {} function Jobs.bossSpawner(b) local sp = workspace:FindFirstChild("MonsterSpawners") if not sp then return nil end for _, d in ipairs(sp:GetDescendants()) do if (d:IsA("BasePart") or d:IsA("Model")) and d.Name:lower():gsub("[^%w]", ""):find(b.match, 1, true) then return d end end return nil end -- seconds left on a spawner's sign, or nil when it shows none function Jobs.bossSign(sp) for _, d in ipairs(sp:GetDescendants()) do if d:IsA("TextLabel") then local h, m, sec = d.Text:match("(%d+):(%d%d):(%d%d)") if h then return tonumber(h) * 3600 + tonumber(m) * 60 + tonumber(sec) end local m2, s2 = d.Text:match("(%d+):(%d%d)") if m2 then return tonumber(m2) * 60 + tonumber(s2) end end end return nil end -- seconds until it's back (0 = now); nil when it's off or the hive is too small for it function Jobs.bossLeft(b) if not Config[b.key] then return nil end local bees = Game.bees() if bees and bees < b.bees then return nil end local sp = Jobs.bossSpawner(b) local left = sp and Jobs.bossSign(sp) if not left then local st = Game.stats() local mt = st and st.MonsterTimes if type(mt) == "table" then for k, v in pairs(mt) do if tostring(k):lower():gsub("[^%w]", ""):find(b.match, 1, true) and tonumber(v) then left = math.max(0, b.cd - (os.time() - tonumber(v))) end end end end return math.max(left or 0, (Jobs.bossRetry[b.key] or 0) - os.clock(), 0) end function Jobs.bossTarget() for _, b in ipairs(Jobs.BOSSES) do local left = Jobs.bossLeft(b) if left and left <= 5 then return b end end return nil end function Jobs.boss(b) Jobs.bossRetry[b.key] = os.clock() + 600 -- if this attempt fails, try again in 10 minutes local sp = Jobs.bossSpawner(b) local pos = sp and Game.pivot(sp) if not pos then Log.add(b.label .. ": couldn't find where it spawns") Jobs.bossRetry[b.key] = os.clock() + 1800 return end Move.waitChar(30) if not Hive.claim() then Log.add(b.label .. ": couldn't claim a hive, so bees can't fight") return end setStatus("Going to " .. b.label) Move.travel(pos + Vector3.new(0, 4, 0)) local t0, m = os.clock(), nil while App.running() and os.clock() - t0 < 10 and not m do m = Jobs.monsters(b.match)[1] if not m then task.wait(0.5) end end if not m then Log.add(b.label .. " didn't appear; trying again in 10 minutes") return end Log.add("Fighting " .. b.label) local last, started = Game.pivot(m) or pos, os.clock() Fight.kite(function() local mp = Game.pivot(m) if mp then last = mp end local h = Vic.health(m) setStatus(b.label .. (h and (" · " .. math.floor(h * 100 + 0.5) .. "% health") or "")) return last end, function() return m.Parent ~= nil end, 10 * 60, nil, 16) if m.Parent then Log.add(b.label .. " fight ran out of time; trying again in 10 minutes") return end Log.add(("%s defeated in %ds; collecting loot"):format(b.label, math.floor(os.clock() - started))) Jobs.bossRetry[b.key] = nil Jobs.loot(last, 15, 45) Hook.send(b.label .. " defeated", "", 0x6ECD9E, false, Hook.card("boss", { b = b.label })) end -- for the UI: "ready", "3h 20m", or why it's waiting, plus "muted" / "good" / "text" for its colour function Jobs.bossStatus(b) if not Config[b.key] then return "off", "muted" end local bees = Game.bees() if bees and bees < b.bees then return ("needs %d bees"):format(b.bees), "muted" end local left = Jobs.bossLeft(b) or 0 if left <= 5 then return "ready", "good" end if left >= 3600 then return ("%dh %02dm"):format(math.floor(left / 3600), math.floor(left % 3600 / 60)), "text" end return ("%dm"):format(math.ceil(left / 60)), "text" end -- Wild Windy Bee -------------------------------------------------------------------------------------------- -- hides in a cloud over a field; touching the cloud starts it. Each time it's beaten it drops a loot ring and -- moves to another field; it flees 5 minutes after it was found. function Jobs.windyLeft() local since = os.clock() - Jobs.windyFoundAt if since < 330 then return math.max(0, 300 - since) end local m = Jobs.monsters("windy")[1] if m then for _, d in ipairs(m:GetDescendants()) do if d:IsA("TextLabel") then local a, b = d.Text:match("(%d+):(%d%d)") if a then return tonumber(a) * 60 + tonumber(b) end end end end return nil end function Jobs.windyTarget() if not Config.Windy then return nil end local m = Jobs.monsters("windy")[1] if not m or Jobs.windySkip[m] then return nil end local left = Jobs.windyLeft() if left and left < Config.WindyMinTime then return nil end return m end function Jobs.windy(m) Jobs.windySkip[m] = true Move.waitChar(30) if not Hive.claim() then Log.add("Windy Bee: couldn't claim a hive, so bees can't fight") return end Log.add("Going for Wild Windy Bee") local last = Game.pivot(m) local t0 = os.clock() while App.running() and m.Parent and os.clock() - t0 < 360 do -- one round: fight until it's beaten (health drops low then refills) or it moves far away local low, beaten = false, false Fight.kite(function() local p = Game.pivot(m) if p then if last and Game.flat(p, last) > 90 then beaten = true end last = p end local h = Vic.health(m) if h then if h < 0.08 then low = true end if low and h > 0.5 then beaten = true end end local left = Jobs.windyLeft() setStatus("Wild Windy Bee" .. (h and (" · " .. math.floor(h * 100 + 0.5) .. "%") or "") .. (left and (" · flees in " .. math.floor(left) .. "s") or "")) return last end, function() return m.Parent ~= nil and not beaten end, 360 - (os.clock() - t0), Jobs.fieldAt(last or Vector3.zero), 18) if beaten and last then -- its loot ring is where it was beaten setStatus("Collecting Windy Bee loot") Jobs.loot(last, 10, 35) last = Game.pivot(m) or last end end Log.add("Wild Windy Bee is gone") end -- sprouts ----------------------------------------------------------------------------------------------------- function Jobs.sproutRank(model) local text = model.Name for _, d in ipairs(model:GetDescendants()) do if d:IsA("TextLabel") then text = text .. " " .. d.Text end if d:IsA("StringValue") then text = text .. " " .. tostring(d.Value) end end text = text:lower() for i = #Jobs.RARITIES, 2, -1 do if text:find(Jobs.RARITIES[i]:lower(), 1, true) then return Jobs.RARITIES[i], i end end return "Basic", 2 end -- is this rarity switched on? function Jobs.sproutWanted(rarity) return Config.Sprouts and Config.SproutWant[rarity] ~= false end function Jobs.rarityRank(rarity) for i, r in ipairs(Jobs.RARITIES) do if r == rarity then return i end end return 2 end function Jobs.sproutTarget() if not Config.Sprouts then return nil end local sf = workspace:FindFirstChild("Sprouts") if not sf then return nil end local bees = Game.bees() local best, bestRank for _, s in ipairs(sf:GetChildren()) do if not Jobs.sproutSkip[s] then local p = Game.pivot(s) local z = p and Jobs.fieldAt(p) if z then local need = 0 for _, f in ipairs(Jobs.FIELDS) do if f[1] == z.Name then need = f[2] end end local name, rank = Jobs.sproutRank(s) if Jobs.sproutWanted(name) and (not bees or bees >= need) and (not bestRank or rank > bestRank) then best, bestRank = { obj = s, pos = p, zone = z, rarity = name }, rank end end end end return best end -- gather in the sprout's field until it pops, making honey whenever the bag fills, then collect what it drops function Jobs.sprout(t) Jobs.sproutSkip[t.obj] = true Move.waitChar(30) if not Hive.claim() then Log.add("Sprout: couldn't claim a hive") return end Log.add(("Farming a %s sprout in %s"):format(t.rarity, t.zone.Name)) local t0 = os.clock() Jobs.swing(true) while App.running() and t.obj.Parent and os.clock() - t0 < 20 * 60 do if Jobs.bagFull() then Jobs.swing(false) Jobs.convert() Jobs.swing(true) end local _, hrp = Game.char() if not hrp then Move.waitChar(20) elseif not Fields.inZone(t.zone, hrp.Position, 2) then Move.travel(Fields.above(t.pos, t.zone)) else setStatus(("%s sprout in %s · %d%% bag"):format(t.rarity, t.zone.Name, math.floor(Jobs.core("Pollen") / math.max(Jobs.core("Capacity"), 1) * 100))) local a, r = math.random() * math.pi * 2, 6 + math.random() * 16 local pt = Vector3.new(t.pos.X + math.cos(a) * r, hrp.Position.Y, t.pos.Z + math.sin(a) * r) if Fields.inZone(t.zone, pt, -2) then Move.walk(pt, 1.5) else task.wait(0.1) end end end Jobs.swing(false) if not t.obj.Parent then Log.add(t.rarity .. " sprout done; collecting its drops") Jobs.loot(t.pos, 25, 60) end end -- planters ---------------------------------------------------------------------------------------------------- -- Smart mode: keeps your most-wanted nectars topped up. Each nectar has a weight (from a hive preset or your own -- order); a nectar that's running low scores higher, one that's nearly full is skipped. Each empty slot gets the -- best nectar still needed, the richest field of that nectar your bees can enter, and the planter you own that -- boosts that nectar most. Harvest "for nectar" (after a couple of hours, best nectar per hour) or at full growth -- (best loot). Planters stay where they are while you hop, so this works from any server. Jobs.GROW_HOURS = { ["Paper Planter"] = 1, ["Ticket Planter"] = 2, ["Plastic Planter"] = 2, ["Candy Planter"] = 4, ["Red Clay Planter"] = 6, ["Blue Clay Planter"] = 6, ["Tacky Planter"] = 8, ["Pesticide Planter"] = 10, ["Heat-Treated Planter"] = 12, ["Hydroponic Planter"] = 12, ["Petal Planter"] = 14, ["Planter Of Plenty"] = 16, ["Festive Planter"] = 4, } Jobs.PLANTER_RANK = { "Planter Of Plenty", "Petal Planter", "Heat-Treated Planter", "Hydroponic Planter", "Pesticide Planter", "Tacky Planter", "Red Clay Planter", "Blue Clay Planter", "Candy Planter", "Plastic Planter", "Ticket Planter", "Paper Planter", "Festive Planter" } Jobs.NECTAR_MULT = { ["Blue Clay Planter"] = { Comforting = 1.2, Refreshing = 1.2 }, ["Red Clay Planter"] = { Satisfying = 1.2, Invigorating = 1.2 }, ["Tacky Planter"] = { Comforting = 1.25, Satisfying = 1.25 }, ["Pesticide Planter"] = { Motivating = 1.25, Satisfying = 1.25 }, ["Candy Planter"] = { Motivating = 1.2 }, ["Hydroponic Planter"] = { Comforting = 1.4, Refreshing = 1.4 }, ["Heat-Treated Planter"] = { Motivating = 1.4, Invigorating = 1.4 }, ["Petal Planter"] = { Comforting = 1.5, Satisfying = 1.5 }, } Jobs.BASE_MULT = { ["Planter Of Plenty"] = 1.5, ["Paper Planter"] = 0.75, ["Ticket Planter"] = 2, ["Festive Planter"] = 3 } Jobs.NECTARS = { "Comforting", "Refreshing", "Satisfying", "Motivating", "Invigorating" } -- hive presets: how much each nectar matters Jobs.PRESETS = { ["Red hive"] = { Refreshing = 3, Invigorating = 3, Satisfying = 1.5, Motivating = 1.5, Comforting = 1 }, ["Blue hive"] = { Comforting = 3, Motivating = 3, Refreshing = 1.5, Satisfying = 1, Invigorating = 1 }, ["White hive"] = { Satisfying = 3, Motivating = 2, Invigorating = 1.5, Comforting = 1.5, Refreshing = 1 }, ["Balanced"] = { Comforting = 2, Refreshing = 2, Satisfying = 2, Motivating = 2, Invigorating = 2 }, } Jobs.PRESET_NAMES = { "Red hive", "Blue hive", "White hive", "Balanced", "Custom" } Jobs.PLANTER_NAMES = { "None" } for _, n in ipairs(Jobs.PLANTER_RANK) do table.insert(Jobs.PLANTER_NAMES, n) end Jobs.FIELD_NAMES = {} for _, f in ipairs(Jobs.FIELDS) do table.insert(Jobs.FIELD_NAMES, f[1]) end -- nectar level 0..100 (time left out of 24 h), from the game's own buff data function Jobs.nectarPct(nectar) local st = Game.stats() local mods = st and st.Modifiers if type(mods) ~= "table" then return nil end local want, best = nectar:lower(), nil local function walk(t, depth) if type(t) ~= "table" or depth > 5 then return end if type(t.Src) == "string" and t.Src:lower():find(want, 1, true) then local dur, start = tonumber(t.Dur), tonumber(t.Start or t.StartTime or t.T) if dur and start then local left = start + dur - os.time() if left > 0 and (not best or left > best) then best = left end end end for _, v in pairs(t) do walk(v, depth + 1) end end pcall(walk, mods, 0) if not best then return 0 end return math.min(100, best / 86400 * 100) end -- how much each nectar matters right now (preset, or your own order for Custom) function Jobs.nectarWeights() local p = Jobs.PRESETS[Config.PlanterPreset] if p then return p end local w = {} for i, n in ipairs(Config.NectarOrder) do w[n] = ({ 3, 2.5, 2, 1.5, 1 })[i] or 1 end return w end -- the order shown in the priority list (custom order, or the preset sorted by weight) function Jobs.nectarOrder() local p = Jobs.PRESETS[Config.PlanterPreset] if not p then return Config.NectarOrder end local list = {} for _, n in ipairs(Jobs.NECTARS) do table.insert(list, n) end table.sort(list, function(a, b) return (p[a] or 0) > (p[b] or 0) end) return list end function Jobs.planterMult(planter, nectar) local m = Jobs.NECTAR_MULT[planter] return (m and m[nectar]) or Jobs.BASE_MULT[planter] or 1 end function Jobs.fieldNectar(field) for _, f in ipairs(Jobs.FIELDS) do if f[1] == field then return f[3], f[2] end end return nil, 0 end function Jobs.planterModel(id) local f = workspace:FindFirstChild("Planters") if not f or not id then return nil end for _, m in ipairs(f:GetChildren()) do if tostring(m:GetAttribute("PlanterID") or m:GetAttribute("ID") or m.Name) == tostring(id) then return m end end return nil end function Jobs.planterPercent(model) for _, d in ipairs(model:GetDescendants()) do if d:IsA("TextLabel") then local p = d.Text:match("(%d+%.?%d*)%%") if p then return tonumber(p) end end end return nil end -- what goes in each empty slot: { planter, field, nectar } function Jobs.planterPlan() local plan = {} if Config.PlanterMode == "Manual" then for s = 1, 3 do local p = Config["Planter" .. s] if p ~= "None" then plan[s] = { planter = p, field = Config["PlanterField" .. s], nectar = Jobs.fieldNectar(Config["PlanterField" .. s]) } end end return plan end local bees = Game.bees() or 0 local weights = Jobs.nectarWeights() local usedField, usedNectar, usedPlanter = {}, {}, {} for s = 1, 3 do local st = Config.PlanterState[tostring(s)] if st then usedField[st.field] = true local n = Jobs.fieldNectar(st.field) if n then usedNectar[n] = true end end end for s = 1, 3 do if not Config.PlanterState[tostring(s)] then -- the nectar that needs it most: its weight, scaled by how empty it is; nearly-full ones are skipped local pick, pickScore for _, n in ipairs(Jobs.NECTARS) do local pct = Jobs.nectarPct(n) or 0 local w = weights[n] or 0 if w > 0 and not usedNectar[n] and pct < Config.NectarCap then local score = w * (1 - pct / 100) if not pickScore or score > pickScore then pick, pickScore = n, score end end end if pick then -- the richest field of that nectar we can enter local field, fieldNeed for _, f in ipairs(Jobs.FIELDS) do if f[3] == pick and bees >= f[2] and not usedField[f[1]] and (not fieldNeed or f[2] > fieldNeed) then field, fieldNeed = f[1], f[2] end end -- the planter we own (and allow) that boosts that nectar most; better planters break ties local best, bestScore if field then for i, name in ipairs(Jobs.PLANTER_RANK) do local have = (Jobs.count(name) or 0) - (usedPlanter[name] or 0) if have > 0 and Config.PlanterUse[name] ~= false then local score = Jobs.planterMult(name, pick) * 100 - i * 2 -- for nectar runs, a planter that's fully grown before harvest time is wasted time if Config.PlanterHarvestMode == "For nectar" and (Jobs.GROW_HOURS[name] or 4) < Config.PlanterHours then score = score - 40 end if not bestScore or score > bestScore then best, bestScore = name, score end end end end if best then plan[s] = { planter = best, field = field, nectar = pick } usedField[field], usedNectar[pick] = true, true usedPlanter[best] = (usedPlanter[best] or 0) + 1 else usedNectar[pick] = true -- can't plant it now; let the next slot try another nectar end end end end return plan end -- seconds until a slot should be harvested (0 = now), nil if empty function Jobs.planterLeft(slot) local st = Config.PlanterState[tostring(slot)] if not st then return nil end local grow = (Jobs.GROW_HOURS[st.planter] or 4) * 3600 local elapsed = os.time() - st.placed local m = Jobs.planterModel(st.id) local pct = m and Jobs.planterPercent(m) if Config.PlanterHarvestMode == "Full growth" then if pct then if pct >= 100 then return 0 end return math.max(60, grow * (1 - pct / 100)) end return math.max(0, grow - elapsed) end -- for nectar: after the chosen hours, or when fully grown if that's sooner if pct and pct >= 100 then return 0 end return math.max(0, math.min(Config.PlanterHours * 3600, grow) - elapsed) end function Jobs.planterReady(slot) local left = Jobs.planterLeft(slot) return left ~= nil and left <= 0 end function Jobs.plantersDue() if not Config.Planters or os.clock() - Jobs.planterCheck < 15 then return false end Jobs.planterCheck = os.clock() for s = 1, 3 do if Jobs.planterReady(s) then return true end end local plan = Jobs.planterPlan() for s = 1, 3 do local p = plan[s] if p and not Config.PlanterState[tostring(s)] and os.clock() >= (Jobs.planterRetry[s] or 0) then return true end end return false end function Jobs.harvest(slot) local key = tostring(slot) local st = Config.PlanterState[key] local zone = st and Fields.zone(st.field) if not zone then Config.PlanterState[key] = nil return end setStatus("Harvesting " .. st.planter) Move.travel(Fields.above(zone.Position, zone)) local m = Jobs.planterModel(st.id) local pos = m and Game.pivot(m) if pos then Move.walk(pos, 5) end Game.fire("PlanterModelCollect", st.id) task.wait(1.2) Jobs.loot(pos or zone.Position, 10, 30) Config.PlanterState[key] = nil App.save() Log.add("Harvested " .. st.planter .. " in " .. st.field) end function Jobs.place(slot, p) Jobs.planterRetry[slot] = os.clock() + 300 for s = 1, 3 do local o = Config.PlanterState[tostring(s)] if o and o.field == p.field then return end end local zone = Fields.zone(p.field) if not zone then return end setStatus("Placing " .. p.planter .. " (" .. tostring(p.nectar or "?") .. ")") local center = Fields.above(zone.Position, zone) Move.travel(center) local f = workspace:FindFirstChild("Planters") local id for attempt = 1, 2 do -- a planter only goes down from the ground, so land on the flowers first local t1 = os.clock() while os.clock() - t1 < 3 do local _, _, hum = Game.char() if hum and hum.FloorMaterial ~= Enum.Material.Air then break end task.wait(0.1) end local before = {} if f then for _, m in ipairs(f:GetChildren()) do before[m] = true end end Game.fire("PlayerActivesCommand", { Name = p.planter }) local t0 = os.clock() while not id and os.clock() - t0 < 4 do task.wait(0.25) if f then for _, m in ipairs(f:GetChildren()) do local mp = Game.pivot(m) if not before[m] and mp and Game.flat(mp, center) < 30 then id = m:GetAttribute("PlanterID") or m:GetAttribute("ID") or m.Name end end end end if id then break end -- try again a few steps over, in case that spot was blocked if attempt == 1 then Move.walk(center + Vector3.new(8, 0, 8), 4) end end if not id then Log.add(("Couldn't place %s in %s (you have %s; at most 3 planters can be out)"):format( p.planter, p.field, tostring(Jobs.count(p.planter) or "?"))) return end Config.PlanterState[tostring(slot)] = { placed = os.time(), field = p.field, planter = p.planter, id = tostring(id) } App.save() Log.add(("Placed %s in %s for %s nectar"):format(p.planter, p.field, tostring(p.nectar or "?"))) end function Jobs.planters() Move.waitChar(30) for s = 1, 3 do if not App.running() then return end if Jobs.planterReady(s) then Jobs.harvest(s) end end local plan = Jobs.planterPlan() for s = 1, 3 do if not App.running() then return end local p = plan[s] if p and not Config.PlanterState[tostring(s)] and os.clock() >= (Jobs.planterRetry[s] or 0) then Jobs.place(s, p) end end end -- slot summary for the UI function Jobs.planterStatus(slot) local st = Config.PlanterState[tostring(slot)] if not st then return nil end local left = Jobs.planterLeft(slot) or 0 local when = left <= 0 and "ready" or (left >= 3600 and ("%dh %02dm"):format(math.floor(left / 3600), math.floor(left % 3600 / 60)) or ("%dm"):format(math.ceil(left / 60))) return ("%s · %s · %s"):format((st.planter:gsub(" Planter", "")), (st.field:gsub(" Field", ""):gsub(" Patch", "")), when) end -- the alerts tell us when Windy Bee is found (its 5-minute timer starts then) do local ev = S.RS:WaitForChild("Events", 15) local r = ev and ev:WaitForChild("ReceiveAlert", 5) if r and r:IsA("RemoteEvent") then track(r.OnClientEvent:Connect(function(msg) local m = tostring(msg):lower() if m:find("found windy bee", 1, true) then Jobs.windyFoundAt = os.clock() end end)) end end -- one job here, if any is due; returns true when it did something function Jobs.tick() local w = Jobs.windyTarget() if w then Jobs.windy(w) return true end local sp = Jobs.sproutTarget() if sp then Jobs.sprout(sp) return true end local boss = Jobs.bossTarget() if boss then Jobs.boss(boss) return true end if Jobs.plantersDue() then Jobs.planters() return true end return false end --------------------------------------------------------------------------- -- hunting (Solo and Main) --------------------------------------------------------------------------- local Hunt = { arrived = os.clock(), state = "idle", beat = 0, foundHere = {}, defeatedAt = -100, leftAt = -100 } -- server alerts: "🎉 Vicious Bee has been defeated! 🎉" / "... Vicious Bee left..." do local ev = S.RS:WaitForChild("Events", 15) local r = ev and ev:WaitForChild("ReceiveAlert", 5) if r and r:IsA("RemoteEvent") then track(r.OnClientEvent:Connect(function(msg) local m = tostring(msg):lower() if m:find("vicious bee has been defeated", 1, true) then Hunt.defeatedAt = os.clock() elseif m:find("vicious bee left", 1, true) then Hunt.leftAt = os.clock() end end)) end end local function fieldName(t) return (t and t.field and t.field.name) or "a field" end local function levelText(t) if t.level then return "Lv " .. t.level end if t.field then return ("Lv %d-%d"):format(t.field.lv[1], t.field.lv[2]) end return "Lv ?" end function Hunt.countFound(t) if Hunt.foundHere[t.obj] then return end Hunt.foundHere[t.obj] = true Stats.add("found") if t.gifted then Stats.add("gifted") end Hook.send((t.gifted and "Gifted " or "") .. "Vicious Bee found", ("%s · %s · %d players"):format(fieldName(t), levelText(t), #S.Players:GetPlayers()), t.gifted and 0xF2C94C or 0xB5A0FF, t.gifted and Config.PingGifted, Hook.card("found", { lv = t.level or 0, f = fieldName(t), g = t.gifted and 1 or 0, p = #S.Players:GetPlayers() })) end function Hunt.fight(bee) local m = bee.obj if not Vic.wanted(bee) then Log.add(("Vicious Bee in %s is %s, outside your range; leaving it"):format(fieldName(bee), levelText(bee))) Vic.ignored[m] = true return end Hunt.state = "fighting" Hunt.countFound(bee) Log.add(("Fighting %sVicious Bee (%s) in %s"):format(bee.gifted and "Gifted " or "", levelText(bee), fieldName(bee))) Sync.publishMain("fighting", bee) local before = Game.stingers() local lastPos, lastHealth = bee.pos, Vic.health(m) local label = (bee.gifted and "Gifted " or "") .. "Vicious " .. levelText(bee) Fight.kite(function() local p = Game.pivot(m) if p then lastPos = p end local h = Vic.health(m) if h then lastHealth = h end setStatus(label .. (lastHealth and (" · " .. math.floor(lastHealth * 100 + 0.5) .. "% health") or "") .. " · " .. fieldName(bee)) if os.clock() - Hunt.beat > 3 then Hunt.beat = os.clock() Sync.publishMain("fighting", { pos = lastPos, field = bee.field, gifted = bee.gifted }) end return lastPos end, function() return m.Parent ~= nil end, 600, bee.zone) Vic.ignored[m] = true if m.Parent then Log.add("Stopped fighting before the bee went down") Hunt.state = "idle" return end setStatus("Vicious Bee is gone, checking rewards") task.wait(2.5) local after = Game.stingers() local gained = (before and after) and math.max(after - before, 0) or 0 local killed = gained > 0 or os.clock() - Hunt.defeatedAt < 15 or (lastHealth ~= nil and lastHealth < 0.25) if os.clock() - Hunt.leftAt < 15 and gained == 0 then killed = false end if killed then Stats.add("killed") if gained > 0 then Stats.add("stingers", gained) end table.insert(Stats.data.hist, Stats.data.stingers) if #Stats.data.hist > 30 then table.remove(Stats.data.hist, 1) end Stats.save() Log.add(("Defeated %s (+%d stingers)"):format(label, gained)) if Config.HookKills or bee.gifted then Hook.send((bee.gifted and "Gifted " or "") .. "Vicious Bee defeated", ("%s · %s · +%d stingers\nSession: %d killed, %d stingers, %d servers"):format(fieldName(bee), levelText(bee), gained, Stats.data.killed, Stats.data.stingers, Stats.data.servers), 0x6ECD9E, bee.gifted and Config.PingGifted, Hook.card("kill", { lv = bee.level or 0, f = fieldName(bee), g = bee.gifted and 1 or 0, s = gained })) end else Log.add("The Vicious Bee left before it was beaten") end Hunt.state = "idle" if Config.StingerGoal > 0 and Stats.data.stingers >= Config.StingerGoal then Config.Running = false App.saveNow() Log.add("Stinger goal reached, stopping") Hook.send("Stinger goal reached", ("%d stingers this session"):format(Stats.data.stingers), 0x6ECD9E, true, Hook.card("goal")) end end function Hunt.engage(t) Hunt.state = "found" Log.add(("%sVicious Bee %s in %s"):format(t.gifted and "Gifted " or "", t.kind == "spike" and "spike" or (t.dormant and "hiding" or "awake"), fieldName(t))) Sync.publishMain("found", t) Move.waitChar(30) local claimed = Hive.claim() if not claimed and App.running() then task.wait(1) claimed = Hive.claim() end if not App.running() then return end if not claimed then Log.add("Couldn't claim a hive here, and without one your bees can't fight; skipping this one") Vic.ignored[t.obj] = true Hunt.state = "idle" return end if t.kind == "monster" and not t.dormant then Hunt.fight(t) return end setStatus("Waking the Vicious Bee in " .. fieldName(t)) -- touching the spike is what wakes it: if we were handed the hiding bee, find its spike local spot, spikeObj = t.pos, (t.kind == "spike") and t.obj or nil if t.kind ~= "spike" then local bestD for _, sp in ipairs(Vic.spikes()) do local d = Game.flat(sp.pos, t.pos) if d < 20 and (not bestD or d < bestD) then spot, spikeObj, bestD = sp.pos, sp.obj, d end end end Move.travel(Fields.above(spot, t.zone)) local bee local t0 = os.clock() while App.running() and os.clock() - t0 < 12 do local m = Vic.near(spot, 60) if m and (not m.dormant or (spikeObj and not spikeObj.Parent)) then bee = m break end local _, hrp, hum = Game.char() if hrp then -- walk right onto it; after a few tries, nudge around it and hop in case we're standing just off it local e = os.clock() - t0 local off = (e > 3) and Vector3.new(math.random(-15, 15) / 10, 0, math.random(-15, 15) / 10) or Vector3.zero hum:MoveTo(Vector3.new(spot.X, hrp.Position.Y, spot.Z) + off) if Game.flat(hrp.Position, spot) < 2.5 then hum.Jump = true end end task.wait(0.3) end if not bee then -- still hiding: circling right next to it wakes it too bee = Vic.near(spot, 60) end if not bee then if App.running() then Log.add("Nothing woke up at that spike in " .. fieldName(t) .. "; ignoring it") Vic.ignored[t.obj] = true Vic.markDecoy(t) end Hunt.state = "idle" return end if t.gifted then bee.gifted = true end Hunt.fight(bee) end -- main: go to the server where an alt is holding a Vicious Bee function Hunt.joinReport(rep) local r = rep.r local what = (r.kind == "sprout") and ("%s sprout in %s"):format(tostring(r.rarity), tostring(r.field or "a field")) or ("%sVicious in %s"):format(r.gifted and "Gifted " or "", tostring(r.field or "a field")) Log.add(("%s found a %s; joining"):format(tostring(rep.name), what)) setStatus(("Joining %s · %s"):format(tostring(rep.name), what)) Sync.publishMain("joining") Hop.toJob(rep.job) -- only back here if the teleport failed (server full or closed) Sync.skipJobs[rep.job] = os.clock() Log.add("Couldn't get into " .. tostring(rep.name) .. "'s server") end function Hunt.tick() local mondo = Jobs.mondoDue() if mondo then Jobs.mondo(mondo) return end local t = Config.Vicious and Vic.find(Config.HelpFights) if t then Hunt.engage(t) return end if Config.Role == "Main" then local rep = Sync.reports()[1] if rep then Hunt.joinReport(rep) return end end Hunt.state = "searching" if Config.Role == "Main" and (not Sync.lastMain or Sync.lastMain.state ~= "hunting" or Sync.lastMain.job ~= game.JobId) then Sync.publishMain("hunting") end if Jobs.tick() then return end local here = os.clock() - Hunt.arrived if here < 4 then setStatus("Looking around this server") return end -- Mondo Chick is about to spawn: don't start a hop now if Config.Mondo and Jobs.mondoIn() <= 75 then setStatus(("Mondo Chick in %ds, staying"):format(Jobs.mondoIn())) return end if not Config.Vicious then Hop.go("nothing to do here") return end if Clock.isNight() then local left = Config.SpikeWait - (Clock.sinceNight() or here) if left > 0 then setStatus(("Night here, watching for a spike (%ds)"):format(math.ceil(left))) return end Hop.go("night, but no Vicious Bee here") else Hop.go("daytime here") end end --------------------------------------------------------------------------- -- alts: scout. Hop and look like a solo hunter; on a find, hold the server (stay away from the spike, which -- would wake it), report it so the main can join, and help once it's awake. If the main doesn't come in -- time (or isn't running), take it yourself rather than waste it. --------------------------------------------------------------------------- local Alt = { hold = nil } function Alt.main() local m = Sync.readMain() if not m or type(m.t) ~= "number" or os.time() - m.t > 30 then return nil end return m end function Alt.tick() if cleanName(Config.MainName) == "" then local mains = Sync.mains() if #mains == 1 then Config.MainName = mains[1].name App.save() Log.add("Linked to main " .. mains[1].name) end end local m = Alt.main() local mainOn = m ~= nil and m.state ~= "stopped" local mainHere = m ~= nil and m.job == game.JobId if Alt.hold and Alt.hold.kind == "sprout" then local h = Alt.hold if not h.obj.Parent then Alt.hold = nil Log.add("The sprout I was holding is gone") Sync.publishAlt("searching") return end local waited = os.clock() - h.since if mainHere then -- the main farms it; go back to scouting (and leave this one alone) Jobs.sproutSkip[h.obj] = true Alt.hold = nil Log.add("The main is here for the sprout; back to scouting") Sync.publishAlt("searching") return elseif not mainOn or waited > Config.AltHold then Log.add(mainOn and "The main didn't come for the sprout; farming it myself" or "The main isn't running; farming the sprout myself") Alt.hold = nil Sync.publishAlt("searching") Jobs.sprout(h.t) return end setStatus(("Holding a %s sprout in %s for %s (%ds)"):format(h.t.rarity, h.t.zone.Name, tostring(m.name), math.ceil(Config.AltHold - waited))) Sync.publishAlt("found") return end if Alt.hold then local h = Alt.hold local bee = Vic.near(h.pos, 60) if bee and not bee.dormant then -- awake (the main woke it, or someone else did): help fight it Alt.hold = nil Sync.publishAlt("fighting") Move.waitChar(30) Hive.claim() Hunt.fight(bee) Sync.publishAlt("searching") return end if not h.obj.Parent then Alt.hold = nil Log.add("The spike I was holding is gone") Sync.publishAlt("searching") return end local waited = os.clock() - h.since if mainHere then setStatus("The main is here and waking it") elseif not mainOn or waited > Config.AltHold then Log.add(mainOn and "The main didn't make it in time; taking it myself" or "The main isn't running; taking it myself") Alt.hold = nil Sync.publishAlt("fighting") Hunt.engage(h.t) Sync.publishAlt("searching") return else setStatus(("Holding a %sVicious in %s for %s (%ds)"):format(h.t.gifted and "Gifted " or "", fieldName(h.t), tostring(m.name), math.ceil(Config.AltHold - waited))) end Sync.publishAlt("found") return end -- found one, and there's a main to call: hold it for the main if Config.Vicious and mainOn and not mainHere and not m.private then local t = Vic.find(false) if t and (t.kind == "spike" or t.dormant) then Hunt.countFound(t) Log.add(("Found a %sVicious Bee in %s; calling %s"):format(t.gifted and "Gifted " or "", fieldName(t), tostring(m.name))) Alt.hold = { kind = "vicious", t = t, obj = t.obj, pos = t.pos, since = os.clock() } Sync.publishAlt("found", { kind = "vicious", field = t.field and t.field.name or nil, x = t.pos.X, y = t.pos.Y, z = t.pos.Z, gifted = t.gifted == true, level = t.level, at = os.time() }) -- claim a hive meanwhile: it's well away from the spike, and our bees are then ready to help Move.waitChar(30) Hive.claim() return end end -- a sprout of a rarity that's switched on, and a main to call: hold it (others are skipped, like solo) if Config.Sprouts and mainOn and not mainHere and not m.private then local sp = Jobs.sproutTarget() if sp then Log.add(("Found a %s sprout in %s; calling %s"):format(sp.rarity, sp.zone.Name, tostring(m.name))) Alt.hold = { kind = "sprout", t = sp, obj = sp.obj, pos = sp.pos, since = os.clock() } Sync.publishAlt("found", { kind = "sprout", rarity = sp.rarity, field = sp.zone.Name, x = sp.pos.X, y = sp.pos.Y, z = sp.pos.Z, at = os.time() }) return end end -- the main is in this server and there's a sleeping one: that's the main's to wake if Config.Vicious and mainOn and mainHere then local t = Vic.find(false) if t and (t.kind == "spike" or t.dormant) then setStatus("Waiting for " .. tostring(m.name) .. " to wake it") return end end -- nothing to hold: scout like a solo hunter (joins fights already going; with no main, fights them itself) if Sync.alt.state ~= "searching" then Sync.publishAlt("searching") end Hunt.tick() end --------------------------------------------------------------------------- -- main loop + background jobs --------------------------------------------------------------------------- function App.arrive() if Stats.data.lastJob ~= game.JobId then Stats.data.lastJob = game.JobId Stats.add("servers") end end function App.tick() if Config.Role == "Alt" then App.arrive() Alt.tick() else App.arrive() Hunt.tick() end end function App.setRunning(on) Config.Running = on App.saveNow() if on then Hunt.arrived = math.min(Hunt.arrived, os.clock() - 4) if Config.Role == "Alt" then Sync.publishAlt("searching") end Log.add("Started (" .. Config.Role .. ")") else Move.stop() Hunt.state = "idle" Alt.hold = nil if Config.Role == "Main" then Sync.publishMain("stopped") end if Config.Role == "Alt" then Sync.publishAlt("stopped") end setStatus("Stopped") Log.add("Stopped") end end task.spawn(function() Move.waitChar(30) if Config.Running then Log.add("Running in a new server (" .. Config.Role .. ")") end while App.alive do if App.running() and not Hop.busy then local ok, err = pcall(App.tick) if not ok then Log.add("Error: " .. tostring(err)) task.wait(2) end elseif not App.running() and not Hop.busy then setStatus(Config.Running and "Starting" or "Stopped") end task.wait(0.5) end end) -- clock, heartbeats, time counter task.spawn(function() local n = 0 while App.alive do n = n + 1 pcall(Clock.update) if App.running() then Stats.data.seconds = Stats.data.seconds + 1 if n % 15 == 0 then Stats.save() end if n % 3 == 0 and Config.Role == "Main" then pcall(Sync.beatMain) end end if n % 3 == 0 then -- heartbeats even while stopped, so alts can find (and pick) this main, and mains can see their alts if Config.Role == "Main" and not App.running() then pcall(Sync.publishMain, "stopped") end if Config.Role == "Alt" then pcall(Sync.publishAlt, (not App.running()) and "stopped" or nil) end end task.wait(1) end end) -- walkspeed override (Off leaves it to the game; turning it off puts the old speed back) task.spawn(function() local base while App.alive do local _, _, hum = Game.char() if hum then if Config.WalkSpeed > 0 then base = base or hum.WalkSpeed if hum.WalkSpeed ~= Config.WalkSpeed then hum.WalkSpeed = Config.WalkSpeed end elseif base then hum.WalkSpeed = base base = nil end end task.wait(0.25) end end) -- anti-AFK track(LP.Idled:Connect(function() if not Config.AntiAfk then return end pcall(function() local vu = game:GetService("VirtualUser") vu:CaptureController() vu:ClickButton2(Vector2.new()) end) end)) -- disconnected / kicked: go to another server task.spawn(function() local ok, overlay = pcall(function() local g = S.CoreGui:WaitForChild("RobloxPromptGui", 15) return g and g:WaitForChild("promptOverlay", 15) end) if not ok or not overlay then return end track(overlay.ChildAdded:Connect(function(child) if child.Name ~= "ErrorPrompt" or not App.running() then return end Log.add("Disconnected; joining another server") Hook.send("Disconnected", "Joining another server", 0xEB707C, false, Hook.card("dc")) task.delay(2, function() if not Hop.busy and App.running() then Hop.go("disconnected") end end) end)) end) -- performance function App.applyPerf() pcall(function() S.Run:Set3dRenderingEnabled(not Config.No3D) end) if type(setfpscap) == "function" then pcall(setfpscap, Config.FpsCap > 0 and Config.FpsCap or 240) end end App.applyPerf() -- Discord: pops the server's "join" window in the Discord app (local RPC on port 6463). Once per PC on its -- own (autoexec reloads it every hop, so more would be spam); the Discord button in Settings opens it again. App.DISCORD = "mszFEnUtT8" function App.discord(force) if not force then if genv.__STINGERS_DISCORD or X.read("discord.txt") then return false end genv.__STINGERS_DISCORD = true end if not X.request then return false end -- the Discord app listens on the first free port from 6463 to 6472 for port = 6463, 6472 do local body = X.encode({ cmd = "INVITE_BROWSE", nonce = S.Http:GenerateGUID(false), args = { code = App.DISCORD } }) local ok, res = pcall(X.request, { Url = ("http://127.0.0.1:%d/rpc?v=1"):format(port), Method = "POST", Headers = { ["Content-Type"] = "application/json", ["Origin"] = "https://discord.com" }, Body = body or "", }) local code = ok and type(res) == "table" and tonumber(res.StatusCode) or 0 if code >= 200 and code < 300 then -- only remember it once Discord actually showed it, so a closed Discord gets another try next time if not force then X.write("discord.txt", "shown " .. os.date("%Y-%m-%d")) end return true end end return false end task.spawn(pcall, App.discord) --------------------------------------------------------------------------- -- themes: five editable colours; everything else is derived from them --------------------------------------------------------------------------- local THEME_ROLES = { "bg", "main", "accent", "outline", "font" } local THEME_PRESETS = { { name = "Default", bg = { 17, 17, 20 }, main = { 23, 23, 27 }, accent = { 168, 118, 118 }, outline = { 37, 37, 43 }, font = { 240, 238, 234 } }, { name = "Honey", bg = { 17, 17, 20 }, main = { 23, 23, 27 }, accent = { 240, 178, 62 }, outline = { 37, 37, 43 }, font = { 240, 238, 234 } }, { name = "Midnight", bg = { 12, 14, 22 }, main = { 18, 21, 33 }, accent = { 112, 152, 255 }, outline = { 34, 40, 62 }, font = { 230, 234, 246 } }, { name = "Graphite", bg = { 16, 16, 16 }, main = { 24, 24, 24 }, accent = { 226, 226, 226 }, outline = { 44, 44, 44 }, font = { 244, 244, 244 } }, { name = "Rose", bg = { 20, 15, 18 }, main = { 28, 21, 26 }, accent = { 240, 112, 142 }, outline = { 52, 36, 46 }, font = { 246, 236, 240 } }, { name = "Forest", bg = { 13, 18, 15 }, main = { 19, 26, 22 }, accent = { 96, 200, 140 }, outline = { 34, 50, 41 }, font = { 232, 241, 235 } }, { name = "Classic", bg = { 17, 17, 17 }, main = { 23, 23, 23 }, accent = { 0, 122, 255 }, outline = { 42, 42, 42 }, font = { 255, 255, 255 } }, } local ThemeStore = {} function ThemeStore.hex(c) return ("%02X%02X%02X"):format(math.floor(c.R * 255 + 0.5), math.floor(c.G * 255 + 0.5), math.floor(c.B * 255 + 0.5)) end function ThemeStore.color(s) if type(s) ~= "string" then return nil end s = s:gsub("#", ""):gsub("%s", "") if #s ~= 6 then return nil end local r, g, b = tonumber(s:sub(1, 2), 16), tonumber(s:sub(3, 4), 16), tonumber(s:sub(5, 6), 16) if r and g and b then return Color3.fromRGB(r, g, b) end return nil end function ThemeStore.preset(name) for _, p in ipairs(THEME_PRESETS) do if p.name == name then local b = {} for _, k in ipairs(THEME_ROLES) do b[k] = Color3.fromRGB(p[k][1], p[k][2], p[k][3]) end return b end end return nil end function ThemeStore.encode(base) local t = {} for _, k in ipairs(THEME_ROLES) do t[k] = "#" .. ThemeStore.hex(base[k]) end return t end function ThemeStore.decode(t) if type(t) ~= "table" then return nil end local b = {} for _, k in ipairs(THEME_ROLES) do b[k] = ThemeStore.color(t[k]) if not b[k] then return nil end end return b end -- theme.json (shared by every account on this PC): { current, currentName, default, defaultName } function ThemeStore.read() local t = X.load("theme.json") if type(t) ~= "table" then t = {} end return t end function ThemeStore.setCurrent(base, name) local t = ThemeStore.read() t.current, t.currentName = ThemeStore.encode(base), name X.save("theme.json", t) end function ThemeStore.setDefault(base, name) local t = ThemeStore.read() t.default, t.defaultName = ThemeStore.encode(base), name X.save("theme.json", t) end function ThemeStore.default() local t = ThemeStore.read() if ThemeStore.decode(t.default) then return ThemeStore.decode(t.default), t.defaultName or "Custom" end return ThemeStore.preset("Default"), "Default" end function ThemeStore.startup() local t = ThemeStore.read() local cur = ThemeStore.decode(t.current) if cur then return cur, t.currentName or "Custom" end return ThemeStore.default() end local function cleanFileName(s) s = tostring(s or ""):gsub("[^%w%s%-_]", ""):gsub("^%s+", ""):gsub("%s+$", "") return s:sub(1, 32) end -- names of *.json files in a folder; falls back to an index file when listfiles isn't available local function folderNames(sub) local out, seen = {}, {} local files = X.list(sub) if files then for _, f in ipairs(files) do local n = tostring(f):match("([^/\\]+)%.json$") if n and n ~= "index" and not seen[n] then seen[n] = true table.insert(out, n) end end else local idx = X.load(sub .. "/index.json") if type(idx) == "table" then for _, n in ipairs(idx) do if type(n) == "string" and not seen[n] then seen[n] = true table.insert(out, n) end end end end table.sort(out, function(a, b) return a:lower() < b:lower() end) return out end local function indexAdd(sub, name) local idx = X.load(sub .. "/index.json") if type(idx) ~= "table" then idx = {} end for _, n in ipairs(idx) do if n == name then return end end table.insert(idx, name) X.save(sub .. "/index.json", idx) end function ThemeStore.customs() return folderNames("themes") end function ThemeStore.saveCustom(name, base) X.save("themes/" .. name .. ".json", ThemeStore.encode(base)) indexAdd("themes", name) end function ThemeStore.loadCustom(name) return ThemeStore.decode(X.load("themes/" .. name .. ".json")) end --------------------------------------------------------------------------- -- configs: named sets of settings, import/export as JSON, autoload --------------------------------------------------------------------------- local Cfg = { KEYS = { "AltHold", "Vicious", "Windy", "WindyMinTime", "Mondo", "KingBeetle", "TunnelBear", "Sprouts", "SproutWant", "Planters", "PlanterMode", "Planter1", "Planter2", "Planter3", "PlanterField1", "PlanterField2", "PlanterField3", "PlanterPreset", "NectarOrder", "PlanterHarvestMode", "PlanterHours", "NectarCap", "PlanterUse", "MinLevel", "MaxLevel", "GiftedOnly", "HelpFights", "GrabBattle", "MoveMethod", "TweenUnlock", "WalkSpeed", "WaitNight", "SpikeWait", "MaxPlayers", "RevisitMinutes", "Forecast", "TweenSpeed", "StingerGoal", "Webhook", "PingId", "PingGifted", "HookKills", "No3D", "FpsCap", "AntiAfk", "Loader", "MenuKey", "UIScalePct", }, AUTOLOAD_FILE = "autoload_" .. KEY .. ".json", } function Cfg.snapshot() local t = { stingers = VERSION } for _, k in ipairs(Cfg.KEYS) do t[k] = Config[k] end return t end -- copy known settings from a table; returns how many were taken function Cfg.apply(t) if type(t) ~= "table" then return 0 end local n = 0 for _, k in ipairs(Cfg.KEYS) do if t[k] ~= nil and type(t[k]) == type(DEFAULTS[k]) then Config[k] = t[k] n = n + 1 end end App.clampConfig() App.saveNow() pcall(App.applyPerf) return n end function Cfg.names() return folderNames("configs") end function Cfg.save(name) X.save("configs/" .. name .. ".json", Cfg.snapshot()) indexAdd("configs", name) Config.CurrentConfig = name App.saveNow() end function Cfg.load(name) local t = X.load("configs/" .. name .. ".json") if type(t) ~= "table" then return false end local wasRunning = Config.Running Cfg.apply(t) Config.Running = wasRunning Config.CurrentConfig = name App.saveNow() return true end function Cfg.autoload() local t = X.load(Cfg.AUTOLOAD_FILE) return type(t) == "table" and type(t.name) == "string" and t.name ~= "" and t.name or nil end function Cfg.setAutoload(name) X.save(Cfg.AUTOLOAD_FILE, { name = name or "" }) end -- fresh start (not resuming after a hop): load the autoload config, or else the one used last if not Config.Running then local name = Cfg.autoload() or (Config.CurrentConfig ~= "" and Config.CurrentConfig or nil) if name and Cfg.load(name) then Log.add("Loaded config " .. name) end end --------------------------------------------------------------------------- -- UI --------------------------------------------------------------------------- local Theme = {} local function mix(a, b, t) return Color3.new(a.R + (b.R - a.R) * t, a.G + (b.G - a.G) * t, a.B + (b.B - a.B) * t) end local function lighten(c, f) return mix(c, Color3.new(1, 1, 1), f) end local UI = { conns = {}, gen = 0, state = { cfgName = "", cfgSel = Config.CurrentConfig, themeName = "", themeSel = "", import = "" } } UI.base, UI.themeName = ThemeStore.startup() function UI.derive() local b, white, black = UI.base, Color3.new(1, 1, 1), Color3.new(0, 0, 0) Theme.Top = lighten(b.bg, 0.025) Theme.Bottom = mix(b.bg, black, 0.18) Theme.Foot = mix(b.bg, black, 0.1) Theme.PanelTop = lighten(b.main, 0.03) Theme.PanelBot = mix(b.main, black, 0.1) Theme.Raised = lighten(b.main, 0.055) Theme.Raised2 = lighten(b.main, 0.12) Theme.Track = lighten(b.main, 0.17) Theme.Line = b.outline Theme.Line2 = lighten(b.outline, 0.1) Theme.Accent = b.accent local lum = 0.299 * b.accent.R + 0.587 * b.accent.G + 0.114 * b.accent.B Theme.OnAccent = lum > 0.55 and mix(b.accent, black, 0.84) or white Theme.Text = b.font Theme.Sub = mix(b.font, b.bg, 0.3) Theme.Muted = mix(b.font, b.bg, 0.55) Theme.Good = Color3.fromRGB(112, 204, 144) Theme.Bad = Color3.fromRGB(236, 104, 104) Theme.Gold = Color3.fromRGB(240, 200, 90) Theme.Night = mix(Color3.fromRGB(46, 52, 92), b.main, 0.25) Theme.Day = mix(Color3.fromRGB(86, 74, 46), b.main, 0.25) end UI.derive() local F = {} if not pcall(function() local fam = Font.fromEnum(Enum.Font.Gotham).Family F.reg = Font.new(fam, Enum.FontWeight.Regular) F.med = Font.new(fam, Enum.FontWeight.Medium) F.bold = Font.new(fam, Enum.FontWeight.Bold) end) then F.reg, F.med, F.bold = Font.fromEnum(Enum.Font.Gotham), Font.fromEnum(Enum.Font.GothamMedium), Font.fromEnum(Enum.Font.GothamBold) end F.mono = Font.fromEnum(Enum.Font.RobotoMono) -- connections made by the UI (dropped on every rebuild) local function utrack(c) table.insert(UI.conns, c) return c end function UI.new(class, props, children) local o = Instance.new(class) for k, v in pairs(props or {}) do if k ~= "Parent" then o[k] = v end end for _, c in ipairs(children or {}) do c.Parent = o end if props and props.Parent then o.Parent = props.Parent end return o end local function corner(r) return UI.new("UICorner", { CornerRadius = UDim.new(0, r) }) end local function pill() return UI.new("UICorner", { CornerRadius = UDim.new(1, 0) }) end local function pad(l, r, t, b) return UI.new("UIPadding", { PaddingLeft = UDim.new(0, l), PaddingRight = UDim.new(0, r), PaddingTop = UDim.new(0, t), PaddingBottom = UDim.new(0, b), }) end local function edge(color, transparency) return UI.new("UIStroke", { Color = color or Theme.Line, Thickness = 1, Transparency = transparency or 0, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }) end local function vgrad(top, bottom) return UI.new("UIGradient", { Rotation = 90, Color = ColorSequence.new(top, bottom) }) end local function accentGrad(rotation) return UI.new("UIGradient", { Rotation = rotation or 90, Color = ColorSequence.new(lighten(Theme.Accent, 0.16), Theme.Accent) }) end local function list(padding, horizontal) return UI.new("UIListLayout", { Padding = UDim.new(0, padding or 0), SortOrder = Enum.SortOrder.LayoutOrder, FillDirection = horizontal and Enum.FillDirection.Horizontal or Enum.FillDirection.Vertical, VerticalAlignment = horizontal and Enum.VerticalAlignment.Center or Enum.VerticalAlignment.Top, }) end local function anim(o, t, props) S.Tween:Create(o, TweenInfo.new(t, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), props):Play() end local function isPress(i) return i.UserInputType == Enum.UserInputType.MouseButton1 or i.UserInputType == Enum.UserInputType.Touch end local function isMoveInput(i) return i.UserInputType == Enum.UserInputType.MouseMovement or i.UserInputType == Enum.UserInputType.Touch end local function text(props) props.BackgroundTransparency = 1 props.TextXAlignment = props.TextXAlignment or Enum.TextXAlignment.Left props.FontFace = props.FontFace or F.med props.TextColor3 = props.TextColor3 or Theme.Text props.TextSize = props.TextSize or 13 return UI.new("TextLabel", props) end -- a value a control edits: a Config key, or { get = fn, set = fn } local function binding(key) if type(key) == "table" then return key.get, key.set end return function() return Config[key] end, function(v) Config[key] = v App.save() end end local function plain(v) return tostring(math.floor(v + 0.5)) end local function secs(v) return v == 0 and "Off" or (plain(v) .. "s") end local function mins(v) return plain(v) .. " min" end local function fmtNum(n) n = tonumber(n) or 0 if n >= 1e6 then return ("%.1fM"):format(n / 1e6) end if n >= 1e4 then return ("%.1fK"):format(n / 1e3) end return tostring(math.floor(n)) end local function fmtTime(s) s = math.floor(tonumber(s) or 0) return ("%d:%02d:%02d"):format(math.floor(s / 3600), math.floor(s % 3600 / 60), s % 60) end local function clockText(c) return ("%02d:%02d"):format(math.floor(c) % 24, math.floor((c % 1) * 60)) end --------------------------------------------------------------------------- -- building blocks (used inside UI.build) --------------------------------------------------------------------------- -- the logo: the mono image tinted to the accent colour function UI.logo(parent, size, z) z = z or 1 local holder = UI.new("Frame", { Parent = parent, Size = UDim2.fromOffset(size, size), BackgroundTransparency = 1, ZIndex = z }) local image = (LOGO_MONO ~= "" and LOGO_MONO) or LOGO_IMAGE if image ~= "" then UI.new("ImageLabel", { Parent = holder, Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = image, ImageColor3 = (image == LOGO_MONO) and Theme.Accent or Color3.new(1, 1, 1), ScaleType = Enum.ScaleType.Fit, ZIndex = z }) return holder end -- no image set: a drawn tile with an N local m = UI.new("Frame", { Parent = holder, Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, ZIndex = z }, { corner(math.floor(size * 0.3)), accentGrad() }) text({ Parent = m, Size = UDim2.fromScale(1, 1), Text = "S", FontFace = F.bold, TextSize = math.floor(size * 0.58), TextColor3 = Theme.OnAccent, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z + 1 }) return holder end function UI.row(box, height, visibleIf) box.rows = box.rows + 1 local r = UI.new("Frame", { Parent = box.body, LayoutOrder = box.rows, Size = UDim2.new(1, 0, 0, height), BackgroundTransparency = 1 }) if visibleIf then table.insert(UI.vis, { row = r, fn = visibleIf }) end return r end function UI.refreshVisibility() for _, v in ipairs(UI.vis) do local ok, show = pcall(v.fn) local want = ok and show == true if v.row.Visible ~= want then v.row.Visible = want end end end function UI.switch(box, label, key, cb, visibleIf) local get, set = binding(key) local r = UI.row(box, 20, visibleIf) local lbl = text({ Parent = r, Size = UDim2.new(1, -44, 1, 0), Text = label, TextSize = 12, TextTruncate = Enum.TextTruncate.AtEnd }) local rail = UI.new("Frame", { Parent = r, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, 0, 0.5, 0), Size = UDim2.fromOffset(32, 18), BackgroundColor3 = Theme.Track, BorderSizePixel = 0 }, { pill() }) local knob = UI.new("Frame", { Parent = rail, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 3, 0.5, 0), Size = UDim2.fromOffset(12, 12), BackgroundColor3 = Theme.Sub, BorderSizePixel = 0 }, { pill() }) local hit = UI.new("TextButton", { Parent = r, Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Text = "" }) local function paint(instant) local on = get() == true local railP = { BackgroundColor3 = on and Theme.Accent or Theme.Track } local knobP = { Position = on and UDim2.new(1, -15, 0.5, 0) or UDim2.new(0, 3, 0.5, 0), BackgroundColor3 = on and Theme.OnAccent or Theme.Sub } local lblP = { TextColor3 = on and Theme.Text or Theme.Sub } if instant then for k, v in pairs(railP) do rail[k] = v end for k, v in pairs(knobP) do knob[k] = v end for k, v in pairs(lblP) do lbl[k] = v end else anim(rail, 0.18, railP) anim(knob, 0.18, knobP) anim(lbl, 0.18, lblP) end end paint(true) table.insert(UI.painters, function() paint(true) end) utrack(hit.Activated:Connect(function() set(not get()) paint(false) if cb then cb(get()) end UI.refreshVisibility() end)) return r end function UI.slider(box, label, key, min, max, step, fmt, cb, visibleIf, onRelease, colorOf) local get, set = binding(key) local r = UI.row(box, 30, visibleIf) text({ Parent = r, Size = UDim2.new(1, -70, 0, 15), Text = label, TextSize = 12, TextColor3 = Theme.Sub, TextTruncate = Enum.TextTruncate.AtEnd }) local val = text({ Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.fromOffset(70, 15), Text = "", FontFace = F.bold, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Right }) local rail = UI.new("Frame", { Parent = r, Position = UDim2.fromOffset(0, 23), Size = UDim2.new(1, 0, 0, 4), BackgroundColor3 = Theme.Track, BorderSizePixel = 0 }, { pill() }) local grad = accentGrad(0) local fill = UI.new("Frame", { Parent = rail, Size = UDim2.fromScale(0, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0 }, { pill(), grad }) local knob = UI.new("Frame", { Parent = rail, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0, 0.5), Size = UDim2.fromOffset(12, 12), BackgroundColor3 = Theme.Text, BorderSizePixel = 0, ZIndex = 2 }, { pill() }) local ring = edge(Theme.Bottom) ring.Thickness = 2 ring.Parent = knob local hit = UI.new("TextButton", { Parent = r, Position = UDim2.fromOffset(0, 14), Size = UDim2.new(1, 0, 0, 18), BackgroundTransparency = 1, Text = "", ZIndex = 3 }) local function show(v, silent) v = tonumber(v) or min v = math.clamp(min + math.floor((v - min) / step + 0.5) * step, min, max) local changed = get() ~= v if changed then set(v) end local a = (v - min) / (max - min) fill.Size = UDim2.fromScale(a, 1) knob.Position = UDim2.fromScale(a, 0.5) val.Text = fmt(v) if colorOf then local c = colorOf(v) grad.Enabled = false fill.BackgroundColor3, val.TextColor3 = c, c end if not silent and changed and cb then cb(v) end end show(get(), true) table.insert(UI.painters, function() show(get(), true) end) local dragging, scroller = false, nil local function fromX(x) local a = math.clamp((x - rail.AbsolutePosition.X) / math.max(rail.AbsoluteSize.X, 1), 0, 1) show(min + a * (max - min)) end utrack(hit.InputBegan:Connect(function(i) if isPress(i) then dragging = true scroller = r:FindFirstAncestorWhichIsA("ScrollingFrame") if scroller then scroller.ScrollingEnabled = false end anim(knob, 0.12, { Size = UDim2.fromOffset(15, 15) }) fromX(i.Position.X) end end)) utrack(S.UIS.InputChanged:Connect(function(i) if dragging and isMoveInput(i) then fromX(i.Position.X) end end)) utrack(S.UIS.InputEnded:Connect(function(i) if dragging and isPress(i) then dragging = false if scroller then scroller.ScrollingEnabled = true end anim(knob, 0.12, { Size = UDim2.fromOffset(12, 12) }) if onRelease then onRelease(get()) end end end)) return r end -- popup layer: lists and the colour picker open here; onClose runs when it closes function UI.closePopup() if not UI.overlay then return end UI.overlay.Visible = false for _, c in ipairs(UI.overlay:GetChildren()) do c:Destroy() end local fn = UI.onPopupClose UI.onPopupClose, UI.popupGuard, UI.popupPanel, UI.popupHover = nil, nil, nil, false if fn then fn() end end -- is this press on the open popup? (hover for mouse; position for touch, allowing for the top bar inset) function UI.overPopup(i) if UI.popupHover then return true end local p = UI.popupPanel if not p or not p.Parent or not i or i.UserInputType ~= Enum.UserInputType.Touch then return false end local inset = 0 pcall(function() inset = game:GetService("GuiService"):GetGuiInset().Y end) local a, sz = p.AbsolutePosition, p.AbsoluteSize for _, off in ipairs({ 0, inset }) do local x, y = i.Position.X, i.Position.Y + off if x >= a.X and x <= a.X + sz.X and y >= a.Y and y <= a.Y + sz.Y then return true end end return false end function UI.setPopupPanel(p) UI.popupPanel, UI.popupHover = p, false utrack(p.MouseEnter:Connect(function() UI.popupHover = true end)) utrack(p.MouseLeave:Connect(function() UI.popupHover = false end)) end -- live theme preview: swap every colour from the old palette to the new one, without rebuilding local function colorKey(c) return math.floor(c.R * 255 + 0.5) * 65536 + math.floor(c.G * 255 + 0.5) * 256 + math.floor(c.B * 255 + 0.5) end function UI.recolor(old, new, skip) if not UI.gui then return end local map = {} for k, c in pairs(old) do local n = new[k] if typeof(c) == "Color3" and typeof(n) == "Color3" then local key = colorKey(c) -- pure white/black are gradient bases and picker parts, not theme colours if key ~= 0 and key ~= 16777215 and map[key] == nil then map[key] = n end end end local function conv(c) return map[colorKey(c)] end for _, d in ipairs(UI.gui:GetDescendants()) do if not (skip and (d == skip or d:IsDescendantOf(skip))) then if d:IsA("GuiObject") then local n = conv(d.BackgroundColor3) if n then d.BackgroundColor3 = n end if d:IsA("TextLabel") or d:IsA("TextButton") or d:IsA("TextBox") then n = conv(d.TextColor3) if n then d.TextColor3 = n end if d:IsA("TextBox") then n = conv(d.PlaceholderColor3) if n then d.PlaceholderColor3 = n end end elseif d:IsA("ImageLabel") or d:IsA("ImageButton") then n = conv(d.ImageColor3) if n then d.ImageColor3 = n end end if d:IsA("ScrollingFrame") then n = conv(d.ScrollBarImageColor3) if n then d.ScrollBarImageColor3 = n end end elseif d:IsA("UIStroke") then local n = conv(d.Color) if n then d.Color = n end elseif d:IsA("UIGradient") then local keys, changed = {}, false for _, kp in ipairs(d.Color.Keypoints) do local n = conv(kp.Value) if n then changed = true end table.insert(keys, ColorSequenceKeypoint.new(kp.Time, n or kp.Value)) end if changed then d.Color = ColorSequence.new(keys) end end end end end -- where a control sits, in the window's own (unscaled) coordinates function UI.local_(o) local s = math.max(UI.scale.Scale, 0.01) return (o.AbsolutePosition.X - UI.win.AbsolutePosition.X) / s, (o.AbsolutePosition.Y - UI.win.AbsolutePosition.Y) / s, o.AbsoluteSize.X / s, o.AbsoluteSize.Y / s end -- popup list under (or above) a field. multi = options toggle on and off (current is then a function o -> on?) -- and the list stays open while you pick function UI.openList(anchor, options, current, onPick, onClosed, multi) UI.closePopup() local x, y, w, h = UI.local_(anchor) local ROW = 30 local rows = math.max(#options, 1) local menuH = math.min(rows, 8) * (ROW + 2) + 8 local winH = UI.win.AbsoluteSize.Y / math.max(UI.scale.Scale, 0.01) local top = y + h + 6 if top + menuH > winH - 6 then top = math.max(6, y - menuH - 6) end -- soft shadow under it UI.new("Frame", { Parent = UI.overlay, Position = UDim2.fromOffset(x + 1, top + 5), Size = UDim2.fromOffset(w, menuH), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.55, BorderSizePixel = 0, ZIndex = 50 }, { corner(11) }) local menu = UI.new("ScrollingFrame", { Parent = UI.overlay, Position = UDim2.fromOffset(x, top), Size = UDim2.fromOffset(w, menuH), BackgroundColor3 = Theme.Raised, BorderSizePixel = 0, ZIndex = 51, ScrollBarThickness = 2, ScrollBarImageColor3 = Theme.Line2, CanvasSize = UDim2.new(), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y }, { corner(10), edge(Theme.Line2), pad(4, 4, 4, 4), list(2) }) if #options == 0 then text({ Parent = menu, Size = UDim2.new(1, 0, 0, ROW), Text = " Nothing here yet", TextSize = 12, TextColor3 = Theme.Muted, ZIndex = 52 }) end for i, o in ipairs(options) do local item = UI.new("TextButton", { Parent = menu, LayoutOrder = i, Size = UDim2.new(1, 0, 0, ROW), BackgroundColor3 = Theme.Raised2, BackgroundTransparency = 1, AutoButtonColor = false, BorderSizePixel = 0, Text = "", ZIndex = 52 }, { corner(7) }) local mark, tick, lbl if multi then -- a checkbox on the left mark = UI.new("Frame", { Parent = item, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 8, 0.5, 0), Size = UDim2.fromOffset(16, 16), BackgroundColor3 = Theme.Track, BorderSizePixel = 0, ZIndex = 53 }, { corner(5) }) tick = UI.new("Frame", { Parent = mark, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(6, 6), BackgroundColor3 = Theme.OnAccent, BorderSizePixel = 0, ZIndex = 54 }, { corner(2) }) lbl = text({ Parent = item, Position = UDim2.fromOffset(32, 0), Size = UDim2.new(1, -40, 1, 0), Text = o, TextSize = 12, ZIndex = 53, TextTruncate = Enum.TextTruncate.AtEnd }) else -- an accent bar on the left of the current choice mark = UI.new("Frame", { Parent = item, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 5, 0.5, 0), Size = UDim2.fromOffset(3, 14), BackgroundColor3 = Theme.Accent, BorderSizePixel = 0, ZIndex = 53 }, { pill() }) lbl = text({ Parent = item, Position = UDim2.fromOffset(16, 0), Size = UDim2.new(1, -24, 1, 0), Text = o, TextSize = 12, ZIndex = 53, TextTruncate = Enum.TextTruncate.AtEnd }) end local function paint() local on if multi then on = current(o) == true else on = current == o end lbl.TextColor3 = on and Theme.Text or Theme.Sub lbl.FontFace = on and F.bold or F.med if multi then mark.BackgroundColor3 = on and Theme.Accent or Theme.Track tick.Visible = on else mark.Visible = on end end paint() utrack(item.MouseEnter:Connect(function() item.BackgroundTransparency = 0 end)) utrack(item.MouseLeave:Connect(function() item.BackgroundTransparency = 1 end)) utrack(item.Activated:Connect(function() if multi then onPick(o) paint() else UI.closePopup() onPick(o) end end)) end UI.onPopupClose = onClosed UI.setPopupPanel(menu) UI.popupGuard = function(i) return UI.overPopup(i) end UI.overlay.Visible = true end -- pick any number of options: the field sums up what's on; the list stays open while you tick function UI.multi(box, label, options, isOn, toggle, visibleIf) local r = UI.row(box, 28, visibleIf) text({ Parent = r, Size = UDim2.new(0.42, 0, 1, 0), Text = label, TextSize = 12, TextColor3 = Theme.Sub, TextTruncate = Enum.TextTruncate.AtEnd }) local b = UI.new("TextButton", { Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.58, 0, 1, 0), BackgroundColor3 = Theme.Raised, AutoButtonColor = false, BorderSizePixel = 0, Text = "" }, { corner(8), edge(Theme.Line), pad(10, 8, 0, 0) }) local v = text({ Parent = b, Size = UDim2.new(1, -16, 1, 0), Text = "", TextSize = 12, TextTruncate = Enum.TextTruncate.AtEnd }) local chev = text({ Parent = b, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, 0, 0.5, 0), Size = UDim2.fromOffset(12, 12), Text = "\u{203A}", Rotation = 90, TextColor3 = Theme.Muted, TextSize = 15, TextXAlignment = Enum.TextXAlignment.Center }) local function paint() local on = {} for _, o in ipairs(options) do if isOn(o) then table.insert(on, o) end end if #on == 0 then v.Text, v.TextColor3 = "None", Theme.Muted elseif #on == #options then v.Text, v.TextColor3 = "All", Theme.Text elseif #on <= 2 then v.Text, v.TextColor3 = table.concat(on, ", "), Theme.Text else v.Text, v.TextColor3 = ("%s, %s +%d"):format(on[1], on[2], #on - 2), Theme.Text end end paint() table.insert(UI.painters, paint) utrack(b.MouseEnter:Connect(function() anim(b, 0.12, { BackgroundColor3 = Theme.Raised2 }) end)) utrack(b.MouseLeave:Connect(function() anim(b, 0.12, { BackgroundColor3 = Theme.Raised }) end)) utrack(b.Activated:Connect(function() UI.openList(b, options, isOn, function(o) toggle(o) paint() end, function() chev.Rotation = 90 end, true) chev.Rotation = -90 end)) return r end -- dropdown. inline = label on the left and the field on the right; otherwise the label sits above a full-width field. -- options may be a function (lists that change, like saved configs) function UI.dropdown(box, label, key, options, cb, visibleIf, inline) local get, set = binding(key) local r = UI.row(box, inline and 28 or 46, visibleIf) local b if inline then text({ Parent = r, Size = UDim2.new(0.42, 0, 1, 0), Text = label, TextSize = 12, TextColor3 = Theme.Sub, TextTruncate = Enum.TextTruncate.AtEnd }) b = UI.new("TextButton", { Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.58, 0, 1, 0), BackgroundColor3 = Theme.Raised, AutoButtonColor = false, BorderSizePixel = 0, Text = "" }, { corner(8), edge(Theme.Line), pad(10, 8, 0, 0) }) else text({ Parent = r, Size = UDim2.new(1, 0, 0, 14), Text = label, TextSize = 12, TextColor3 = Theme.Sub }) b = UI.new("TextButton", { Parent = r, Position = UDim2.fromOffset(0, 18), Size = UDim2.new(1, 0, 0, 28), BackgroundColor3 = Theme.Raised, AutoButtonColor = false, BorderSizePixel = 0, Text = "" }, { corner(8), edge(Theme.Line), pad(10, 8, 0, 0) }) end local v = text({ Parent = b, Size = UDim2.new(1, -16, 1, 0), Text = "", TextSize = 12, TextTruncate = Enum.TextTruncate.AtEnd }) local chev = text({ Parent = b, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, 0, 0.5, 0), Size = UDim2.fromOffset(12, 12), Text = "\u{203A}", Rotation = 90, TextColor3 = Theme.Muted, TextSize = 15, TextXAlignment = Enum.TextXAlignment.Center }) local function paint() local cur = get() v.Text = (cur == nil or cur == "") and "--" or tostring(cur) v.TextColor3 = (cur == nil or cur == "") and Theme.Muted or Theme.Text end paint() table.insert(UI.painters, paint) utrack(b.MouseEnter:Connect(function() anim(b, 0.12, { BackgroundColor3 = Theme.Raised2 }) end)) utrack(b.MouseLeave:Connect(function() anim(b, 0.12, { BackgroundColor3 = Theme.Raised }) end)) utrack(b.Activated:Connect(function() local opts = type(options) == "function" and options() or options UI.openList(b, opts, get(), function(o) if get() ~= o then set(o) paint() if cb then cb(o) end UI.refreshVisibility() end end, function() chev.Rotation = 90 end) chev.Rotation = -90 end)) return r end -- text field. inline = label left / field right; otherwise label above a full-width field function UI.input(box, label, key, placeholder, cb, visibleIf, inline) local get, set = binding(key) local r = UI.row(box, inline and 28 or 46, visibleIf) local holder if inline then text({ Parent = r, Size = UDim2.new(0.42, 0, 1, 0), Text = label, TextSize = 12, TextColor3 = Theme.Sub, TextTruncate = Enum.TextTruncate.AtEnd }) holder = UI.new("Frame", { Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.58, 0, 1, 0), BackgroundColor3 = Theme.Raised, BorderSizePixel = 0, ClipsDescendants = true }, { corner(8), pad(10, 10, 0, 0) }) else text({ Parent = r, Size = UDim2.new(1, 0, 0, 14), Text = label, TextSize = 12, TextColor3 = Theme.Sub }) holder = UI.new("Frame", { Parent = r, Position = UDim2.fromOffset(0, 18), Size = UDim2.new(1, 0, 0, 28), BackgroundColor3 = Theme.Raised, BorderSizePixel = 0, ClipsDescendants = true }, { corner(8), pad(10, 10, 0, 0) }) end local e = edge(Theme.Line) e.Parent = holder local tb = UI.new("TextBox", { Parent = holder, Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, ClearTextOnFocus = false, Text = tostring(get() or ""), PlaceholderText = placeholder or "", PlaceholderColor3 = Theme.Muted, TextColor3 = Theme.Text, FontFace = F.med, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }) utrack(tb.Focused:Connect(function() anim(e, 0.15, { Color = Theme.Accent }) end)) utrack(tb.FocusLost:Connect(function() anim(e, 0.15, { Color = Theme.Line }) local v = tb.Text:gsub("^%s+", ""):gsub("%s+$", "") tb.Text = v if get() ~= v then set(v) if cb then cb(v) end end UI.refreshVisibility() end)) table.insert(UI.painters, function() if not tb:IsFocused() then tb.Text = tostring(get() or "") end end) return r end -- buttons sharing one line: { { label, fn }, ... }; fn may return a short reply shown on the button function UI.buttons(box, buttons, visibleIf) local r = UI.row(box, 28, visibleIf) local n = #buttons for i, spec in ipairs(buttons) do local label, fn = spec[1], spec[2] local b = UI.new("TextButton", { Parent = r, Position = UDim2.new((i - 1) / n, i > 1 and 4 or 0, 0, 0), Size = UDim2.new(1 / n, n > 1 and -4 or 0, 1, 0), BackgroundColor3 = Theme.Raised, AutoButtonColor = false, BorderSizePixel = 0, Text = label, TextColor3 = Theme.Text, FontFace = F.med, TextSize = 12, TextTruncate = Enum.TextTruncate.AtEnd, }, { corner(8) }) local e = edge(Theme.Line) e.Parent = b utrack(b.MouseEnter:Connect(function() anim(b, 0.12, { BackgroundColor3 = Theme.Raised2 }) end)) utrack(b.MouseLeave:Connect(function() anim(b, 0.12, { BackgroundColor3 = Theme.Raised }) end)) local busy = false utrack(b.Activated:Connect(function() if busy then return end busy = true task.spawn(function() local ok, res = pcall(fn) if ok and type(res) == "string" and b.Parent then b.Text = res b.TextColor3 = Theme.Accent e.Color = Theme.Accent task.wait(1.4) if b.Parent then b.Text = label b.TextColor3 = Theme.Text anim(e, 0.3, { Color = Theme.Line }) end elseif not ok then Log.add("Button error: " .. tostring(res)) end busy = false end) end)) end return r end -- text that updates itself: fn returns text[, color] function UI.live(box, height, fn, props, visibleIf) local r = UI.row(box, height, visibleIf) local p = props or {} local lbl = text({ Parent = r, Size = UDim2.fromScale(1, 1), Text = "", TextColor3 = Theme.Sub, FontFace = p.font or F.med, TextSize = p.size or 12, TextWrapped = true, TextYAlignment = Enum.TextYAlignment.Top, RichText = p.rich == true, LineHeight = p.lineHeight or 1.15 }) table.insert(UI.refreshers, function() local ok, s, c = pcall(fn) if ok then lbl.Text = tostring(s or "") lbl.TextColor3 = c or p.color or Theme.Sub end end) return r, lbl end function UI.pair(box, label, fn, visibleIf) local r = UI.row(box, 16, visibleIf) text({ Parent = r, Size = UDim2.new(0.45, 0, 1, 0), Text = label, TextColor3 = Theme.Muted, TextSize = 12 }) local v = text({ Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.55, 0, 1, 0), Text = "", TextSize = 12, TextXAlignment = Enum.TextXAlignment.Right, TextTruncate = Enum.TextTruncate.AtEnd }) table.insert(UI.refreshers, function() local ok, s, c = pcall(fn) if ok then v.Text = tostring(s or "") v.TextColor3 = c or Theme.Text end end) return r end function UI.numbers(box, cells) local rows = math.ceil(#cells / 3) local r = UI.row(box, rows * 46 + (rows - 1) * 6) UI.new("UIGridLayout", { Parent = r, CellSize = UDim2.new(1 / 3, -4, 0, 46), CellPadding = UDim2.fromOffset(6, 6), SortOrder = Enum.SortOrder.LayoutOrder }) for i, c in ipairs(cells) do local cell = UI.new("Frame", { Parent = r, LayoutOrder = i, BackgroundColor3 = Theme.Raised, BorderSizePixel = 0 }, { corner(8), edge(Theme.Line), pad(10, 8, 8, 6) }) text({ Parent = cell, Size = UDim2.new(1, 0, 0, 11), Text = c[1]:upper(), FontFace = F.bold, TextSize = 9, TextColor3 = Theme.Muted }) local v = text({ Parent = cell, Position = UDim2.fromOffset(0, 15), Size = UDim2.new(1, 0, 0, 17), Text = "0", FontFace = F.bold, TextSize = 15, TextTruncate = Enum.TextTruncate.AtEnd }) local fn = c[2] table.insert(UI.refreshers, function() local ok, s, col = pcall(fn) if ok then v.Text = tostring(s) v.TextColor3 = col or Theme.Text end end) end return r end local function mmss(s) s = math.max(0, math.floor(s + 0.5)) if s >= 3600 then return ("%d:%02d:%02d"):format(math.floor(s / 3600), math.floor(s % 3600 / 60), s % 60) end return ("%d:%02d"):format(math.floor(s / 60), s % 60) end -- the server's day/night phase: what it is, how long it's been, what's next, on a bar for the phase. -- Day bar spans the 30-minute maximum with the 10-30 minute window where night can fall shaded; -- night bar spans its fixed 2:35. When we arrived mid-phase there's no start time, so a shimmer runs instead. function UI.clock(box) local r = UI.row(box, 50) local MOON = Color3.fromRGB(196, 208, 255) local orb = UI.new("Frame", { Parent = r, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 1, 0, 8), Size = UDim2.fromOffset(7, 7), BackgroundColor3 = Theme.Gold, BorderSizePixel = 0 }, { pill() }) local orbGlow = UI.new("Frame", { Parent = r, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0, 4.5, 0, 8), Size = UDim2.fromOffset(15, 15), BackgroundColor3 = Theme.Gold, BackgroundTransparency = 0.8, BorderSizePixel = 0 }, { pill() }) local now = text({ Parent = r, Position = UDim2.fromOffset(15, 0), Size = UDim2.new(0.5, -15, 0, 16), Text = "", FontFace = F.bold, TextSize = 12, RichText = true }) local nxt = text({ Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0.5, 0, 0, 16), Text = "", TextSize = 11, TextXAlignment = Enum.TextXAlignment.Right, RichText = true }) local rail = UI.new("Frame", { Parent = r, Position = UDim2.fromOffset(0, 24), Size = UDim2.new(1, 0, 0, 8), BackgroundColor3 = Theme.Track, BorderSizePixel = 0, ClipsDescendants = true }, { pill() }) local window = UI.new("Frame", { Parent = rail, Position = UDim2.fromScale(Clock.DAY_MIN / Clock.DAY_MAX, 0), Size = UDim2.fromScale(1 - Clock.DAY_MIN / Clock.DAY_MAX, 1), BackgroundColor3 = Theme.Accent, BackgroundTransparency = 0.72, BorderSizePixel = 0 }) local fill = UI.new("Frame", { Parent = rail, Size = UDim2.fromScale(0, 1), BackgroundColor3 = Theme.Gold, BackgroundTransparency = 0.25, BorderSizePixel = 0, ZIndex = 2 }, { pill() }) local shimmer = UI.new("Frame", { Parent = rail, Position = UDim2.fromScale(-0.3, 0), Size = UDim2.fromScale(0.3, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, ZIndex = 3 }, { UI.new("UIGradient", { Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.5, 0.8), NumberSequenceKeypoint.new(1, 1) }) }) }) local marker = UI.new("Frame", { Parent = r, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0, 0, 0, 28), Size = UDim2.fromOffset(22, 22), BackgroundTransparency = 1, ZIndex = 4 }) local halo = UI.new("Frame", { Parent = marker, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromScale(1, 1), BackgroundColor3 = Theme.Gold, BackgroundTransparency = 0.8, BorderSizePixel = 0, ZIndex = 4 }, { pill() }) local core = UI.new("Frame", { Parent = marker, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(10, 10), BackgroundColor3 = Theme.Gold, BorderSizePixel = 0, ZIndex = 5 }, { pill() }) local coreEdge = edge(Theme.Bottom) coreEdge.Thickness = 2 coreEdge.Parent = core local ticks = {} for i, x in ipairs({ 0, 1 / 3, 2 / 3, 1 }) do ticks[i] = text({ Parent = r, AnchorPoint = Vector2.new(x, 0), Position = UDim2.new(x, 0, 0, 38), Size = UDim2.fromOffset(30, 11), Text = "", TextColor3 = Theme.Muted, TextSize = 9, TextXAlignment = (i == 1 and Enum.TextXAlignment.Left) or (i == 4 and Enum.TextXAlignment.Right) or Enum.TextXAlignment.Center }) end local breathe, lastPhase, sweep = false, nil, -0.3 table.insert(UI.refreshers, function() local phase = Clock.phase or (Clock.isNight() and "night" or "day") local night = phase == "night" local tint = night and MOON or Theme.Gold local e = Clock.elapsed() local muted = "#" .. ThemeStore.hex(Theme.Muted) local accent = "#" .. ThemeStore.hex(Theme.Accent) orb.BackgroundColor3, orbGlow.BackgroundColor3 = tint, tint core.BackgroundColor3, halo.BackgroundColor3, fill.BackgroundColor3 = tint, tint, tint now.TextColor3 = tint now.Text = (night and "Night" or "Day") .. (Clock.known and (' %s'):format("#" .. ThemeStore.hex(Theme.Text), mmss(e)) or "") local frac if night then window.Visible = false local left = Clock.nightLeft() if left then nxt.Text = ('day in %s'):format(muted, mmss(left)) frac = math.clamp(e / Clock.NIGHT_LEN, 0, 1) else nxt.Text = ('ends within 2:35'):format(muted) end if lastPhase ~= phase then ticks[1].Text, ticks[2].Text, ticks[3].Text, ticks[4].Text = "0:00", "", "", "2:35" end else window.Visible = true if Clock.known and e < Clock.DAY_MIN then nxt.Text = ('night no sooner than %s'):format(muted, mmss(Clock.DAY_MIN - e)) elseif Clock.known then nxt.Text = ('night due · within %s'):format(muted, mmss(math.max(0, Clock.DAY_MAX - e))) else nxt.Text = ('night within 30:00'):format(muted) end if Clock.known then frac = math.clamp(e / Clock.DAY_MAX, 0, 1) end if lastPhase ~= phase then ticks[1].Text, ticks[2].Text, ticks[3].Text, ticks[4].Text = "0", "10m", "20m", "30m" end end nxt.TextColor3 = Theme.Text lastPhase = phase breathe = not breathe anim(orbGlow, 0.5, { BackgroundTransparency = breathe and 0.65 or 0.88 }) if frac then fill.Visible, marker.Visible, shimmer.Visible = true, true, false anim(fill, 0.5, { Size = UDim2.fromScale(frac, 1) }) anim(marker, 0.5, { Position = UDim2.new(frac, 0, 0, 28) }) anim(halo, 0.5, { BackgroundTransparency = breathe and 0.68 or 0.86, Size = breathe and UDim2.fromScale(1, 1) or UDim2.fromScale(0.8, 0.8) }) else fill.Visible, marker.Visible, shimmer.Visible = false, false, true sweep = sweep + 0.16 if sweep > 1.05 then sweep = -0.3 end anim(shimmer, 0.5, { Position = UDim2.fromScale(sweep, 0) }) end end) return r end function UI.keybind(box, label, key) local r = UI.row(box, 24) text({ Parent = r, Size = UDim2.new(0.5, 0, 1, 0), Text = label, TextSize = 12, TextColor3 = Theme.Sub }) local b = UI.new("TextButton", { Parent = r, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = Theme.Raised, AutoButtonColor = false, BorderSizePixel = 0, Text = Config[key], TextColor3 = Theme.Text, FontFace = F.med, TextSize = 11, }, { corner(7), pad(10, 10, 0, 0), edge(Theme.Line) }) utrack(b.Activated:Connect(function() b.Text = "Press a key" b.TextColor3 = Theme.Accent UI.listening = function(code) Config[key] = code.Name App.save() if b.Parent then b.Text = code.Name b.TextColor3 = Theme.Text end end end)) return r end -- colour picker: saturation/brightness square, hue strip, hex field. Applies when it closes. function UI.openPicker(anchor, role, onDone) UI.closePopup() local start = UI.base[role] local h, s, v = start:ToHSV() local x, y, w, ah = UI.local_(anchor) local PW, PH = 214, 182 local winW = UI.win.AbsoluteSize.X / math.max(UI.scale.Scale, 0.01) local winH = UI.win.AbsoluteSize.Y / math.max(UI.scale.Scale, 0.01) local px = math.clamp(x + w - PW, 6, winW - PW - 6) local py = y + ah + 6 if py + PH > winH - 6 then py = math.max(6, y - PH - 6) end local panel = UI.new("Frame", { Parent = UI.overlay, Position = UDim2.fromOffset(px, py), Size = UDim2.fromOffset(PW, PH), BackgroundColor3 = Theme.Raised, BorderSizePixel = 0, ZIndex = 51, Active = true }, { corner(10), edge(Theme.Line2), pad(10, 10, 10, 10) }) local sq = UI.new("Frame", { Parent = panel, Size = UDim2.new(1, -24, 0, 120), BackgroundColor3 = Color3.fromHSV(h, 1, 1), BorderSizePixel = 0, ZIndex = 52, Active = true }, { corner(6) }) UI.new("Frame", { Parent = sq, Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, ZIndex = 53 }, { corner(6), UI.new("UIGradient", { Transparency = NumberSequence.new(0, 1) }) }) UI.new("Frame", { Parent = sq, Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0), BorderSizePixel = 0, ZIndex = 54 }, { corner(6), UI.new("UIGradient", { Rotation = 90, Transparency = NumberSequence.new(1, 0) }) }) local dot = UI.new("Frame", { Parent = sq, AnchorPoint = Vector2.new(0.5, 0.5), Size = UDim2.fromOffset(10, 10), BackgroundTransparency = 1, ZIndex = 55 }, { pill() }) local dotEdge = edge(Color3.new(1, 1, 1)) dotEdge.Thickness = 2 dotEdge.Parent = dot local hueKeys = {} for i = 0, 6 do table.insert(hueKeys, ColorSequenceKeypoint.new(i / 6, Color3.fromHSV((i / 6) % 1, 1, 1))) end local hue = UI.new("Frame", { Parent = panel, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, 0, 0, 0), Size = UDim2.fromOffset(14, 120), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, ZIndex = 52, Active = true }, { corner(5), UI.new("UIGradient", { Rotation = 90, Color = ColorSequence.new(hueKeys) }) }) local hueMark = UI.new("Frame", { Parent = hue, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, h), Size = UDim2.new(1, 4, 0, 4), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, ZIndex = 53 }, { pill() }) local swatch = UI.new("Frame", { Parent = panel, Position = UDim2.fromOffset(0, 132), Size = UDim2.fromOffset(30, 30), BorderSizePixel = 0, BackgroundColor3 = start, ZIndex = 52 }, { corner(7), edge(Theme.Line2) }) local hexBox = UI.new("TextBox", { Parent = panel, Position = UDim2.fromOffset(38, 132), Size = UDim2.new(1, -38, 0, 30), BackgroundColor3 = Theme.Raised2, BorderSizePixel = 0, ClearTextOnFocus = false, Text = "#" .. ThemeStore.hex(start), TextColor3 = Theme.Text, FontFace = F.mono, TextSize = 12, ZIndex = 52 }, { corner(7), edge(Theme.Line) }) local current = start local lastLive, previewed = 0, false local function preview(force) if not force and os.clock() - lastLive < 0.05 then return end lastLive = os.clock() local old = {} for k, c in pairs(Theme) do old[k] = c end UI.base[role] = current UI.derive() UI.recolor(old, Theme, panel) previewed = true end local function update(live) current = Color3.fromHSV(h, s, v) sq.BackgroundColor3 = Color3.fromHSV(h, 1, 1) dot.Position = UDim2.fromScale(s, 1 - v) hueMark.Position = UDim2.fromScale(0.5, h) swatch.BackgroundColor3 = current if not hexBox:IsFocused() then hexBox.Text = "#" .. ThemeStore.hex(current) end if live then preview(live == "force") end anchor.BackgroundColor3 = current end update(false) local mode, lastDrag = nil, 0 UI.setPopupPanel(panel) UI.popupGuard = function(i) return mode ~= nil or os.clock() - lastDrag < 0.25 or UI.overPopup(i) end local function track_(i) if mode == "sq" then s = math.clamp((i.Position.X - sq.AbsolutePosition.X) / math.max(sq.AbsoluteSize.X, 1), 0, 1) v = 1 - math.clamp((i.Position.Y - sq.AbsolutePosition.Y) / math.max(sq.AbsoluteSize.Y, 1), 0, 1) elseif mode == "hue" then h = math.clamp((i.Position.Y - hue.AbsolutePosition.Y) / math.max(hue.AbsoluteSize.Y, 1), 0, 0.999) end lastDrag = os.clock() update(true) end utrack(sq.InputBegan:Connect(function(i) if isPress(i) then mode = "sq" track_(i) end end)) utrack(hue.InputBegan:Connect(function(i) if isPress(i) then mode = "hue" track_(i) end end)) utrack(S.UIS.InputChanged:Connect(function(i) if mode and isMoveInput(i) then track_(i) end end)) utrack(S.UIS.InputEnded:Connect(function(i) if isPress(i) and mode then mode = nil lastDrag = os.clock() update("force") end end)) utrack(hexBox.FocusLost:Connect(function() local c = ThemeStore.color(hexBox.Text) if c then h, s, v = c:ToHSV() end update("force") end)) UI.onPopupClose = function() if ThemeStore.hex(current) ~= ThemeStore.hex(start) then onDone(current) elseif previewed then UI.base[role] = start task.defer(UI.rebuild) end end UI.overlay.Visible = true end -- one line: label left, colour swatch right (opens the picker) function UI.colorRow(box, label, role) local r = UI.row(box, 20) text({ Parent = r, Size = UDim2.new(1, -50, 1, 0), Text = label, TextSize = 12, TextColor3 = Theme.Sub }) local sw = UI.new("TextButton", { Parent = r, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, 0, 0.5, 0), Size = UDim2.fromOffset(36, 16), BackgroundColor3 = UI.base[role], AutoButtonColor = false, BorderSizePixel = 0, Text = "" }, { corner(5), edge(Theme.Line2) }) utrack(sw.Activated:Connect(function() UI.openPicker(sw, role, function(c) UI.base[role] = c UI.themeName = "Custom" ThemeStore.setCurrent(UI.base, UI.themeName) task.defer(UI.rebuild) end) end)) return r end -- apply a whole theme (base colours) and redraw function UI.applyTheme(base, name) UI.base = base UI.themeName = name or "Custom" ThemeStore.setCurrent(UI.base, UI.themeName) task.defer(UI.rebuild) end --------------------------------------------------------------------------- -- the window (built by UI.build; UI.rebuild redraws it after theme changes or config loads) --------------------------------------------------------------------------- function UI.build() UI.gen = UI.gen + 1 local myGen = UI.gen UI.painters, UI.refreshers, UI.vis, UI.tabs, UI.current, UI.listening = {}, {}, {}, {}, nil, nil UI.derive() local gui = UI.new("ScreenGui", { Name = "StingersNow", ResetOnSpawn = false, IgnoreGuiInset = true, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, DisplayOrder = 60, }) if not pcall(function() gui.Parent = (gethui and gethui()) or S.CoreGui end) or not gui.Parent then gui.Parent = LP:WaitForChild("PlayerGui") end UI.gui = gui App.gui = gui local W = 600 local M, GAP = 14, 10 local HEAD_H, TABS_H, FOOT_H = 50, 34, 30 local BODY_Y = HEAD_H + TABS_H + 12 local shell = UI.new("Frame", { Parent = gui, Size = UDim2.fromOffset(W, 420), Position = UDim2.new(0.5, -W / 2, 0.5, -210), BackgroundTransparency = 1, Visible = Config.UIOpen }) local shellScale = UI.new("UIScale", { Parent = shell }) UI.shell, UI.scale = shell, shellScale for _, sd in ipairs({ { 4, 0.9 }, { 10, 0.94 }, { 18, 0.97 } }) do UI.new("Frame", { Parent = shell, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0.5, 6), Size = UDim2.new(1, sd[1] * 2, 1, sd[1] * 2), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = sd[2], BorderSizePixel = 0 }, { corner(12 + sd[1]) }) end local win = UI.new("Frame", { Parent = shell, Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Active = true, ClipsDescendants = true, }, { corner(12), vgrad(Theme.Top, Theme.Bottom), edge(Theme.Line2, 0.25) }) UI.win = win UI.new("Frame", { Parent = win, Position = UDim2.fromOffset(12, 0), Size = UDim2.new(1, -24, 0, 1), BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.93, BorderSizePixel = 0 }) -- header local head = UI.new("Frame", { Parent = win, Size = UDim2.new(1, 0, 0, HEAD_H), BackgroundTransparency = 1, Active = true }) local brand = UI.new("Frame", { Parent = head, Position = UDim2.fromOffset(M, 0), Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1 }, { list(9, true) }) UI.logo(brand, 24, 2).LayoutOrder = 1 text({ Parent = brand, LayoutOrder = 2, Size = UDim2.new(0, 0, 0, 20), AutomaticSize = Enum.AutomaticSize.X, Text = "stingers.now", FontFace = F.bold, TextSize = 14 }) do local vtag = UI.new("Frame", { Parent = brand, LayoutOrder = 3, Size = UDim2.fromOffset(0, 17), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = Theme.Raised, BorderSizePixel = 0 }, { pill(), pad(7, 7, 0, 0), edge(Theme.Line) }) text({ Parent = vtag, Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, Text = VERSION, TextSize = 10, TextColor3 = Theme.Muted }) end local closeBtn = UI.new("TextButton", { Parent = head, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -(M - 4), 0.5, 0), Size = UDim2.fromOffset(28, 28), BackgroundColor3 = Theme.Raised, BackgroundTransparency = 1, AutoButtonColor = false, Text = "", BorderSizePixel = 0, }, { corner(8) }) UI.new("Frame", { Parent = closeBtn, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(10, 2), BackgroundColor3 = Theme.Sub, BorderSizePixel = 0 }, { pill() }) utrack(closeBtn.MouseEnter:Connect(function() anim(closeBtn, 0.15, { BackgroundTransparency = 0 }) end)) utrack(closeBtn.MouseLeave:Connect(function() anim(closeBtn, 0.15, { BackgroundTransparency = 1 }) end)) local status = UI.new("Frame", { Parent = head, AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -(M + 30), 0.5, 0), Size = UDim2.fromOffset(0, 24), AutomaticSize = Enum.AutomaticSize.X, BackgroundColor3 = Theme.Raised, BorderSizePixel = 0 }, { pill(), pad(0, 11, 0, 0), edge(Theme.Line) }) local statusDot = UI.new("Frame", { Parent = status, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 10, 0.5, 0), Size = UDim2.fromOffset(6, 6), BackgroundColor3 = Theme.Muted, BorderSizePixel = 0 }, { pill() }) local statusWords = UI.new("Frame", { Parent = status, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 23, 0.5, 0), Size = UDim2.fromOffset(0, 14), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1 }, { list(6, true) }) local statusText = text({ Parent = statusWords, LayoutOrder = 1, Size = UDim2.fromOffset(0, 14), AutomaticSize = Enum.AutomaticSize.X, Text = "Idle", TextColor3 = Theme.Sub, TextSize = 11, TextYAlignment = Enum.TextYAlignment.Center }) local statusRole = text({ Parent = statusWords, LayoutOrder = 2, Size = UDim2.fromOffset(0, 14), AutomaticSize = Enum.AutomaticSize.X, Text = Config.Role, TextColor3 = Theme.Muted, TextSize = 11, TextYAlignment = Enum.TextYAlignment.Center }) -- tab control + Start local tabTrack = UI.new("Frame", { Parent = win, Position = UDim2.fromOffset(M, HEAD_H), Size = UDim2.new(1, -(M * 2 + 104), 0, TABS_H), BackgroundColor3 = Theme.Raised, BorderSizePixel = 0 }, { corner(10), edge(Theme.Line) }) local tabPill = UI.new("Frame", { Parent = tabTrack, Position = UDim2.fromOffset(3, 3), Size = UDim2.fromOffset(60, TABS_H - 6), BackgroundColor3 = Theme.Raised2, BorderSizePixel = 0 }, { corner(8), edge(Theme.Line2, 0.3) }) local tabHolder = UI.new("Frame", { Parent = tabTrack, Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, ZIndex = 2 }, { list(0, true), pad(3, 3, 0, 0) }) local startBtn = UI.new("TextButton", { Parent = win, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -M, 0, HEAD_H), Size = UDim2.fromOffset(96, TABS_H), BackgroundColor3 = Color3.new(1, 1, 1), AutoButtonColor = false, BorderSizePixel = 0, Text = "", }, { corner(10) }) local startGrad = accentGrad() startGrad.Parent = startBtn local startEdge = edge(Theme.Accent, 1) startEdge.Parent = startBtn local startText = text({ Parent = startBtn, Size = UDim2.fromScale(1, 1), Text = "Start", FontFace = F.bold, TextSize = 13, TextColor3 = Theme.OnAccent, TextXAlignment = Enum.TextXAlignment.Center }) utrack(startBtn.Activated:Connect(function() App.setRunning(not Config.Running) end)) utrack(startBtn.MouseEnter:Connect(function() anim(startText, 0.12, { TextTransparency = 0.15 }) end)) utrack(startBtn.MouseLeave:Connect(function() anim(startText, 0.12, { TextTransparency = 0 }) end)) -- body, footer, popup layer local body = UI.new("Frame", { Parent = win, Position = UDim2.fromOffset(M, BODY_Y), Size = UDim2.new(1, -M * 2, 1, -(BODY_Y + FOOT_H)), BackgroundTransparency = 1 }) local foot = UI.new("Frame", { Parent = win, AnchorPoint = Vector2.new(0, 1), Position = UDim2.new(0, 0, 1, 0), Size = UDim2.new(1, 0, 0, FOOT_H), BackgroundColor3 = Theme.Foot, BorderSizePixel = 0 }, { corner(12) }) UI.new("Frame", { Parent = foot, Size = UDim2.new(1, 0, 0, 12), BackgroundColor3 = Theme.Foot, BorderSizePixel = 0 }) UI.new("Frame", { Parent = foot, Size = UDim2.new(1, 0, 0, 1), BackgroundColor3 = Theme.Line, BorderSizePixel = 0, ZIndex = 2 }) local footDot = UI.new("Frame", { Parent = foot, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, M + 2, 0.5, 0), Size = UDim2.fromOffset(5, 5), BackgroundColor3 = Theme.Muted, BorderSizePixel = 0, ZIndex = 2 }, { pill() }) local footLeft = text({ Parent = foot, Position = UDim2.fromOffset(M + 14, 0), Size = UDim2.new(1, -(M * 2 + 220), 1, 0), Text = "", TextColor3 = Theme.Sub, TextSize = 11, TextTruncate = Enum.TextTruncate.AtEnd, ZIndex = 2 }) local footRight = text({ Parent = foot, AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -(M + 2), 0, 0), Size = UDim2.fromOffset(210, FOOT_H), Text = "", TextColor3 = Theme.Muted, TextSize = 11, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 2 }) local overlay = UI.new("TextButton", { Parent = win, Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Text = "", AutoButtonColor = false, Visible = false, ZIndex = 50 }) UI.overlay = overlay utrack(S.UIS.InputBegan:Connect(function(i) if not overlay.Visible or not isPress(i) then return end if UI.popupGuard and UI.popupGuard(i) then return end UI.closePopup() end)) -- tabs, columns, auto height local function column(parent, right) return UI.new("ScrollingFrame", { Parent = parent, Position = UDim2.new(right and 0.5 or 0, right and GAP / 2 or 0, 0, 0), Size = UDim2.new(0.5, -GAP / 2, 1, 0), BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 2, ScrollBarImageColor3 = Theme.Line2, CanvasSize = UDim2.new(), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollingDirection = Enum.ScrollingDirection.Y, }, { list(GAP) }) end local function placePill(instant) local t = UI.current if not t or not t.btn.Parent then return end local sc = math.max(shellScale.Scale, 0.01) local x = (t.btn.AbsolutePosition.X - tabTrack.AbsolutePosition.X) / sc local w = t.btn.AbsoluteSize.X / sc if w < 4 then return end local pos, size = UDim2.fromOffset(x, 3), UDim2.fromOffset(w, TABS_H - 6) if instant then tabPill.Position, tabPill.Size = pos, size else anim(tabPill, 0.28, { Position = pos, Size = size }) end end local function fitHeight(instant) local t = UI.current if not t then return end local sc = math.max(shellScale.Scale, 0.01) local function contentH(col) local l = col:FindFirstChildOfClass("UIListLayout") return l and l.AbsoluteContentSize.Y / sc or 0 end local need = BODY_Y + math.max(contentH(t.left), contentH(t.right)) + M + FOOT_H local cam = workspace.CurrentCamera local maxH = cam and (cam.ViewportSize.Y / sc - 40) or 640 local h = math.floor(math.clamp(need, 200, math.max(maxH, 200))) if instant then shell.Size = UDim2.fromOffset(W, h) else anim(shell, 0.26, { Size = UDim2.fromOffset(W, h) }) end end local function selectTab(name, instant) for _, t in ipairs(UI.tabs) do local on = t.name == name t.page.Visible = on if instant then t.lbl.TextColor3 = on and Theme.Text or Theme.Muted else anim(t.lbl, 0.2, { TextColor3 = on and Theme.Text or Theme.Muted }) end if on then UI.current = t end end if Config.Tab ~= name then Config.Tab = name App.save() end UI.closePopup() placePill(instant) fitHeight(instant) end local function tab(name) local btn = UI.new("TextButton", { Parent = tabHolder, LayoutOrder = #UI.tabs + 1, Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1, Text = "", AutoButtonColor = false, ZIndex = 2, }, { pad(8, 8, 0, 0) }) local lbl = text({ Parent = btn, Size = UDim2.new(0, 0, 1, 0), AutomaticSize = Enum.AutomaticSize.X, Text = name, TextColor3 = Theme.Muted, TextSize = 12, ZIndex = 3 }) local page = UI.new("Frame", { Parent = body, Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Visible = false }) local t = { name = name, btn = btn, lbl = lbl, page = page } t.left, t.right = column(page, false), column(page, true) for _, col in ipairs({ t.left, t.right }) do utrack(col:FindFirstChildOfClass("UIListLayout"):GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() if UI.current == t then fitHeight(false) end end)) end table.insert(UI.tabs, t) utrack(btn.Activated:Connect(function() selectTab(name) end)) utrack(btn.MouseEnter:Connect(function() if UI.current ~= t then anim(lbl, 0.12, { TextColor3 = Theme.Sub }) end end)) utrack(btn.MouseLeave:Connect(function() if UI.current ~= t then anim(lbl, 0.12, { TextColor3 = Theme.Muted }) end end)) return t end local function box(col, title, visibleIf) local frame = UI.new("Frame", { Parent = col, LayoutOrder = #col:GetChildren(), Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, }, { corner(10), vgrad(Theme.PanelTop, Theme.PanelBot), edge(Theme.Line), list(0) }) local top = UI.new("Frame", { Parent = frame, LayoutOrder = 0, Size = UDim2.new(1, 0, 0, 34), BackgroundTransparency = 1 }) UI.new("Frame", { Parent = top, AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 13, 0.5, 0), Size = UDim2.fromOffset(5, 5), BackgroundColor3 = Theme.Accent, BorderSizePixel = 0 }, { corner(2) }) text({ Parent = top, Position = UDim2.fromOffset(25, 0), Size = UDim2.new(1, -38, 1, 0), Text = title:upper(), FontFace = F.bold, TextSize = 10, TextColor3 = Theme.Sub }) UI.new("Frame", { Parent = top, AnchorPoint = Vector2.new(0, 1), Position = UDim2.new(0, 13, 1, 0), Size = UDim2.new(1, -26, 0, 1), BackgroundColor3 = Theme.Line, BorderSizePixel = 0 }) local inner = UI.new("Frame", { Parent = frame, LayoutOrder = 1, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, }, { list(10), pad(13, 13, 11, 13) }) if visibleIf then table.insert(UI.vis, { row = frame, fn = visibleIf }) end return { frame = frame, body = inner, rows = 0 } end local tHunt, tTargets, tPlanters, tHop, tAlts = tab("Hunt"), tab("Targets"), tab("Planters"), tab("Hopping"), tab("Alts") local tAlerts, tTheme, tSettings = tab("Alerts"), tab("Theme"), tab("Settings") local function isAlt() return Config.Role == "Alt" end local function isMain() return Config.Role == "Main" end -- Hunt ---------------------------------------------------------------------------------------------- do local b = box(tHunt.left, "Status") UI.live(b, 34, function() return Log.text, Theme.Text end, { size = 14 }) UI.clock(b) UI.pair(b, "Server", function() if App.private then return "Private", Theme.Gold end return ("%d of %d players"):format(#S.Players:GetPlayers(), S.Players.MaxPlayers) end) UI.pair(b, "Hive", function() local h = Hive.mine() local bees = Game.bees() return (h and h.Name or "None") .. (bees and (" · " .. bees .. " bees") or "") end) local a = box(tHunt.left, "Log") UI.live(a, 70, function() local out = {} for i = math.max(1, #Log.lines - 4), #Log.lines do table.insert(out, (Log.lines[i]:gsub("^(%d+:%d+):%d+%s+", "%1 "))) end return #out > 0 and table.concat(out, "\n") or "Nothing yet", Theme.Muted end, { font = F.mono, size = 11, lineHeight = 1.1 }) UI.buttons(a, { { "Copy log", function() if type(setclipboard) ~= "function" then return "Can't copy" end setclipboard(table.concat(Log.lines, "\n")) return "Copied" end }, }) local t = box(tHunt.right, "Target") UI.slider(t, "Lowest level", "MinLevel", 1, 12, 1, plain, function(v) if Config.MaxLevel < v then Config.MaxLevel = v end for _, p in ipairs(UI.painters) do pcall(p) end end) UI.slider(t, "Highest level", "MaxLevel", 1, 12, 1, plain, function(v) if Config.MinLevel > v then Config.MinLevel = v end for _, p in ipairs(UI.painters) do pcall(p) end end) UI.switch(t, "Gifted only", "GiftedOnly") UI.switch(t, "Join fights already going", "HelpFights") UI.switch(t, "Grab battle tokens", "GrabBattle") local n = box(tHunt.right, "Night") UI.slider(n, "Watch for a spike", "SpikeWait", 2, 20, 1, secs) local s = box(tHunt.right, "Session") UI.numbers(s, { { "Servers", function() return fmtNum(Stats.data.servers) end }, { "Found", function() return fmtNum(Stats.data.found) end }, { "Killed", function() return fmtNum(Stats.data.killed) end }, { "Gifted", function() return fmtNum(Stats.data.gifted), Stats.data.gifted > 0 and Theme.Gold or nil end }, { "Stingers", function() return fmtNum(Stats.data.stingers) end }, { "Time", function() return fmtTime(Stats.data.seconds) end }, }) end -- Targets ------------------------------------------------------------------------------------------- do local v = box(tTargets.left, "Rogue Vicious Bee") UI.switch(v, "Hunt Vicious Bees", "Vicious") local w = box(tTargets.left, "Wild Windy Bee") UI.switch(w, "Hunt Windy Bees", "Windy") UI.slider(w, "Skip if it flees within", "WindyMinTime", 0, 270, 10, secs, nil, function() return Config.Windy end) local mo = box(tTargets.left, "Mondo Chick") UI.switch(mo, "Auto Mondo", "Mondo") UI.pair(mo, "Next one in", function() local s = Jobs.mondoIn() return ("%d:%02d"):format(math.floor(s / 60), s % 60) end, function() return Config.Mondo end) local sp = box(tTargets.right, "Sprouts") UI.switch(sp, "Farm sprouts", "Sprouts") local rarities = {} for i = 2, #Jobs.RARITIES do table.insert(rarities, Jobs.RARITIES[i]) end UI.multi(sp, "Rarities", rarities, function(r) return Config.SproutWant[r] ~= false end, function(r) Config.SproutWant[r] = Config.SproutWant[r] == false App.save() end, function() return Config.Sprouts end) local bo = box(tTargets.right, "Bosses") for _, b in ipairs(Jobs.BOSSES) do UI.switch(bo, b.label, b.key) UI.pair(bo, "Back in", function() local t, kind = Jobs.bossStatus(b) return t, (kind == "good" and Theme.Good) or (kind == "muted" and Theme.Muted) or Theme.Text end, function() return Config[b.key] end) end end -- Planters ------------------------------------------------------------------------------------------ do local function plOn() return Config.Planters end local function smart() return Config.Planters and Config.PlanterMode == "Smart" end local function manual() return Config.Planters and Config.PlanterMode == "Manual" end local repaint = function() for _, p in ipairs(UI.painters) do pcall(p) end end local b = box(tPlanters.left, "Planters") UI.switch(b, "Auto planters", "Planters") UI.dropdown(b, "Mode", "PlanterMode", { "Smart", "Manual" }, nil, plOn, true) UI.dropdown(b, "Preset", { get = function() return Config.PlanterPreset end, set = function(v) if v == "Custom" and Config.PlanterPreset ~= "Custom" then Config.NectarOrder = Jobs.nectarOrder() end Config.PlanterPreset = v App.save() end }, Jobs.PRESET_NAMES, repaint, smart, true) -- nectar priorities: picking one here switches to Custom and swaps it into place for i, label in ipairs({ "1st", "2nd", "3rd", "4th", "5th" }) do UI.dropdown(b, label, { get = function() return Jobs.nectarOrder()[i] end, set = function(v) if Config.PlanterPreset ~= "Custom" then Config.NectarOrder = Jobs.nectarOrder() Config.PlanterPreset = "Custom" end local order = Config.NectarOrder for j = 1, #order do if order[j] == v then order[j] = order[i] end end order[i] = v App.save() end }, Jobs.NECTARS, repaint, smart, true) end UI.multi(b, "Planters to use", Jobs.PLANTER_RANK, function(n) return Config.PlanterUse[n] ~= false end, function(n) Config.PlanterUse[n] = Config.PlanterUse[n] == false App.save() end, smart) for s = 1, 3 do UI.dropdown(b, "Planter " .. s, "Planter" .. s, Jobs.PLANTER_NAMES, nil, manual, true) UI.dropdown(b, "Field " .. s, "PlanterField" .. s, Jobs.FIELD_NAMES, nil, manual, true) end local h = box(tPlanters.right, "Harvest") UI.dropdown(h, "Harvest", "PlanterHarvestMode", { "For nectar", "Full growth" }, nil, plOn, true) UI.slider(h, "After", "PlanterHours", 0.5, 12, 0.5, function(v) return ("%.1f h"):format(v) end, nil, function() return Config.Planters and Config.PlanterHarvestMode == "For nectar" end) UI.slider(h, "Skip nectar above", "NectarCap", 50, 100, 5, function(v) return plain(v) .. "%" end, nil, smart) local n = box(tPlanters.right, "Nectar") for _, name in ipairs(Jobs.NECTARS) do UI.pair(n, name, function() local pct = Jobs.nectarPct(name) if not pct then return "?" end local w = Jobs.nectarWeights()[name] or 0 return ("%d%%"):format(math.floor(pct + 0.5)), (w >= 3 and Theme.Accent) or (pct >= Config.NectarCap and Theme.Good) or Theme.Text end) end local sl = box(tPlanters.right, "Slots") for s = 1, 3 do UI.pair(sl, "Slot " .. s, function() return Jobs.planterStatus(s) or "empty", Jobs.planterStatus(s) and Theme.Text or Theme.Muted end) end local inv = box(tPlanters.left, "Inventory") UI.live(inv, 32, function() local owned = Jobs.ownedPlanters() if not owned then return "Reading your inventory…", Theme.Muted end if #owned == 0 then return "No planters in your inventory", Theme.Muted end return table.concat(owned, " · "), Theme.Text end) end -- Hopping ------------------------------------------------------------------------------------------- do local b = box(tHop.left, "Servers") UI.slider(b, "Most players", "MaxPlayers", 1, 5, 1, plain) UI.slider(b, "Skip visited for", "RevisitMinutes", 5, 60, 5, mins) UI.switch(b, "Night forecast", "Forecast") local g = box(tHop.left, "Stop") UI.input(g, "Stinger goal", { get = function() return Config.StingerGoal > 0 and tostring(Config.StingerGoal) or "" end, set = function(v) Config.StingerGoal = math.max(0, math.floor(tonumber(v) or 0)) App.save() end }, "0 = off", nil, nil, true) local mv = box(tHop.left, "Movement") local function tweening() return Config.MoveMethod == "Tween" end UI.dropdown(mv, "Method", "MoveMethod", { "Tween", "Walk" }, nil, nil, true) UI.slider(mv, "Tween speed", "TweenSpeed", 1, Config.TweenUnlock and 40 or 12, 1, function(v) return plain(v) .. "x" end, nil, tweening, nil, function(v) if v <= 8 then return Theme.Good end if v <= 12 then return Color3.fromRGB(240, 160, 60) end return Theme.Bad end) UI.buttons(mv, { { Config.TweenUnlock and "Lock back to 12x" or "Unlock up to 40x", function() Config.TweenUnlock = not Config.TweenUnlock App.clampConfig() App.saveNow() task.defer(UI.rebuild) return Config.TweenUnlock and "Unlocked" or "Locked" end } }, tweening) UI.slider(mv, "Walkspeed", { get = function() return Config.WalkSpeed > 0 and Config.WalkSpeed or 14 end, set = function(v) Config.WalkSpeed = (v <= 14) and 0 or v App.save() end }, 14, 90, 2, function(v) return v <= 14 and "Off" or plain(v) end) local s = box(tHop.right, "Server list") local cache = { at = 0 } local function info() if os.clock() - cache.at > 3 then cache.at = os.clock() local sv = X.load("servers.json") cache.servers = sv and type(sv.list) == "table" and #sv.list or 0 cache.age = sv and type(sv.at) == "number" and (os.time() - sv.at) or nil local n = 0 for _ in pairs(Hop.visited()) do n = n + 1 end cache.visited = n local cl = X.load("clock.json") local k = 0 if cl and type(cl.servers) == "table" then for _ in pairs(cl.servers) do k = k + 1 end end cache.known = k end return cache end UI.pair(s, "Cached", function() local c = info() return c.age and ("%d · %ds old"):format(c.servers, c.age) or "None" end) UI.pair(s, "Visited", function() return tostring(info().visited) end) UI.pair(s, "Clocks known", function() return tostring(info().known) end) UI.pair(s, "Last hop", function() return Hop.reason ~= "" and Hop.reason or "—" end) UI.buttons(s, { { "Hop now", function() if Hop.busy then return "Busy" end if not Config.Running then App.setRunning(true) end task.spawn(Hop.go, "asked to") return "Hopping" end }, { "Refresh", function() local l, why = Hop.fetch(true) if not l then return why == "rate" and "Rate limited" or "Failed" end cache.at = 0 return #l .. " servers" end }, }) end -- Alts --------------------------------------------------------------------------------------------- do local b = box(tAlts.left, "This account") UI.dropdown(b, "Role", "Role", { "Solo", "Main", "Alt" }, function() if Config.Running then App.setRunning(false) end end, nil, true) UI.dropdown(b, "Main account", "MainName", function() local names = {} for _, m in ipairs(Sync.mains()) do table.insert(names, m.name) end if Config.MainName ~= "" and not table.find(names, Config.MainName) then table.insert(names, Config.MainName) end return names end, nil, isAlt, true) UI.slider(b, "Take it myself after", "AltHold", 30, 270, 10, secs, nil, isAlt) local l = box(tAlts.right, "Linked") local altCache, altAt = nil, 0 UI.live(l, 64, function() if Config.Role == "Solo" then return "None", Theme.Muted end if isAlt() then if cleanName(Config.MainName) == "" then return "Pick a main (start stingers.now on it as Main)", Theme.Muted end local m = Alt.main() if not m then return Config.MainName .. " isn't running stingers.now", Theme.Muted end local here = m.job == game.JobId return ("%s\n%s · %s"):format(tostring(m.name), tostring(m.state), here and "in this server" or (m.private and "private server" or "another server")), Theme.Text end if os.clock() - altAt > 2 then altAt = os.clock() altCache = Sync.alts() end if not altCache then return "Can't list files here", Theme.Muted end if #altCache == 0 then return "No scouts yet", Theme.Muted end local lines = {} for _, a in ipairs(altCache) do local state = tostring(a.state) if a.running == false or os.time() - (tonumber(a.t) or 0) > 30 then state = "stopped" elseif a.state == "found" and type(a.report) == "table" then if a.report.kind == "sprout" then state = ("found %s sprout · %s"):format(tostring(a.report.rarity), tostring(a.report.field or "?")) else state = ("found %s· %s"):format(a.report.gifted and "gifted Vicious " or "Vicious ", tostring(a.report.field or "?")) end end if a.job == game.JobId then state = state .. " · here" end table.insert(lines, ("%s · %s"):format(tostring(a.name), state)) end return table.concat(lines, "\n"), Theme.Text end) end -- Alerts ------------------------------------------------------------------------------------------- do local b = box(tAlerts.left, "Discord") UI.input(b, "Webhook", "Webhook", "https://discord.com/api/...", nil, nil, true) UI.input(b, "Ping ID", "PingId", "Your Discord ID", nil, nil, true) UI.switch(b, "Ping on gifted", "PingGifted") UI.switch(b, "Post every kill", "HookKills") UI.buttons(b, { { "Send test", function() if Config.Webhook == "" then return "Add a webhook" end if not X.request then return "No web requests" end Hook.send("stingers.now is connected", ("%s · %s"):format(LP.Name, Config.Role), 0xF0B23E, Config.PingId ~= "", Hook.card("start")) return "Sent" end } }) local s = box(tAlerts.right, "Rates") local function perHour(n) local h = Stats.data.seconds / 3600 if h < 0.02 then return "—" end return ("%.1f / hr"):format(n / h) end UI.pair(s, "Kills", function() return perHour(Stats.data.killed) end) UI.pair(s, "Stingers", function() return perHour(Stats.data.stingers) end) UI.pair(s, "Servers", function() return perHour(Stats.data.servers) end) UI.pair(s, "Find rate", function() if Stats.data.found == 0 then return "—" end return ("1 in %.1f"):format(Stats.data.servers / Stats.data.found) end) UI.buttons(s, { { "Copy", function() if type(setclipboard) ~= "function" then return "Can't copy" end setclipboard(("stingers.now · %s · %d servers · %d found · %d killed · %d gifted · %d stingers"):format( fmtTime(Stats.data.seconds), Stats.data.servers, Stats.data.found, Stats.data.killed, Stats.data.gifted, Stats.data.stingers)) return "Copied" end }, { "Reset", function() Stats.reset() return "Reset" end }, }) end -- Theme -------------------------------------------------------------------------------------------- do local b = box(tTheme.left, "Themes") UI.colorRow(b, "Background color", "bg") UI.colorRow(b, "Main color", "main") UI.colorRow(b, "Accent color", "accent") UI.colorRow(b, "Outline color", "outline") UI.colorRow(b, "Font color", "font") local presetNames = {} for _, p in ipairs(THEME_PRESETS) do table.insert(presetNames, p.name) end UI.dropdown(b, "Theme list", { get = function() return UI.themeName end, set = function(v) local base = ThemeStore.preset(v) if base then UI.applyTheme(base, v) end end }, presetNames) UI.buttons(b, { { "Set as default", function() ThemeStore.setDefault(UI.base, UI.themeName) return "Saved" end }, { "Reset to default", function() local base, name = ThemeStore.default() UI.applyTheme(base, name) return "Reset" end }, }) local c = box(tTheme.right, "Custom themes") UI.input(c, "Custom theme name", { get = function() return UI.state.themeName end, set = function(v) UI.state.themeName = v end }, "Name") UI.dropdown(c, "Custom themes", { get = function() return UI.state.themeSel end, set = function(v) UI.state.themeSel = v end }, ThemeStore.customs) UI.buttons(c, { { "Save theme", function() local name = cleanFileName(UI.state.themeName) if name == "" then return "Name it first" end ThemeStore.saveCustom(name, UI.base) UI.state.themeSel = name for _, p in ipairs(UI.painters) do pcall(p) end return "Saved" end }, { "Load theme", function() if UI.state.themeSel == "" then return "Pick one" end local base = ThemeStore.loadCustom(UI.state.themeSel) if not base then return "Not found" end UI.applyTheme(base, UI.state.themeSel) return "Loaded" end }, }) UI.buttons(c, { { "Refresh list", function() local n = #ThemeStore.customs() return n .. " saved" end } }) end -- Settings ----------------------------------------------------------------------------------------- do local cf = box(tSettings.left, "Configuration") local st = UI.state UI.input(cf, "Config name", { get = function() return st.cfgName end, set = function(v) st.cfgName = v end }, "Name") UI.dropdown(cf, "Config list", { get = function() return st.cfgSel end, set = function(v) st.cfgSel = v end }, Cfg.names) UI.buttons(cf, { { "Create config", function() local name = cleanFileName(st.cfgName) if name == "" then return "Name it first" end Cfg.save(name) st.cfgSel = name for _, p in ipairs(UI.painters) do pcall(p) end return "Created" end }, { "Load config", function() if st.cfgSel == "" then return "Pick one" end if not Cfg.load(st.cfgSel) then return "Not found" end task.defer(UI.rebuild) return "Loaded" end }, }) UI.buttons(cf, { { "Overwrite config", function() if st.cfgSel == "" then return "Pick one" end Cfg.save(st.cfgSel) return "Overwritten" end } }) UI.buttons(cf, { { "Refresh list", function() return #Cfg.names() .. " configs" end } }) UI.buttons(cf, { { "Set as autoload", function() if st.cfgSel == "" then Cfg.setAutoload(nil) return "Autoload off" end Cfg.setAutoload(st.cfgSel) return "Autoload set" end } }) UI.live(cf, 30, function() local a = Cfg.autoload() return ("Current config: %s\nCurrent autoload config: %s"):format(Config.CurrentConfig ~= "" and Config.CurrentConfig or "none", a or "none"), Theme.Muted end, { size = 11 }) UI.input(cf, "Import (paste config JSON here)", { get = function() return st.import end, set = function(v) st.import = v end }, "{ ... }") UI.buttons(cf, { { "Import", function() local t = X.decode(st.import) if not t then return "Not valid JSON" end local wasRunning = Config.Running local n = Cfg.apply(t) Config.Running = wasRunning if n == 0 then return "No settings in it" end st.import = "" local name = cleanFileName(st.cfgName) if name ~= "" then Cfg.save(name) end task.defer(UI.rebuild) return "Imported " .. n end }, { "Export", function() if type(setclipboard) ~= "function" then return "Can't copy" end setclipboard(X.encode(Cfg.snapshot()) or "{}") return "Copied" end }, }) local mn = box(tSettings.right, "Menu") UI.keybind(mn, "Toggle key", "MenuKey") UI.slider(mn, "Size", "UIScalePct", 70, 130, 5, function(v) return plain(v) .. "%" end, nil, nil, function() UI.fit() end) local p = box(tSettings.right, "Performance") UI.switch(p, "Turn off 3D rendering", "No3D", function() App.applyPerf() end) UI.slider(p, "FPS cap", "FpsCap", 0, 60, 5, function(v) return v == 0 and "Off" or plain(v) end, function() App.applyPerf() end, function() return type(setfpscap) == "function" end) UI.switch(p, "Anti-AFK", "AntiAfk") local s = box(tSettings.right, "Setup") UI.pair(s, "Runs again from", function() local _, src = Hop.loader() return src == "backend" and "Backend" or "Workspace file" end) UI.live(s, 30, function() local line, src = Hop.loader() local fileOk = true if src == "file" and line:find("readfile(\"StingersNow.lua\")", 1, true) and X.files then local ok, found = pcall(isfile, "StingersNow.lua") fileOk = ok and found end if src == "backend" then return "Restarts after each hop from stingers.now (or autoexec)", Theme.Good end if X.queue and line ~= "" and fileOk then return "Restarts after each hop (autoexec or the re-run line)", Theme.Good end return "Restarts after each hop only if it's in your autoexec folder", Theme.Sub end) UI.input(s, "Re-run line", "Loader", 'loadstring(game:HttpGet("https://stingers.now"))()', nil, function() return Hop.loader() == Config.Loader end) UI.buttons(s, { { "Discord", function() local copied = type(setclipboard) == "function" and pcall(setclipboard, "https://discord.gg/" .. App.DISCORD) task.spawn(pcall, App.discord, true) return copied and "Link copied" or ("discord.gg/" .. App.DISCORD) end }, { "Unload", function() task.defer(function() if genv.__NNH_UNLOAD then genv.__NNH_UNLOAD() end end) return "Bye" end }, }) end -- minimised button (also how you open it on mobile) local bubble = UI.new("TextButton", { Parent = gui, Position = UI.bubblePos or UDim2.new(0, 14, 0.5, 34), Size = UDim2.fromOffset(44, 44), BackgroundColor3 = Color3.new(1, 1, 1), AutoButtonColor = false, Text = "", BorderSizePixel = 0, }, { corner(12), vgrad(Theme.Top, Theme.Bottom) }) local bubbleEdge = edge(Theme.Line2) bubbleEdge.Parent = bubble do local lg = UI.logo(bubble, 26, 2) lg.AnchorPoint = Vector2.new(0.5, 0.5) lg.Position = UDim2.fromScale(0.5, 0.5) end local function drag(handle, target, onTap, onEnd) local dragging, moved, startIn, startPos = false, false, nil, nil utrack(handle.InputBegan:Connect(function(i) if isPress(i) then dragging, moved, startIn, startPos = true, false, i.Position, target.Position end end)) utrack(S.UIS.InputChanged:Connect(function(i) if not dragging or not isMoveInput(i) then return end local d = i.Position - startIn if d.Magnitude > 5 then moved = true end if moved then target.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end)) utrack(S.UIS.InputEnded:Connect(function(i) if not dragging or not isPress(i) then return end dragging = false if not moved and onTap then onTap() end if moved and onEnd then onEnd() end end)) end function UI.setOpen(open) shell.Visible = open Config.UIOpen = open App.save() if open then task.defer(function() placePill(true) fitHeight(true) end) end end drag(head, shell, nil, function() local p = shell.Position Config.UIPos = { p.X.Scale, p.X.Offset, p.Y.Scale, p.Y.Offset } App.save() end) drag(bubble, bubble, function() UI.setOpen(not shell.Visible) end, function() UI.bubblePos = bubble.Position end) utrack(closeBtn.Activated:Connect(function() UI.setOpen(false) end)) utrack(S.UIS.InputBegan:Connect(function(i, processed) if i.UserInputType ~= Enum.UserInputType.Keyboard then return end if UI.listening then local fn = UI.listening UI.listening = nil fn(i.KeyCode) return end if not processed and i.KeyCode.Name == Config.MenuKey then UI.setOpen(not shell.Visible) end end)) function UI.fit() local cam = workspace.CurrentCamera if not cam or not shell.Parent then return end local vp = cam.ViewportSize if vp.X < 10 or vp.Y < 10 then return end local want = math.clamp(Config.UIScalePct / 100, 0.5, 1.5) local sc = math.max(math.min(want, (vp.X - 24) / W), 0.4) shellScale.Scale = sc local saved, placed = Config.UIPos, false if type(saved) == "table" and tonumber(saved[1]) and tonumber(saved[2]) and tonumber(saved[3]) and tonumber(saved[4]) then local ax = saved[1] * vp.X + saved[2] local ay = saved[3] * vp.Y + saved[4] if ax > 60 - W * sc and ax < vp.X - 60 and ay > -10 and ay < vp.Y - 40 then shell.Position = UDim2.new(saved[1], saved[2], saved[3], saved[4]) placed = true end end if not placed then shell.Position = UDim2.new(0.5, -W * sc / 2, 0.5, -210 * sc) end task.defer(function() placePill(true) fitHeight(true) end) end UI.fit() if workspace.CurrentCamera then utrack(workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(UI.fit)) end UI.refreshVisibility() do local first = UI.tabs[1].name for _, t in ipairs(UI.tabs) do if t.name == Config.Tab then first = t.name end end selectTab(first, true) task.delay(0.15, function() if UI.gen ~= myGen then return end placePill(true) fitHeight(true) end) end -- live refresh (stops when the window is rebuilt or unloaded) task.spawn(function() local blink = false local wasOn = nil while App.alive and UI.gen == myGen do local on = Config.Running local label, color if not on then label, color = "Idle", Theme.Muted elseif Hop.busy then label, color = "Hopping", Theme.Accent elseif Fight.active then label, color = "Fighting", Theme.Bad elseif Config.Role == "Alt" then label, color = Alt.hold and ((Alt.hold.kind == "sprout") and "Holding sprout" or "Holding Vicious") or "Scouting", Theme.Good else label, color = (Hunt.state == "found") and "Found one" or "Searching", Theme.Good end statusText.Text = label statusRole.Text = Config.Role statusDot.BackgroundColor3 = color footDot.BackgroundColor3 = color blink = not blink if on then anim(statusDot, 0.45, { BackgroundTransparency = blink and 0.65 or 0 }) else statusDot.BackgroundTransparency = 0 end if on ~= wasOn then wasOn = on startText.Text = on and "Stop" or "Start" startText.TextColor3 = on and Theme.Text or Theme.OnAccent startGrad.Enabled = not on startBtn.BackgroundColor3 = on and Theme.Raised2 or Color3.new(1, 1, 1) anim(startEdge, 0.2, { Transparency = on and 0.35 or 1 }) bubbleEdge.Color = on and Theme.Accent or Theme.Line2 end footLeft.Text = Log.text footRight.Text = ("%s · %d/%d · %s"):format(App.private and "Private" or "Public", #S.Players:GetPlayers(), S.Players.MaxPlayers, fmtTime(Stats.data.seconds)) for _, f in ipairs(UI.refreshers) do pcall(f) end UI.refreshVisibility() task.wait(0.5) end end) end -- redraw everything (theme change, config load); keeps the open tab and window position function UI.rebuild() if not App.alive then return end UI.onPopupClose = nil for _, c in ipairs(UI.conns) do pcall(function() c:Disconnect() end) end UI.conns = {} if UI.gui then pcall(function() UI.gui:Destroy() end) end UI.build() end UI.build() --------------------------------------------------------------------------- -- unload --------------------------------------------------------------------------- genv.__NNH_UNLOAD = function() if not App.alive then return end App.alive = false if Config.Running then Config.Running = false if Config.Role == "Main" then pcall(Sync.publishMain, "stopped") end end App.saveNow() Stats.save() for _, c in ipairs(App.conns) do pcall(function() c:Disconnect() end) end for _, c in ipairs(UI.conns) do pcall(function() c:Disconnect() end) end pcall(Fight.watch, false) pcall(Move.noclip, false) pcall(function() S.Run:Set3dRenderingEnabled(true) end) pcall(function() UI.gui:Destroy() end) genv.__NNH_UNLOAD = nil genv.__NNH_LOADING = nil print("[stingers.now] unloaded") end Log.add(("Loaded v%s as %s%s"):format(VERSION, Config.Role, Config.Running and " (running)" or ""))