explore
key systems
new
docs
discord
search scripts
⌘K
explore
key systems
new
docs
discord
sign in
⌘↵
--
publishes from anywhere on this page
new paste
untitled.luau
empty
/ 512kb
open file
⌘O
explore
key systems
new
docs
sign in
auto-farm-copy.lua
880 lines · 31.6kb
/ 512kb
open file
⌘O
-- AutoFarm.lua (canonical build — always tweak this file) -- v0.1.10 | Features: AUTO-SCRATCH · GHOST SELL · GHOST UPGRADE -- made by shark_Attack -- Pipeline: RequestTicket(Invoke) -> CompleteTicket(Invoke) -> ClaimRevealedReward(Invoke) -- Executor: Volt | Remote spy: Cobalt local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local UserInput = game:GetService("UserInputService") local Replicated = game:GetService("ReplicatedStorage") local HttpService = game:GetService("HttpService") local CoreGui = game:GetService("CoreGui") local LP = Players.LocalPlayer --------------------------------------------------------------------- -- CONFIG --------------------------------------------------------------------- local Config = { Enabled = false, Ticket = "auto", -- "auto" = rotate every learned ticket Mode = "Manual", -- arg 3 of CompleteTicket PrizeOverride = "", -- "" = use MatchItemId from the server Delay = 0.45, -- seconds between cycles Jitter = 0.15, InvokeTimeout = 3.0, -- RemoteFunction wait cap SkipIfNoPrize = true, -- do not blind-send a prize we don't know UpgradeTarget = "", -- "" off | "Luck" | "Value" | "Both" UpgradeDelay = 2.0, -- seconds between auto-upgrade attempts ToggleKey = Enum.KeyCode.F, StatsRefresh = 0.35, } getgenv().V_Scratch = Config local Stats = { cycles = 0, rewards = 0, fails = 0, startedAt = os.clock(), status = "Idle", lastGuid = "-", lastPrize = "-", lastGrant = "-", } local log -- assigned once the log panel exists --------------------------------------------------------------------- -- REMOTES --------------------------------------------------------------------- local Remotes = { request = nil, complete = nil, claim = nil, index = nil, sellAll = nil, upgrade = nil, upState = nil, reward = nil } local function findByRemoteName(name, preferFolder) local fallback for _, v in ipairs(Replicated:GetDescendants()) do local isRemote = v:IsA("RemoteEvent") or v:IsA("RemoteFunction") if isRemote and v.Name == name then if preferFolder and v.Parent and v.Parent.Name:find(preferFolder) then return v end fallback = fallback or v end end return fallback end local function resolveRemotes() Remotes.request = findByRemoteName("RequestTicket", "Scratch") Remotes.complete = findByRemoteName("CompleteTicket", "Scratch") Remotes.claim = findByRemoteName("ClaimRevealedReward", "Scratch") Remotes.index = findByRemoteName("GetIndexData") Remotes.sellAll = findByRemoteName("SellAll", "Sell") Remotes.upgrade = findByRemoteName("BuyUpgrade", "Upgrade") Remotes.upState = findByRemoteName("GetUpgradeState", "Upgrade") Remotes.reward = findByRemoteName("RewardGranted") end resolveRemotes() --------------------------------------------------------------------- -- TICKET TYPES (universal) --------------------------------------------------------------------- local TicketList = { "BasicTicket" } local learned = { BasicTicket = true } local ticketIdx = 0 local function learnTicket(name) if type(name) ~= "string" then return end if #name > 40 or not name:lower():find("ticket") then return end if learned[name] then return end learned[name] = true table.insert(TicketList, name) if log then log("learned ticket: " .. name) end end local function nextTicket() if Config.Ticket ~= "auto" then return Config.Ticket end if #TicketList == 0 then return "BasicTicket" end ticketIdx = (ticketIdx % #TicketList) + 1 return TicketList[ticketIdx] end -- learn every ticket name the game itself fires when you click one if hookmetamethod and getnamecallmethod then pcall(function() local old old = hookmetamethod(game, "__namecall", function(self, ...) local method = getnamecallmethod() if method == "InvokeServer" and typeof(self) == "Instance" and self.Name == "RequestTicket" then learnTicket((...)) end return old(self, ...) end) end) end --------------------------------------------------------------------- -- REMOTE HELPERS --------------------------------------------------------------------- local function invoke(remote, timeout, ...) if not remote then return false, nil, "no remote" end local done, ok, value, err = false, false, nil, nil local args = table.pack(...) task.spawn(function() local s, r = pcall(function() if remote:IsA("RemoteFunction") then return remote:InvokeServer(table.unpack(args, 1, args.n)) end remote:FireServer(table.unpack(args, 1, args.n)) return nil end) ok, value = s, r if not s then err = tostring(r) end done = true end) local t0 = os.clock() while not done and (os.clock() - t0) < timeout do task.wait(0.03) end return done and ok, value, err end -- pull fields out of whatever table the server returns local function findField(t, names, depth) depth = depth or 0 if type(t) ~= "table" or depth > 3 then return nil end -- name priority first, so MatchItemId wins over generic "Id" for _, n in ipairs(names) do for k, v in pairs(t) do if type(k) == "string" and k:lower() == n:lower() and (type(v) == "string" or type(v) == "number") then local s = tostring(v) if s ~= "" then return s end end end end for _, v in pairs(t) do if type(v) == "table" then local r = findField(v, names, depth + 1) if r then return r end end end end local GUID_KEYS = { "TicketId", "Uuid", "Guid", "Ticket", "Token", "CardId", "Key", "Id" } local PRIZE_KEYS = { "MatchItemId", "Prize", "Reward", "Item", "Result", "Loot", "Name", "Value" } local GRANT_KEYS = { "GrantId", "Grant", "Id" } local function parseRequest(res) if type(res) == "string" then return res, nil end if type(res) == "table" then return findField(res, GUID_KEYS), findField(res, PRIZE_KEYS) end return nil, nil end --------------------------------------------------------------------- -- SCRATCH ENGINE --------------------------------------------------------------------- local Engine = {} function Engine.describe(v) if type(v) == "table" then local ok, s = pcall(function() return HttpService:JSONEncode(v) end) if ok and #s < 1200 then return s end local parts = {} for k, val in pairs(v) do table.insert(parts, tostring(k) .. "=" .. tostring(val)) if #parts >= 10 then break end end return "{" .. table.concat(parts, ", ") .. "}" end return tostring(v) end -- one full ticket cycle; returns true on success function Engine.cycle(verbose) if not Remotes.request then return false, "RequestTicket missing" end local ticket = nextTicket() Config.LastTicket = ticket local ok, res, err = invoke(Remotes.request, Config.InvokeTimeout, ticket, true, true) if not ok then return false, "RequestTicket failed: " .. tostring(err) end if verbose then log("request -> " .. Engine.describe(res)) pcall(function() print("[V] request raw: " .. HttpService:JSONEncode(res)) end) end local guid, prize = parseRequest(res) if not guid then -- server often hands back nothing; the client mints the ticket id itself guid = HttpService:GenerateGUID(false):lower() if verbose then log("no server id — minted " .. guid) end end Stats.lastGuid = guid local finalPrize = (Config.PrizeOverride ~= "" and Config.PrizeOverride) or prize Stats.lastPrize = finalPrize or "-" if not finalPrize and Config.SkipIfNoPrize then return false, "prize unknown (set Prize override)" end if Remotes.complete then local cok, cres = invoke(Remotes.complete, Config.InvokeTimeout, guid, finalPrize, Config.Mode) if not cok then return false, "CompleteTicket failed" end if verbose then log("complete -> " .. Engine.describe(cres)) end -- claim is keyed to the GrantId that complete returns, not the ticket id local grant = (type(cres) == "table" and findField(cres, GRANT_KEYS)) or nil if grant then Stats.lastGrant = grant end if Remotes.claim then local clok, clres = invoke(Remotes.claim, Config.InvokeTimeout, grant or guid) if not clok then return false, "Claim failed" end if verbose then log("claim -> " .. Engine.describe(clres)) end end end return true, "ok" end -- ghost sell: same call the game makes, no walking to the sell pad function Engine.sellAll() if not Remotes.sellAll then return false, "SellAll remote missing" end local ok, res, err = invoke(Remotes.sellAll, Config.InvokeTimeout) if not ok then return false, "sell failed: " .. tostring(err) end return true, Engine.describe(res) end -- ghost upgrade: BuyUpgrade(<name>, 1) straight from the client function Engine.upgrade(name) if not Remotes.upgrade then return false, "BuyUpgrade remote missing" end if not name or name == "" then return false, "no upgrade selected" end local ok, res, err = invoke(Remotes.upgrade, Config.InvokeTimeout, name, 1) if not ok then return false, "upgrade failed: " .. tostring(err) end return true, Engine.describe(res) end function Engine.upgradeTargets() if Config.UpgradeTarget == "Both" then return { "Luck", "Value" } end if Config.UpgradeTarget ~= "" then return { Config.UpgradeTarget } end return {} end function Engine.loop() while task.wait() do if not Config.Enabled then Stats.status = "Idle" task.wait(0.15) else local ok, reason = Engine.cycle(false) if ok then Stats.cycles = Stats.cycles + 1 Stats.status = "Cycle " .. Stats.cycles .. " | " .. Stats.lastPrize else Stats.fails = Stats.fails + 1 Stats.status = "Stopped: " .. tostring(reason) end task.wait(Config.Delay + math.random() * Config.Jitter) end end end if Remotes.reward then pcall(function() Remotes.reward.OnClientEvent:Connect(function() Stats.rewards = Stats.rewards + 1 end) end) end -- auto upgrade loop: independent of the scratch loop task.spawn(function() local last = 0 local lastFail = nil while task.wait(0.4) do if Remotes.upgrade and Config.UpgradeTarget ~= "" and (os.clock() - last) >= Config.UpgradeDelay then last = os.clock() for _, name in ipairs(Engine.upgradeTargets()) do local ok, info = Engine.upgrade(name) if ok then if log then log("upgrade " .. name .. " -> " .. tostring(info)) end lastFail = nil elseif info ~= lastFail then lastFail = info if log then log("upgrade " .. name .. " blocked: " .. tostring(info)) end end end end end end) --------------------------------------------------------------------- -- THEME + BUILDERS --------------------------------------------------------------------- local T = { bg = Color3.fromRGB(14, 15, 19), panel = Color3.fromRGB(22, 24, 31), panel2 = Color3.fromRGB(28, 31, 40), stroke = Color3.fromRGB(44, 47, 58), text = Color3.fromRGB(236, 238, 244), sub = Color3.fromRGB(128, 133, 148), accent = Color3.fromRGB(108, 196, 255), accent2 = Color3.fromRGB(160, 120, 255), good = Color3.fromRGB(92, 214, 140), bad = Color3.fromRGB(240, 96, 108), } local function new(class, props, parent) local o = Instance.new(class) for k, v in pairs(props) do o[k] = v end if parent then o.Parent = parent end return o end local function corner(inst, r) new("UICorner", { CornerRadius = UDim.new(0, r) }, inst) end local function stroke(inst, c, t) new("UIStroke", { Color = c or T.stroke, Thickness = t or 1, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }, inst) end local function tween(inst, t, props) local ti = TweenService:Create(inst, TweenInfo.new(t, Enum.EasingStyle.Quint, Enum.EasingDirection.Out), props) ti:Play() return ti end -- UI SHELL --------------------------------------------------------------------- local old = CoreGui:FindFirstChild("V_Scratch") if old then old:Destroy() end local gui = new("ScreenGui", { Name = "V_Scratch", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 999, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, }, CoreGui) local W, H = 440, 300 local root = new("Frame", { Name = "Root", Size = UDim2.fromOffset(W, H), Position = UDim2.new(0, 40, 0, 110), BackgroundColor3 = T.bg, BorderSizePixel = 0, ClipsDescendants = true, }, gui) corner(root, 14) stroke(root, T.stroke, 1) -- header local header = new("Frame", { Size = UDim2.new(1, 0, 0, 46), BackgroundTransparency = 1 }, root) local dot = new("Frame", { Size = UDim2.fromOffset(8, 8), Position = UDim2.fromOffset(16, 19), BackgroundColor3 = T.bad, BorderSizePixel = 0, }, header) corner(dot, 4) new("TextLabel", { Size = UDim2.fromOffset(200, 20), Position = UDim2.fromOffset(32, 13), BackgroundTransparency = 1, Text = "🎟️ Scratch a Ticket", Font = Enum.Font.GothamBold, TextSize = 12, TextColor3 = T.text, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, header) new("TextLabel", { Size = UDim2.fromOffset(150, 20), Position = UDim2.new(1, -196, 0, 13), BackgroundTransparency = 1, Text = "by shark_Attack · v0.1.10", Font = Enum.Font.Gotham, TextSize = 10, TextColor3 = T.sub, TextXAlignment = Enum.TextXAlignment.Right, TextTruncate = Enum.TextTruncate.AtEnd, }, header) local function smallBtn(text, xOff) local b = new("TextButton", { Size = UDim2.fromOffset(26, 26), Position = UDim2.new(1, xOff, 0, 10), BackgroundColor3 = T.panel, BorderSizePixel = 0, Text = text, Font = Enum.Font.GothamBold, TextSize = 14, TextColor3 = T.sub, AutoButtonColor = false, }, header) corner(b, 8) b.MouseEnter:Connect(function() tween(b, 0.12, { BackgroundColor3 = T.panel2 }) end) b.MouseLeave:Connect(function() tween(b, 0.12, { BackgroundColor3 = T.panel }) end) return b end local minBtn = smallBtn("−", -70) local closeBtn = smallBtn("×", -38) -- rail + pages local rail = new("Frame", { Size = UDim2.new(0, 52, 1, -46), Position = UDim2.fromOffset(1, 46), BackgroundColor3 = T.panel, BackgroundTransparency = 0.35, BorderSizePixel = 0, }, root) new("Frame", { Size = UDim2.new(0, 1, 1, -46), Position = UDim2.fromOffset(52, 46), BackgroundColor3 = T.stroke, BorderSizePixel = 0, }, root) local pages = new("Frame", { Size = UDim2.new(1, -54, 1, -46), Position = UDim2.fromOffset(54, 46), BackgroundTransparency = 1, }, root) local PageData, activeTab = {}, nil local function makeTab(name, glyph) local btn = new("TextButton", { Size = UDim2.fromOffset(40, 40), BackgroundColor3 = T.bg, BackgroundTransparency = 1, BorderSizePixel = 0, Text = glyph, Font = Enum.Font.GothamBold, TextSize = 16, TextColor3 = T.sub, AutoButtonColor = false, }, rail) corner(btn, 10) local ind = new("Frame", { Size = UDim2.fromOffset(3, 0), Position = UDim2.fromOffset(0, 20), BackgroundColor3 = T.accent, BorderSizePixel = 0, }, btn) corner(ind, 2) local page = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Visible = false }, pages) PageData[name] = { btn = btn, ind = ind, page = page } btn.MouseButton1Click:Connect(function() PageData._show(name) end) return page end local function showTab(name) if activeTab == name then return end activeTab = name for n, d in pairs(PageData) do if type(d) == "table" and d.page then local on = (n == name) d.page.Visible = on tween(d.btn, 0.18, { TextColor3 = on and T.text or T.sub }) tween(d.ind, 0.18, { Size = UDim2.fromOffset(3, on and 18 or 0) }) end end end PageData._show = showTab local farmPage = makeTab("farm", "◎") local setPage = makeTab("settings", "⚙") local logPage = makeTab("log", "≡") PageData.farm.btn.Position = UDim2.fromOffset(6, 8) PageData.settings.btn.Position = UDim2.fromOffset(6, 52) PageData.log.btn.Position = UDim2.fromOffset(6, 96) -- FARM PAGE ---------------------------------------------------------- local card = new("Frame", { Size = UDim2.new(1, -24, 0, 96), Position = UDim2.fromOffset(12, 10), BackgroundColor3 = T.panel, BorderSizePixel = 0, }, farmPage) corner(card, 12) stroke(card, T.stroke, 1) new("UIGradient", { Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.93), NumberSequenceKeypoint.new(1, 1), }), Rotation = 35, Color = ColorSequence.new(T.accent, T.accent2), }, card) new("TextLabel", { Size = UDim2.fromOffset(200, 16), Position = UDim2.fromOffset(14, 12), BackgroundTransparency = 1, Text = "AUTO SCRATCH", Font = Enum.Font.GothamBold, TextSize = 11, TextColor3 = T.sub, TextXAlignment = Enum.TextXAlignment.Left, }, card) local statusLabel = new("TextLabel", { Size = UDim2.new(1, -28, 0, 18), Position = UDim2.fromOffset(14, 34), BackgroundTransparency = 1, Text = "Idle", Font = Enum.Font.GothamMedium, TextSize = 13, TextColor3 = T.text, TextXAlignment = Enum.TextXAlignment.Left, }, card) local subLabel = new("TextLabel", { Size = UDim2.new(1, -28, 0, 14), Position = UDim2.fromOffset(14, 52), BackgroundTransparency = 1, Text = "ticket - | prize -", Font = Enum.Font.Code, TextSize = 10, TextColor3 = T.sub, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, card) local sw = new("TextButton", { Size = UDim2.fromOffset(48, 26), Position = UDim2.new(1, -62, 0, 12), BackgroundColor3 = Color3.fromRGB(48, 51, 62), BorderSizePixel = 0, Text = "", AutoButtonColor = false, }, card) corner(sw, 13) local knob = new("Frame", { Size = UDim2.fromOffset(20, 20), Position = UDim2.fromOffset(3, 3), BackgroundColor3 = Color3.fromRGB(200, 204, 214), BorderSizePixel = 0, }, sw) corner(knob, 10) local testBtn = new("TextButton", { Size = UDim2.fromOffset(120, 24), Position = UDim2.new(1, -132, 0, 68), BackgroundColor3 = T.panel2, BorderSizePixel = 0, Text = "Run 1 cycle", Font = Enum.Font.GothamMedium, TextSize = 11, TextColor3 = T.accent, AutoButtonColor = false, }, card) corner(testBtn, 8) stroke(testBtn, T.stroke, 1) local dumpBtn = new("TextButton", { Size = UDim2.fromOffset(120, 24), Position = UDim2.new(1, -262, 0, 68), BackgroundColor3 = T.panel2, BorderSizePixel = 0, Text = "Dump UI", Font = Enum.Font.GothamMedium, TextSize = 11, TextColor3 = T.sub, AutoButtonColor = false, }, card) corner(dumpBtn, 8) stroke(dumpBtn, T.stroke, 1) local function paintToggle() tween(sw, 0.18, { BackgroundColor3 = Config.Enabled and T.good or Color3.fromRGB(48, 51, 62) }) tween(knob, 0.18, { Position = Config.Enabled and UDim2.fromOffset(25, 3) or UDim2.fromOffset(3, 3), BackgroundColor3 = Config.Enabled and Color3.new(1, 1, 1) or Color3.fromRGB(200, 204, 214), }) tween(dot, 0.2, { BackgroundColor3 = Config.Enabled and T.good or T.bad }) end local function setEnabled(v) Config.Enabled = v paintToggle() log("auto-scratch " .. (v and "ON" or "OFF")) end sw.MouseButton1Click:Connect(function() setEnabled(not Config.Enabled) end) testBtn.MouseButton1Click:Connect(function() testBtn.Text = "running..." task.spawn(function() local ok, reason = Engine.cycle(true) testBtn.Text = "Run 1 cycle" log("test -> " .. (ok and "success" or tostring(reason))) print("[V] test ->", ok, reason) end) end) dumpBtn.MouseButton1Click:Connect(function() local n = 0 for _, v in ipairs(LP.PlayerGui:GetDescendants()) do if v:IsA("TextButton") and v.Visible then n = n + 1 local line = "[btn] " .. v.Text .. " :: " .. v:GetFullName() log(line) print("[V]", line) end end log("buttons found: " .. n) print("[V] buttons found:", n) end) -- GHOST SELL --------------------------------------------------------- local sellBtn = new("TextButton", { Size = UDim2.fromOffset(132, 34), Position = UDim2.fromOffset(12, 116), BackgroundColor3 = T.panel, BorderSizePixel = 0, Text = "SELL ALL", Font = Enum.Font.GothamBold, TextSize = 12, TextColor3 = T.accent2, AutoButtonColor = false, }, farmPage) corner(sellBtn, 10) stroke(sellBtn, T.stroke, 1) sellBtn.MouseEnter:Connect(function() tween(sellBtn, 0.12, { BackgroundColor3 = T.panel2 }) end) sellBtn.MouseLeave:Connect(function() tween(sellBtn, 0.12, { BackgroundColor3 = T.panel }) end) sellBtn.MouseButton1Click:Connect(function() sellBtn.Text = "selling..." task.spawn(function() local ok, info = Engine.sellAll() sellBtn.Text = "SELL ALL" log("sell -> " .. tostring(info)) print("[V] sell ->", ok, info) end) end) local upBtn = new("TextButton", { Size = UDim2.fromOffset(132, 34), Position = UDim2.fromOffset(152, 116), BackgroundColor3 = T.panel, BorderSizePixel = 0, Text = "UPGRADE", Font = Enum.Font.GothamBold, TextSize = 12, TextColor3 = T.accent, AutoButtonColor = false, }, farmPage) corner(upBtn, 10) stroke(upBtn, T.stroke, 1) upBtn.MouseEnter:Connect(function() tween(upBtn, 0.12, { BackgroundColor3 = T.panel2 }) end) upBtn.MouseLeave:Connect(function() tween(upBtn, 0.12, { BackgroundColor3 = T.panel }) end) upBtn.MouseButton1Click:Connect(function() local targets = Engine.upgradeTargets() if #targets == 0 then targets = { "Luck" } end upBtn.Text = "buying..." task.spawn(function() local out = {} for _, name in ipairs(targets) do local ok, info = Engine.upgrade(name) table.insert(out, name .. ": " .. tostring(info)) print("[V] upgrade ->", name, ok, info) end upBtn.Text = "UPGRADE" log("upgrade -> " .. table.concat(out, " | ")) end) end) -- SETTINGS PAGE ------------------------------------------------------ local function settingRow(y, label, btnText, onClick) local row = new("Frame", { Size = UDim2.new(1, -24, 0, 32), Position = UDim2.fromOffset(12, y), BackgroundColor3 = T.panel, BorderSizePixel = 0, }, setPage) corner(row, 9) stroke(row, T.stroke, 1) new("TextLabel", { Size = UDim2.fromOffset(160, 18), Position = UDim2.fromOffset(12, 7), BackgroundTransparency = 1, Text = label, Font = Enum.Font.Gotham, TextSize = 12, TextColor3 = T.text, TextXAlignment = Enum.TextXAlignment.Left, }, row) local b = new("TextButton", { Size = UDim2.fromOffset(112, 24), Position = UDim2.new(1, -122, 0, 4), BackgroundColor3 = T.bg, BorderSizePixel = 0, Text = btnText, Font = Enum.Font.GothamMedium, TextSize = 11, TextColor3 = T.accent, AutoButtonColor = false, }, row) corner(b, 8) stroke(b, T.stroke, 1) b.MouseButton1Click:Connect(function() onClick(b) end) return b end settingRow(4, "Ticket type", Config.Ticket, function(b) -- builds the cycle list live, so learned tickets show up automatically local list = { "auto" } for _, t in ipairs(TicketList) do table.insert(list, t) end local idx = 1 for i, t in ipairs(list) do if t == Config.Ticket then idx = i end end Config.Ticket = list[(idx % #list) + 1] b.Text = Config.Ticket end) settingRow(40, "Scan tickets", "refresh", function(b) b.Text = "scanning..." task.spawn(function() -- harvest names from the game's own index/market data local function harvest(v, depth) if depth > 6 then return end if type(v) == "string" then learnTicket(v) elseif type(v) == "table" then for k, val in pairs(v) do if type(k) == "string" then learnTicket(k) end harvest(val, depth + 1) end end end if Remotes.index then pcall(function() local ok, res = invoke(Remotes.index, 3.0) if ok then harvest(res, 0) end end) end -- also read visible shop buttons ("Basic Ticket" -> BasicTicket) pcall(function() for _, v in ipairs(LP.PlayerGui:GetDescendants()) do if v:IsA("TextButton") and v.Text:lower():find("ticket") then learnTicket((v.Text:gsub("%s+", ""):gsub("[^%w]", ""))) end end end) b.Text = tostring(#TicketList) .. " tickets" log("ticket pool: " .. table.concat(TicketList, ", ")) end) end) settingRow(76, "Mode arg", Config.Mode, function(b) local modes = { "Manual", "Auto", "Fast" } for i, m in ipairs(modes) do if m == Config.Mode then Config.Mode = modes[(i % #modes) + 1] break end end b.Text = Config.Mode end) settingRow(112, "Prize override", Config.PrizeOverride ~= "" and Config.PrizeOverride or "auto", function(b) -- cycles a few common names so you can lock one in manually local list = { "", "Banana", "Apple", "Box", "Common" } for i, p in ipairs(list) do if p == Config.PrizeOverride then Config.PrizeOverride = list[(i % #list) + 1] break end end b.Text = Config.PrizeOverride ~= "" and Config.PrizeOverride or "auto" end) settingRow(148, "Delay per cycle", string.format("%.2fs", Config.Delay), function(b) Config.Delay = Config.Delay + 0.05 if Config.Delay > 2.0 then Config.Delay = 0.2 end b.Text = string.format("%.2fs", Config.Delay) end) settingRow(184, "Menu keybind", Config.ToggleKey.Name, function(b) b.Text = "press a key..." local conn conn = UserInput.InputBegan:Connect(function(input, gp) if gp then return end if input.UserInputType == Enum.UserInputType.Keyboard then Config.ToggleKey = input.KeyCode b.Text = input.KeyCode.Name conn:Disconnect() end end) end) settingRow(220, "Auto upgrade", Config.UpgradeTarget ~= "" and Config.UpgradeTarget or "off", function(b) local opts = { "", "Luck", "Value", "Both" } local idx = 1 for i, o in ipairs(opts) do if o == Config.UpgradeTarget then idx = i end end Config.UpgradeTarget = opts[(idx % #opts) + 1] b.Text = Config.UpgradeTarget ~= "" and Config.UpgradeTarget or "off" b.TextColor3 = Config.UpgradeTarget ~= "" and T.good or T.accent log("auto upgrade: " .. (Config.UpgradeTarget ~= "" and Config.UpgradeTarget or "off")) end) -- LOG PAGE ----------------------------------------------------------- local logList = new("ScrollingFrame", { Size = UDim2.new(1, -24, 1, -20), Position = UDim2.fromOffset(12, 10), BackgroundColor3 = T.panel, BorderSizePixel = 0, ScrollBarThickness = 3, CanvasSize = UDim2.new(), AutomaticCanvasSize = Enum.AutomaticSize.Y, }, logPage) corner(logList, 10) stroke(logList, T.stroke, 1) new("UIListLayout", { Padding = UDim.new(0, 4), SortOrder = Enum.SortOrder.LayoutOrder }, logList) new("UIPadding", { PaddingTop = UDim.new(0, 8), PaddingLeft = UDim.new(0, 10), PaddingRight = UDim.new(0, 10) }, logList) local logIndex = 0 log = function(msg) logIndex = logIndex + 1 if logIndex > 60 then local first = logList:FindFirstChildOfClass("TextLabel") if first then first:Destroy() end end new("TextLabel", { Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, TextWrapped = true, Text = ("%s %s"):format(os.date("%H:%M:%S"), msg), Font = Enum.Font.Code, TextSize = 11, TextColor3 = T.sub, TextXAlignment = Enum.TextXAlignment.Left, LayoutOrder = logIndex, }, logList) end log("request: " .. (Remotes.request and Remotes.request:GetFullName() or "NOT FOUND")) log("complete: " .. (Remotes.complete and Remotes.complete:GetFullName() or "NOT FOUND")) log("claim: " .. (Remotes.claim and Remotes.claim:GetFullName() or "NOT FOUND")) log("sell: " .. (Remotes.sellAll and Remotes.sellAll:GetFullName() or "NOT FOUND")) log("upgrade: " .. (Remotes.upgrade and Remotes.upgrade:GetFullName() or "NOT FOUND")) print("[V] request:", Remotes.request, "complete:", Remotes.complete, "claim:", Remotes.claim, "sell:", Remotes.sellAll) -- STATUS REFRESH ----------------------------------------------------- task.spawn(function() while task.wait(Config.StatsRefresh) do statusLabel.Text = Stats.status subLabel.Text = ("ticket %s | prize %s"):format( Stats.lastGuid ~= "-" and Stats.lastGuid:sub(1, 8) or "-", Stats.lastPrize) end end) -- DRAG / MIN / CLOSE ------------------------------------------------- local dragging, dragStart, startPos header.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging, dragStart, startPos = true, input.Position, root.Position end end) UserInput.InputChanged:Connect(function(input) if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then local d = input.Position - dragStart root.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + d.X, startPos.Y.Scale, startPos.Y.Offset + d.Y) end end) UserInput.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then dragging = false end end) local minimized = false local lastSize = UDim2.fromOffset(W, H) minBtn.MouseButton1Click:Connect(function() minimized = not minimized if minimized then lastSize = root.Size tween(root, 0.22, { Size = UDim2.fromOffset(root.AbsoluteSize.X, 46) }) else tween(root, 0.22, { Size = lastSize }) end rail.Visible = not minimized pages.Visible = not minimized minBtn.Text = minimized and "+" or "−" end) -- RESIZE GRIP -------------------------------------------------------- local grip = new("TextButton", { Size = UDim2.fromOffset(18, 18), Position = UDim2.new(1, -20, 1, -20), BackgroundTransparency = 1, Text = "◢", TextSize = 12, TextColor3 = T.sub, Font = Enum.Font.GothamBold, AutoButtonColor = false, ZIndex = 6, }, root) local resizing, rStart, rSize grip.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then resizing, rStart, rSize = true, input.Position, root.AbsoluteSize end end) UserInput.InputChanged:Connect(function(input) if resizing and input.UserInputType == Enum.UserInputType.MouseMovement then local d = input.Position - rStart root.Size = UDim2.fromOffset( math.max(380, math.min(1400, rSize.X + d.X)), math.max(240, math.min(900, rSize.Y + d.Y)) ) end end) UserInput.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then resizing = false end end) closeBtn.MouseButton1Click:Connect(function() setEnabled(false) gui:Destroy() end) UserInput.InputBegan:Connect(function(input, gp) if gp then return end if input.KeyCode == Config.ToggleKey and gui.Parent then root.Visible = not root.Visible end end) -- START -------------------------------------------------------------- showTab("farm") paintToggle() task.spawn(Engine.loop) log("loaded v0.1.10 — by shark_Attack") return true