Roblox Rogue Lineage COLLECTOR AUTO FARM SOURCE CODE

Roblox Rogue Lineage COLLECTOR AUTO FARM SOURCE CODE

Script By ic3

local function cprint(...)
    local Content = {};
    
    for Index, Value in pairs{...} do
        table.insert(Content, tostring(Value));
    end

    local OSTime = os.time();
    local Time = os.date('*t', OSTime);
    Time = string.format('%02d:%02d:%02d', Time.hour % 12, Time.min, Time.sec);
    
    rconsoleprint(string.format('[%s] %s\n', Time, table.concat(Content, '   ')));
end

local HttpService = game:GetService'HttpService';
local SettingsFileName = 'ch_settings.json';
local Settings = {
    Webhook = '';
    Priority = {
        'Azael';
        'Heirloom';
        'Dien';
        'Baima';
        'Staff of Pain';
        'Unwavering';
    };
};

if isfile(SettingsFileName) then
    Settings = HttpService:JSONDecode(readfile(SettingsFileName));
else
    local Settings = Settings;
    writefile(SettingsFileName, HttpService:JSONEncode(Settings));
    messageboxasync('Wrote settings to workspace, edit the \'' .. SettingsFileName .. '\' file to change settings', 'Collector Hopper', 0x40000);
end

local Players = game:GetService'Players';
local LocalPlayer = Players.LocalPlayer;
local UIS = game:GetService'UserInputService';
local TS = game:GetService'TweenService';
local RunService = game:GetService'RunService';
local Tweening = false;
local queueforteleport = (syn and syn.queue_on_teleport) or queue_for_teleport;

if typeof(Settings) ~= 'table' or not Settings.Webhook or not Settings.Priority then
    LocalPlayer:Kick'Invalid Settings';
end

game:GetService'ScriptContext'.Error:Connect(function(Message, Trace, Script)
    if Script == nil or Script == script then
        LocalPlayer:Kick(string.format('%s\n%s', tostring(Script), Message, Trace));
    end
end);

local TeleportService = game:GetService'TeleportService';
local AutoHopper = {};

local Link = 'https://www.roblox.com/games/getgameinstancesjson?placeId=%s&startIndex=%s';

