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
bug-simulator-auto-farm-auto-attack-eat-target-selection-copy.luau
165 lines · 8.3kb
/ 512kb
open file
⌘O
-- Public launcher. Bot and provider credentials are stored only on the server. local BASE = 'https://mcp.mishadev.ru/bugfarm' local Http = game:GetService('HttpService') local player = game:GetService('Players').LocalPlayer local requestFn = request or http_request or (syn and syn.request) assert(type(requestFn)=='function', 'Your executor does not support HTTP requests') assert(type(loadstring)=='function', 'Your executor does not support loadstring') local parent = player:WaitForChild('PlayerGui') local old = parent:FindFirstChild('BugFarmAccess') if old then old:Destroy() end local active, busy = true, false local session, secret, link local gui = Instance.new('ScreenGui') gui.Name='BugFarmAccess'; gui.ResetOnSpawn=false; gui.Parent=parent local function make(class, parentItem, props) local item=Instance.new(class) for key,value in pairs(props) do item[key]=value end item.Parent=parentItem return item end local frame=make('Frame',gui,{Size=UDim2.fromOffset(420,570),Position=UDim2.new(0.5,-210,0.5,-285),BackgroundColor3=Color3.fromRGB(19,23,32)}) make('UICorner',frame,{CornerRadius=UDim.new(0,14)}) local function label(value,y,height) return make('TextLabel',frame,{Text=value,Position=UDim2.fromOffset(20,y),Size=UDim2.new(1,-40,0,height),BackgroundTransparency=1,TextColor3=Color3.fromRGB(222,233,246),Font=Enum.Font.Gotham,TextSize=14,TextWrapped=true}) end local title=label('BUG FARM / ACCESS',16,30); title.TextSize=20 label('Complete up to 3 sponsor tasks in Telegram\nto unlock 24 hours of access.',55,44) local qrPanel=make('Frame',frame,{Position=UDim2.new(0.5,-120,0,115),Size=UDim2.fromOffset(240,240),BackgroundColor3=Color3.new(1,1,1),BorderSizePixel=0}) local linkBox=make('TextBox',frame,{Text='',PlaceholderText='Preparing Telegram link...',ClearTextOnFocus=false,TextEditable=false,Position=UDim2.fromOffset(20,369),Size=UDim2.new(1,-40,0,42),TextSize=12,TextWrapped=true,BackgroundColor3=Color3.fromRGB(30,37,49),TextColor3=Color3.new(1,1,1),Font=Enum.Font.Gotham}) local status=label('Connecting...',463,45) local function button(text,y,callback) local b=make('TextButton',frame,{Text=text,Position=UDim2.fromOffset(20,y),Size=UDim2.new(1,-40,0,32),BackgroundColor3=Color3.fromRGB(45,79,111),TextColor3=Color3.new(1,1,1),Font=Enum.Font.Gotham,TextSize=14}) make('UICorner',b,{CornerRadius=UDim.new(0,7)}) b.Activated:Connect(callback) return b end local function call(path,method,authenticated) local headers={['Content-Type']='application/json'} if authenticated then headers['X-Session']=session; headers.Authorization='Bearer '..secret end local response=requestFn({Url=BASE..path,Method=method or 'GET',Headers=headers,Body=method=='POST' and '{}' or nil}) local code=tonumber(response.StatusCode or response.Status) if not code or code<200 or code>=300 then error('Request failed ('..tostring(code)..')',0) end return response.Body end local function draw(matrix) qrPanel:ClearAllChildren() local n=#matrix local unit=math.floor(240/n) local margin=math.floor((240-n*unit)/2) local function block(x,y,w,h,color,radius) local item=make('Frame',qrPanel,{Position=UDim2.fromOffset(margin+x*unit,margin+y*unit),Size=UDim2.fromOffset(w*unit,h*unit),BorderSizePixel=0,BackgroundColor3=color}) if radius then make('UICorner',item,{CornerRadius=UDim.new(0,radius*unit)}) end return item end local black,white=Color3.new(0,0,0),Color3.new(1,1,1) local finders={{4,4},{n-11,4},{4,n-11}} local function inFinder(x,y) for _,p in ipairs(finders) do if x>=p[1] and x<p[1]+7 and y>=p[2] and y<p[2]+7 then return true end end return false end for y,row in ipairs(matrix) do for x,dark in ipairs(row) do if dark and not inFinder(x-1,y-1) then block(x-1,y-1,1,1,black,0.45) -- Join adjacent modules while retaining rounded exposed ends. if row[x+1] and not inFinder(x,y-1) then block(x-0.5,y-1,1,1,black) end if matrix[y+1] and matrix[y+1][x] and not inFinder(x-1,y) then block(x-1,y-0.5,1,1,black) end end end end for _,p in ipairs(finders) do block(p[1],p[2],7,7,black,1.8) block(p[1]+1,p[2]+1,5,5,white,1.2) block(p[1]+2,p[2]+2,3,3,black,0.8) end local badge=block(n/2-3.5,n/2-3.5,7,7,white,3.5) local circle=make('Frame',badge,{Position=UDim2.fromOffset(unit*0.6,unit*0.6),Size=UDim2.new(1,-unit*1.2,1,-unit*1.2),BackgroundColor3=Color3.fromRGB(42,171,238),BorderSizePixel=0}) make('UICorner',circle,{CornerRadius=UDim.new(1,0)}) make('TextLabel',circle,{Text='\226\158\164',Rotation=-30,Size=UDim2.fromScale(1,1),BackgroundTransparency=1,TextColor3=white,TextSize=unit*4.2,Font=Enum.Font.SourceSansBold}) end local function cache() if type(writefile)=='function' then pcall(writefile,'bugfarm-access.json',Http:JSONEncode({session=session,secret=secret})) end end local function create() if busy or not active then return end busy=true; status.Text='Creating a new link...' local ok,data=pcall(function() return Http:JSONDecode(call('/session','POST',false)) end) if active then if ok and data.session and data.secret and data.link and type(data.qr)=='table' then session=data.session; secret=data.secret; link=data.link linkBox.Text=link; draw(data.qr); cache() status.Text='Open the link or scan the QR code.\nAccess unlocks automatically after verification.' else status.Text='Could not create a link. Please try again.' end end busy=false end button('Copy Telegram link',421,function() if not link then return end if type(setclipboard)=='function' then setclipboard(link); status.Text='Link copied. Complete the tasks in Telegram.' else linkBox:CaptureFocus(); status.Text='Copy the link from the field above.' end end) button('Get a new link',517,function() task.spawn(create) end) local close=make('TextButton',frame,{Text='X',Position=UDim2.new(1,-33,0,8),Size=UDim2.fromOffset(25,25),BackgroundTransparency=1,TextColor3=Color3.new(1,1,1),TextSize=24}) close.Activated:Connect(function() gui:Destroy() end) gui.Destroying:Connect(function() active=false end) local function launch() status.Text='Access granted. Loading...' local source=call('/script','GET',true) if not active then return end local fn,err=loadstring(source) if not fn then error(err,0) end fn() gui:Destroy() -- Stop the loaded UI when access expires or the server rejects it. local farm=parent:FindFirstChild('BugFarmPanel') task.spawn(function() local failures=0 while farm and farm.Parent do task.wait(60) local ok,data=pcall(function() return Http:JSONDecode(call('/status','GET',true)) end) if ok and data.status=='granted' then failures=0 elseif ok then farm:Destroy(); break else failures=failures+1 if failures>=3 then farm:Destroy(); break end end end end) end task.spawn(function() local restored=false if type(readfile)=='function' then local ok,data=pcall(function() return Http:JSONDecode(readfile('bugfarm-access.json')) end) if ok and type(data)=='table' and type(data.session)=='string' and type(data.secret)=='string' then session=data.session; secret=data.secret local checked,access=pcall(function() return Http:JSONDecode(call('/status','GET',true)) end) restored=checked and access.status=='granted' end end if not active then return end if not restored then create() end while active do if session and not busy then local checkedSession=session local ok,data=pcall(function() return Http:JSONDecode(call('/status','GET',true)) end) if not active then return end if checkedSession==session and not busy then if ok and data.status=='granted' then local loaded=pcall(launch) if loaded then return end status.Text='Could not load the script. Retrying...' elseif ok and data.status=='expired' then status.Text='Your link or access expired. Get a new link.' elseif not ok then status.Text='Connection interrupted. Retrying...' end end end task.wait(4) end end)