--[[ Clark AI Plugin for Roblox Studio Version: 2.1.0 Auteur: Clark / TFLOW067 Installation : 1. Copie ce fichier dans : %localappdata%\Roblox\Plugins\ 2. Lance Roblox Studio 3. Clark apparaît dans l'onglet Plugins 4. Configure l'adresse du serveur Clark dans les paramètres Ce plugin connecte Roblox Studio à ton serveur Clark (Python). Lance Clark avec : python server.py --port 8787 ]] local PLUGIN_NAME = "Clark AI" local PLUGIN_VERSION = "2.1.0" local HttpService = game:GetService("HttpService") local StudioService = game:GetService("StudioService") local Selection = game:GetService("Selection") local CLARK_URL = "http://127.0.0.1:8787" local toolbar = plugin:CreateToolbar("Clark AI", "Clark AI", "Assistant IA pour Roblox Studio") local mainButton = toolbar:CreateButton("Clark AI", "Ouvrir Clark AI Assistant", "rbxassetid://4458901886", "Clark AI") local function request(method, path, body) local url = CLARK_URL .. "/api/" .. path local ok, result = pcall(function() if method == "GET" then return HttpService:RequestAsync({ Url = url, Method = "GET", Headers = { ["Content-Type"] = "application/json" }, }) else return HttpService:RequestAsync({ Url = url, Method = method, Headers = { ["Content-Type"] = "application/json" }, Body = HttpService:JSONEncode(body or {}), }) end end) if not ok then return nil, "Impossible de contacter Clark sur " .. CLARK_URL .. ". Lance Clark d'abord." end if not result.Success then return nil, "Erreur HTTP " .. result.StatusCode end local decodeOk, data = pcall(function() return HttpService:JSONDecode(result.Body) end) if not decodeOk then return nil, "Reponse invalide du serveur" end return data, nil end local function generateScriptIdea() local sel = Selection:Get() local context = "" if #sel > 0 then local obj = sel[1] context = "L'utilisateur travaille sur : " .. obj:GetFullName() .. " (Type: " .. obj.ClassName .. ")" end return context end local function createUI() local dockWidget = plugin:CreateDockWidgetPluginGui( "ClarkAIWidget", DockWidgetPluginGuiInfo.new( Enum.InitialDockState.Right, false, false, 420, 600, 420, 600 ) ) dockWidget.Title = "Clark AI v" .. PLUGIN_VERSION local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(1, 0, 1, 0) mainFrame.BackgroundColor3 = Color3.fromRGB(18, 24, 38) mainFrame.BorderSizePixel = 0 mainFrame.Parent = dockWidget local layout = Instance.new("UIListLayout") layout.FillDirection = Enum.FillDirection.Vertical layout.Padding = UDim.new(0, 6) layout.Parent = mainFrame local padding = Instance.new("UIPadding") padding.PaddingTop = UDim.new(0, 8) padding.PaddingLeft = UDim.new(0, 8) padding.PaddingRight = UDim.new(0, 8) padding.Parent = mainFrame local header = Instance.new("TextLabel") header.Size = UDim2.new(1, 0, 0, 40) header.BackgroundTransparency = 1 header.Text = "Clark AI Assistant" header.TextColor3 = Color3.fromRGB(141, 166, 255) header.TextSize = 18 header.Font = Enum.Font.GothamBold header.TextXAlignment = Enum.TextXAlignment.Left header.Parent = mainFrame local statusLabel = Instance.new("TextLabel") statusLabel.Name = "Status" statusLabel.Size = UDim2.new(1, 0, 0, 22) statusLabel.BackgroundTransparency = 1 statusLabel.Text = "Connecte a " .. CLARK_URL statusLabel.TextColor3 = Color3.fromRGB(49, 208, 124) statusLabel.TextSize = 12 statusLabel.Font = Enum.Font.Gotham statusLabel.TextXAlignment = Enum.TextXAlignment.Left statusLabel.Parent = mainFrame local scrollFrame = Instance.new("ScrollingFrame") scrollFrame.Name = "ChatLog" scrollFrame.Size = UDim2.new(1, 0, 1, -160) scrollFrame.BackgroundTransparency = 1 scrollFrame.ScrollBarThickness = 6 scrollFrame.CanvasSize = UDim2.new(0, 0, 0, 0) scrollFrame.AutomaticCanvasSize = Enum.AutomaticSize.Y scrollFrame.Parent = mainFrame local chatLayout = Instance.new("UIListLayout") chatLayout.Padding = UDim.new(0, 6) chatLayout.Parent = scrollFrame local inputBox = Instance.new("TextBox") inputBox.Name = "Input" inputBox.Size = UDim2.new(1, 0, 0, 60) inputBox.Position = UDim2.new(0, 0, 1, -110) inputBox.BackgroundColor3 = Color3.fromRGB(26, 38, 54) inputBox.BorderSizePixel = 0 inputBox.TextColor3 = Color3.fromRGB(237, 243, 255) inputBox.PlaceholderText = "Demande a Clark d'ecrire du code Roblox..." inputBox.PlaceholderColor3 = Color3.fromRGB(107, 97, 87) inputBox.TextSize = 14 inputBox.Font = Enum.Font.Gotham inputBox.TextWrapped = true inputBox.MultiLine = true inputBox.TextXAlignment = Enum.TextXAlignment.Left inputBox.TextYAlignment = Enum.TextYAlignment.Top inputBox.Parent = mainFrame local inputCorner = Instance.new("UICorner") inputCorner.CornerRadius = UDim.new(0, 8) inputCorner.Parent = inputBox local sendBtn = Instance.new("TextButton") sendBtn.Name = "SendBtn" sendBtn.Size = UDim2.new(1, 0, 0, 38) sendBtn.Position = UDim2.new(0, 0, 1, -44) sendBtn.BackgroundColor3 = Color3.fromRGB(79, 116, 245) sendBtn.BorderSizePixel = 0 sendBtn.Text = "Envoyer a Clark" sendBtn.TextColor3 = Color3.fromRGB(255, 255, 255) sendBtn.TextSize = 14 sendBtn.Font = Enum.Font.GothamBold sendBtn.Parent = mainFrame local sendCorner = Instance.new("UICorner") sendCorner.CornerRadius = UDim.new(0, 8) sendCorner.Parent = sendBtn local quickBtns = Instance.new("Frame") quickBtns.Name = "QuickButtons" quickBtns.Size = UDim2.new(1, 0, 0, 26) quickBtns.Position = UDim2.new(0, 0, 1, -146) quickBtns.BackgroundTransparency = 1 quickBtns.Parent = mainFrame local qLayout = Instance.new("UIListLayout") qLayout.FillDirection = Enum.FillDirection.Horizontal qLayout.Padding = UDim.new(0, 4) qLayout.Parent = quickBtns local function addQuickBtn(text, callback) local btn = Instance.new("TextButton") btn.Size = UDim2.new(0, text:len() * 7 + 16, 1, 0) btn.BackgroundColor3 = Color3.fromRGB(26, 38, 54) btn.BorderSizePixel = 0 btn.Text = text btn.TextColor3 = Color3.fromRGB(141, 166, 255) btn.TextSize = 11 btn.Font = Enum.Font.Gotham btn.Parent = quickBtns local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 6) corner.Parent = btn btn.MouseButton1Click:Connect(callback) end local function addMessage(role, text) local msgFrame = Instance.new("Frame") msgFrame.Size = UDim2.new(1, 0, 0, 0) msgFrame.AutomaticSize = Enum.AutomaticSize.Y msgFrame.BackgroundColor3 = role == "user" and Color3.fromRGB(51, 74, 175) or Color3.fromRGB(20, 29, 42) msgFrame.BorderSizePixel = 0 msgFrame.Parent = scrollFrame local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 10) corner.Parent = msgFrame local padding = Instance.new("UIPadding") padding.PaddingTop = UDim.new(0, 8) padding.PaddingLeft = UDim.new(0, 10) padding.PaddingRight = UDim.new(0, 10) padding.PaddingBottom = UDim.new(0, 8) padding.Parent = msgFrame local label = Instance.new("TextLabel") label.Size = UDim2.new(1, 0, 0, 0) label.AutomaticSize = Enum.AutomaticSize.Y label.BackgroundTransparency = 1 label.Text = (role == "user" and "Toi: " or "Clark: ") .. text label.TextColor3 = Color3.fromRGB(237, 243, 255) label.TextSize = 13 label.Font = role == "user" and Enum.Font.Gotham or Enum.Font.GothamMedium label.TextWrapped = true label.TextXAlignment = Enum.TextXAlignment.Left label.TextYAlignment = Enum.TextYAlignment.Top label.Parent = msgFrame scrollFrame.CanvasSize = UDim2.new(0, 0, 0, chatLayout.AbsoluteContentSize.Y + 20) scrollFrame.CanvasPosition = Vector2.new(0, scrollFrame.CanvasSize.Y.Offset) end local function sendMessage() local text = inputBox.Text:match("^%s*(.-)%s*$") if not text or text == "" then return end inputBox.Text = "" addMessage("user", text) sendBtn.Text = "Clark reflechit..." sendBtn.BackgroundColor3 = Color3.fromRGB(100, 100, 100) local context = generateScriptIdea() local fullQuery = text if context ~= "" then fullQuery = context .. "\n\nDemande: " .. text end spawn(function() local data, err = request("POST", "chat", { query = fullQuery, provider = "auto", messages = {}, }) sendBtn.Text = "Envoyer a Clark" sendBtn.BackgroundColor3 = Color3.fromRGB(79, 116, 245) if data and data.ok then addMessage("assistant", data.reply) else addMessage("assistant", "Erreur: " .. (err or data and data.reply or "inconnue")) end end) end sendBtn.MouseButton1Click:Connect(sendMessage) inputBox.FocusLost:Connect(function(enter) if enter then sendMessage() end end) addQuickBtn("Script", function() inputBox.Text = "Ecris un script Roblox Studio pour" inputBox:CaptureFocus() end) addQuickBtn("Optimiser", function() local sel = Selection:Get() if #sel > 0 then inputBox.Text = "Optimise ce script : " .. sel[1]:GetFullName() else inputBox.Text = "Comment optimiser un script Roblox ?" end inputBox:CaptureFocus() end) addQuickBtn("Bug", function() inputBox.Text = "J'ai un bug dans mon script, aide-moi a le corriger" inputBox:CaptureFocus() end) addQuickBtn("Exploit", function() inputBox.Text = "Detecte les vulnerabilites securite dans mon jeu Roblox" inputBox:CaptureFocus() end) return dockWidget end local widget = nil mainButton.Click:Connect(function() if not widget then widget = createUI() end widget.Enabled = not widget.Enabled end) print("[Clark AI] Plugin charge. Version " .. PLUGIN_VERSION)