function AutoHopper:Create(Name, PlaceID)
    local CurrentIndex = 0;
    local CurrentData;
    local JobIDs = {};

    local Hopper = {
        FileName = 'AutoHopper_' .. Name;
        PlaceID = PlaceID;
    };

    if game.PlaceId ~= PlaceID then return false; end

    LocalPlayer.OnTeleport:Connect(function(State, PlaceId, Spawn)
        if State.Name == 'Failed' then
            Hopper:NextServer();
        end
    end);

    function Hopper:WriteServers(Forced)
        local Exists, Data = pcall(readfile, self.FileName .. '.json');

        if not Forced and Exists and Data and pcall(HttpService.JSONDecode, HttpService, Data) then
            Data = HttpService:JSONDecode(Data);

            if typeof(tonumber(Data[1])) == 'number' and tick() - tonumber(Data[1]) < 60 * 60 and #Data > 1 then
                return false;
            end
        end

        JobIDs[1] = tostring(math.floor(tick()));

        for i, v in pairs(game:GetService'ReplicatedStorage':WaitForChild'ServerInfo':GetChildren()) do
            if v:IsA'Folder' and v:FindFirstChild'Players' then
                table.insert(JobIDs, {
                    JobID = v.Name;
                    Folder = v;
                    ServerName = v.Name;
                    CurrentPlayers = #HttpService:JSONDecode(v.Players.Value);
                });
            end
        end
        
        writefile(self.FileName .. '.json', HttpService:JSONEncode(JobIDs));
        cprint('Re-wrote serverlist');
    end

    function Hopper:NextServer()
        local Exists, Data = pcall(readfile, self.FileName .. '.json');

        if Exists and Data and pcall(HttpService.JSONDecode, HttpService, Data) then
            Data = HttpService:JSONDecode(Data);

            local StartTime = Data[1];
            table.remove(Data, 1);

            if #Data < 1 then warn(self:WriteServers(true)); self:NextServer(); return 'no servers'; end

            local RandomIndex = math.random(#Data);
            local ServerData = Data[RandomIndex];
            table.remove(Data, RandomIndex);

            table.insert(Data, 1, StartTime);
            writefile(self.FileName .. '.json', HttpService:JSONEncode(Data));

            if ServerData.CurrentPlayers == 25 then
                return self:NextServer();
            end

            TeleportService.CustomizedTeleportUI = false;

            game:service'ReplicatedStorage':WaitForChild'Requests':WaitForChild'JoinPublicServer':FireServer(ServerData.JobID);

            -- pcall(TeleportService.TeleportToPlaceInstance, TeleportService, self.PlaceID, ServerData.JobID);
        end
    end

    Hopper:WriteServers();

    return Hopper;
end

local CollectorHopper = AutoHopper:Create('CollectorHopper', 3541987450);

local StartMenu = LocalPlayer:WaitForChild'PlayerGui':WaitForChild('StartMenu', 15);

-- if LocalPlayer.Character then return LocalPlayer:Kick'Collecter farmer requires you to not be spawned in'; end

local GetKey, Keys;

function SearchTable(Table, Function)
    for i, v in pairs(Table) do
        if Function(v, i) then
            return v, i;
        end
    end
end

function IsTableMadeOfNumbers(Table)
    for i, v in pairs(Table) do
        if typeof(v) ~= 'number' then return false; end
    end

    return true;
end

local GetKey, Keys;
local Func = function(x, i) return typeof(i) == 'string' and typeof(x) == 'Instance' and x.ClassName:match'Remote[Function|Event]' and x.Name:len() == 36 end;

local EncryptionKeys;

wait(0.25);

for i, v in pairs(getgc(true)) do
    if not Keys and typeof(v) == 'table' and v ~= shared and SearchTable(v, Func) then
        Keys = v;
    end
end

GetKey = function(Key)
    local CurrentIndex = 0;

    if not Keys then
        for i, v in pairs(getgc(true)) do
            if not Keys and typeof(v) == 'table' and v ~= shared and SearchTable(v, Func) then
                Keys = v;
            end
        end
    end

    if Keys then
        for i, v in pairs(Keys) do
            if typeof(i) == 'string' and i:sub(1, #Key) == Key then
                return v;
            end
        end
    end

    return false;
end

if not GetKey then return CollectorHopper:NextServer(); end

local AreTheKeysGood = GetKey'SendDialogue';

if not AreTheKeysGood then return CollectorHopper:NextServer(); end

function Request(Table)
    if typeof(Table) ~= 'table' or Table.Url == nil or typeof(Table.Url) ~= 'string' or not Table.Url:match'http' then return false; end

    if syn and syn.request then
        return syn.request(Table);
    elseif http_request then
        return http_request(Table);
    else
        local Method = Table.Method or 'GET';
        local ContentType = typeof(Table.Headers) == 'table' and Table.Headers['Content-Type'] or 'text/plain';

        return Method == 'GET' and game:HttpGet(Table.Url) or game:HttpPost(Table.Url, Table.Body, ContentType);
    end
end

function Spawn()
    if StartMenu and StartMenu:WaitForChild'Finish' then
        StartMenu.Finish:FireServer();
        wait(0.25);
        repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChild'HumanoidRootPart';
        wait(0.5);
        StartMenu:Destroy();
    else
        return false;
    end
    
    repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChild'HumanoidRootPart';
    
    return true;
end

local Click = fireclickdetector or click_detector;
local Dialogue = { Remote = GetKey'SendDialogue'; CurrentMessage = '' };

if not Dialogue.Remote then LocalPlayer:Kick'Failed to get Dialogue remote'; return CollectorHopper:NextServer(); end

Dialogue.Remote.OnClientEvent:Connect(function(Data)
    if typeof(Data) == 'table' and typeof(Data.msg) == 'string' then
        Dialogue.CurrentMessage = Data.msg;
        Dialogue.Data = Data;
    end
end)

function Dialogue:Send(Message)
    return self.Remote:FireServer{ choice = Message };
end

function Dialogue:SelectChoice(Choice)
    if typeof(self.Data) == 'table' and typeof(self.Data.choices) == 'table' and self.Data.choices[Choice] ~= nil then
        return self.Remote:FireServer{ choice = self.Data.choices[Choice] };
    end

    return false;
end

function Dialogue:WaitFor(Message)
    local Timeout = Timeout or 3;
    local Start = tick();
    local MessageCheck = typeof(Message) == 'function' and Message or function() return self.CurrentMessage:match(Message); end

    repeat wait() until MessageCheck(Message) or tick() - Start > Timeout;
    wait(0.1);
    return tick() - Start > Timeout and false or true;
end

function Dialogue:WaitUntilOut(Time)
    local Time = Time or 1;
    local Start = tick();

    repeat wait() until not LocalPlayer.Character:FindFirstChild'InDialogue' or tick() - Start >= Time;

    return true;
end

function Dialogue:Exit()
    self.Remote:FireServer{ exit = true };
end

local BS64D = Base64 and Base64.Decode or (syn and syn.crypt and syn.crypt.base64 and syn.crypt.base64.decode);

if not BS64D then return false; end

local CurrentServer = game:GetService'ReplicatedStorage':WaitForChild'ServerInfo':WaitForChild(game.JobId);

-- for i, v in pairs(game:GetService'ReplicatedStorage':WaitForChild'ServerInfo':GetChildren()) do
--     if v:FindFirstChild'Origin' and v.Origin.Value then
--         CurrentServer = v;
--         break;
--     end
-- end

if not CurrentServer then return LocalPlayer:Kick'Failed to get Current Server'; end

local Lifespan = CurrentServer:WaitForChild'Lifespan';

local function TimeToTable(Time)
    return {
        d = Time / 60 / 60 / 24;
        h = Time / 60 / 60 % 24;
        m = Time / 60 % 60;
        s = Time % 60;
    };
end

cprint('Checking ' .. CurrentServer.ServerName.Value .. ' for collector');
-- Request {
--     Url = Settings.Webhook;
--     Method = 'POST';
--     Headers = {
--         ['Content-Type'] = 'application/json';
--     };
--     Body = game:GetService'HttpService':JSONEncode( { content = 'Waiting for collector in ' .. CurrentServer.ServerName.Value .. ' (' .. game.JobId .. ')'; } );
-- };

local VirtualUser = game:GetService'VirtualUser';

game:GetService'Players'.LocalPlayer.Idled:connect(function()
    VirtualUser:CaptureController();
    VirtualUser:ClickButton2(Vector2.new());
end)

local CollectorFound = false;
local Collectors = {};

for i, v in pairs(workspace:WaitForChild'NPCs':GetChildren()) do
    if v.Name:match'Collector' and v:FindFirstChild'Head' then
        table.insert(Collectors, v);
    end
end

local function TimeToTable(Time)
    return {
        d = Time / 60 / 60 / 24;
        h = Time / 60 / 60 % 24;
        m = Time / 60 % 60;
        s = Time % 60;
    };
end

workspace:WaitForChild'DevilRoom';

local DevilRooms = {};

for i, v in pairs(workspace:GetChildren()) do
    if v.Name == 'DevilRoom' and v:IsA'BasePart' and v:FindFirstChild'Exit' then
        table.insert(DevilRooms, {
            Door = v;
            Position = v.Position;
        });
    end
end

queueforteleport('repeat wait() until game:IsLoaded();wait(1)loadstring(syn.request{ Method = \'GET\', Url = \'https://ic3w0lf.xyz/rblx/FpIENrwgCwsFcJin0ePAwsazbB1HmrWb\' }.Body)();');
-- cprint'sfa8';

-- wait(3)

for i, v in pairs(DevilRooms) do
    -- cprint(string.format('%s %s | T:%s | CC: %s || ', i, v.Door:GetFullName(), v.Door.Transparency, tostring(v.Door.CanCollide)));
    if (input and input.down and input.down.r) or (v.Door.Transparency > 0.1 and not v.Door.CanCollide) or ((v.Door.Position - v.Position).magnitude > 5) then
        for _, c in pairs(Collectors) do
            if c:FindFirstChild'Head' and (v.Door.Position - c.Head.Position).magnitude < 200 then
                CollectorFound = c;
                break;
            end
        end

        break;
    end
end

-- game:service'ReplicatedFirst':RemoveDefaultLoadingScreen();
-- TeleportService:SetTeleportGui(nil);
TeleportService:SetTeleportSetting('Teleport', false);

if not CollectorFound or not AreTheKeysGood then
    CollectorHopper:NextServer();
    return;
end

function FallOutMap()
    workspace.FallenPartsDestroyHeight = -1e9;

    if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild'Danger' then return true; end
    
    while LocalPlayer.Character and LocalPlayer.Character:FindFirstChild'HumanoidRootPart' and LocalPlayer.Character.HumanoidRootPart.Position.Y > -40000 do
        workspace.FallenPartsDestroyHeight = -1e9;
        local Y = LocalPlayer.Character.HumanoidRootPart.Position.Y;
        LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(LocalPlayer.Character.HumanoidRootPart.Position - Vector3.new(0, Y > -500 and 50 or 0.3, 0));
        RunService.RenderStepped:wait();
    end

    if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild'Head' and LocalPlayer.Character:FindFirstChild'HumanoidRootPart' then
        LocalPlayer.Character.Head.Anchored = true;
        LocalPlayer.Character.Torso.Anchored = true;
        LocalPlayer.Character.HumanoidRootPart.Anchored = true;

        repeat wait() until not LocalPlayer.Character:FindFirstChild'Danger'; wait(0.15);
    end
end

local Time = TimeToTable(CurrentServer.Lifespan.Value);
Time = string.format('%id %0.2ih %0.2im %0.2is', Time.d, Time.h, Time.m, Time.s);

cprint('Found collector in ' .. CurrentServer.ServerName.Value .. ' at ' .. Time);
print'TAG:CHS';

spawn(function() Request {
    Url = Settings.Webhook;
    Method = 'POST';
    Headers = {
        ['Content-Type'] = 'application/json';
    };
    Body = HttpService:JSONEncode( { content = 'Collector spawned in ' .. CurrentServer.ServerName.Value .. ' at ' .. Time .. ' (' .. game.JobId .. ')'; } );
}; end)

spawn(function()
    wait(5);

    -- repeat wait() until not LocalPlayer.Character:FindFirstChild'Danger'; wait(0.25);
    repeat wait() until not Tweening wait(3);
    Dialogue:Exit();
    FallOutMap();
    -- LocalPlayer:Kick'Failed to get collector: -1';
    CollectorHopper:NextServer();
end);

Spawn();

if LocalPlayer.Character:FindFirstChildOfClass'ForceField' then LocalPlayer.Character:FindFirstChildOfClass'ForceField':Destroy(); end
local LD;

LocalPlayer.Character.ChildAdded:Connect(function(Child)
    if Child:IsA'ForceField' then
        spawn(function()
            wait(1); repeat wait() until LD;
            Child:Destroy();
        end);
    end
end);

local function DistanceTime(Distance, Speed)
    return Distance / Speed;
end

local tts = tableToString or function(t) return tostring(t) end;

local CF = CollectorFound.Torso.CFrame * CFrame.new(0, 0, 2);
LD = LocalPlayer:WaitForChild'Backpack' and LocalPlayer.Backpack:WaitForChild('Lightning Drop', 1);
Instance.new('Folder', LocalPlayer.Character).Name = 'NoFall';

if LD then
    wait(0.4);
    pcall(function()
        LocalPlayer.Character.DescendantAdded:Connect(function(c)
            if c.Name == 'Electric' and c:IsA'ParticleEmitter' then
                local p = c.Parent;
                c.Enabled = false;
                c:Clear();
                wait();
                c:Clear();
                c:Destroy();
            end
        end)
    end)
    LD.Parent = LocalPlayer.Character;
    wait(0.3);
    LD:Activate();
    repeat wait() until LocalPlayer.Character:FindFirstChild'TPSafe';
    local BP = Instance.new'BodyPosition'; game.Debris:AddItem(BP, 2);
    game.CollectionService:AddTag(BP, 'AllowedBM');
    BP.P = 10000000;
    BP.D = 10;
    BP.MaxForce = Vector3.new(1, 1, 1) * math.huge;
    BP.Position = CF.p;
    BP.Parent = LocalPlayer.Character.PrimaryPart;
    for i=1, 5 do LocalPlayer.Character:SetPrimaryPartCFrame(CF) LocalPlayer.Character.HumanoidRootPart.Velocity = Vector3.new() wait(0.05); end
    for i, v in pairs(LocalPlayer.Character:GetDescendants()) do
        if v:IsA'BasePart' then
            v.Velocity = Vector3.new();
        end
    end
    LocalPlayer.Character:SetPrimaryPartCFrame(CF) wait(0.05);
    for i, v in pairs(LocalPlayer.Character:GetDescendants()) do
        if v:IsA'BasePart' then
            v.Velocity = Vector3.new();
        end
    end
    -- LocalPlayer.Character.PrimaryPart.Anchored = true;
else
    local Distance = (LocalPlayer.Character.HumanoidRootPart.Position - CollectorFound.Torso.Position).magnitude;
    local Time = DistanceTime(Distance, 180);
    local TW = TweenInfo.new(Time, Enum.EasingStyle.Linear);
    local Tween = TS:Create(LocalPlayer.Character.HumanoidRootPart, TW, { CFrame = CF });
    Tweening = true;
    Tween:Play();
    Tween.Completed:Connect(function() Tweening = false; end);
end

repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChild'HumanoidRootPart' and (LocalPlayer.Character.HumanoidRootPart.Position - CollectorFound.Torso.Position).magnitude < 8 and not Tweening;
LocalPlayer.Character:SetPrimaryPartCFrame(CF) wait(0.5);
repeat wait()
    Click(CollectorFound:FindFirstChildOfClass'ClickDetector', 3);
until typeof(Dialogue.Data) == 'table' and typeof(Dialogue.Data.msg) == 'string' and typeof(Dialogue.Data.choices) == 'table';
wait(0.25);
cprint(tts(Dialogue));

spawn(function()
    Request {
        Url = Settings.Webhook;
        Method = 'POST';
        Headers = {
            ['Content-Type'] = 'application/json';
        };
        Body = game:GetService'HttpService':JSONEncode( { content = '[DEBUG]\n> ' .. HttpService:JSONEncode(Dialogue); } );
    }
end)

if Dialogue.Data.choices and #Dialogue.Data.choices > 0 then
    local CurrentChoice = 2;
    local Item = '';

    for i = #Settings.Priority, 1, -1 do
        local Name = Settings.Priority[i];

        if Dialogue.Data.choices[1]:match(Name) then
            CurrentChoice = 1;
        elseif Dialogue.Data.choices[2]:lower():match(Name:lower()) then
            CurrentChoice = 2;
        end
    end

    Item = Dialogue.Data.choices[CurrentChoice];
    Dialogue:SelectChoice(CurrentChoice);
    local Start = tick();
    cprint(tostring(LocalPlayer.Backpack:WaitForChild(Item, 1)));
    -- repeat wait() until #Dialogue.Data.choices < 1 or tick() - Start > 1 or Item;
    wait(0.1);
    Dialogue:Exit();
    Dialogue:WaitUntilOut(0.25);
    -- wait(0.5);

    cprint(Item);
    Request {
        Url = Settings.Webhook;
        Method = 'POST';
        Headers = {
            ['Content-Type'] = 'application/json';
        };
        Body = game:GetService'HttpService':JSONEncode( { content = 'Got ' .. Item .. ' in ' .. CurrentServer.ServerName.Value .. ' (' .. game.JobId .. ')'; } );
    };

    CollectorHopper:NextServer();
    -- LocalPlayer:Kick('Got ' .. Item);
else
    Dialogue:Exit();

    Request {
        Url = Settings.Webhook;
        Method = 'POST';
        Headers = {
            ['Content-Type'] = 'application/json';
        };
        Body = game:GetService'HttpService':JSONEncode( { content = 'Got nothing in ' .. CurrentServer.ServerName.Value .. ' (' .. game.JobId .. ')'; } );
    };

    -- LocalPlayer:Kick'Failed -2';
    FallOutMap();
    CollectorHopper:NextServer();
end
%d bloggers like this: