Advertisement
XZTablets

Untitled

Mar 24th, 2022
886
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.11 KB | None | 0 0
  1. local Disabled = false;
  2. local RestrictedId = {3369366264};
  3.  
  4. repeat wait() until game:IsLoaded();
  5. wait(2);
  6.  
  7. local Players = game:GetService('Players');
  8. local Player = Players.LocalPlayer;
  9.  
  10. if (game.PlaceId == 8916037983) and (not Disabled) and (table.find(RestrictedId, Player.UserId)) then
  11.     local MinimumBuyers = 4; -- How Many Buyers there Must Be
  12.     local MinimumPlayers = 10; -- How Many Players there Must Be
  13.    
  14.     local ServerHopAfterMinutes = 1.5; -- How Many Minutes you Want To Wait Before Hopping
  15.    
  16.     local JoinMessageBool = true; -- Announce Your Art Price Range
  17.    
  18.     local AutoClaimBooth = true; -- Automatically Find/Claim A Booth
  19.    
  20.     local RichHunt = true; -- Hunt for Rich Players
  21.     local RichMinimum = 175; -- How Rich the Players Have To Be
  22.     local RichTime = 10; -- How Many Seconds each Rich Player Adds to The Hop Timer
  23.     local RobuxTime = 30/1000; -- How Much Time each Robux Spent by Rich People Adds in Seconds
  24.     -- Tip: Use Values like '30/1000' to Signify that You Want to Add 30 Seconds for Every 1000 Robux
  25.    
  26.     local ArtAddsTime = true; -- If Selling Art Adds Time To Stay In Server
  27.     local ArtTimeAddition = 20; -- How Much Time to Add If Art Is Selling
  28.     local ArtWorkThreshold = 20; -- How Much Art has To Sell For To Add Time even If It Wasn't Yours
  29.    
  30.     -- Ignore --
  31.     local Buyers = 0;
  32.     local RichCount = 0;
  33.     local RichSpent = 0;
  34.     -- Ignore --
  35.    
  36.     rconsoleclear();
  37.     rconsolename('Starving Artists Server Finder | v.0.5.6 | Fungbert');
  38.    
  39.     -- Ignore --
  40.     local ServerLoadedTime = tick();
  41.     local RecentlySoldArt = 0;
  42.     -- Ignore --
  43.    
  44.     local StringBuilder = {};
  45.    
  46.     local Ansi_ESC_Colours = {
  47.         raw = 0,
  48.         black = 30,
  49.         red = 31,
  50.         green = 32,
  51.         yellow = 33,
  52.         blue = 34,
  53.         purple = 35,
  54.         cyan = 36,
  55.         white = 37
  56.     };
  57.    
  58.     StringBuilder.new = function(ss)
  59.         local Output = ss or '';
  60.         local InheritLibrary = {};
  61.         table.foreach(Ansi_ESC_Colours, function(c, v)
  62.             InheritLibrary[c] = function(s)
  63.                 Output = Output .. string.format('[%dm', v) .. s .. '';
  64.                 return InheritLibrary;
  65.             end;
  66.         end);
  67.         setmetatable(InheritLibrary, {
  68.             __call = function()
  69.                 return Output;
  70.             end;
  71.             __tostring = function()
  72.                 return Output;
  73.             end;
  74.         });
  75.         return InheritLibrary;
  76.     end;
  77.    
  78.     local PlayerCount = #Players:GetChildren();
  79.  
  80.     local function Comma(Num)
  81.         return tostring(Num):reverse():gsub('%d%d%d', '%1,'):gsub(',$', ''):reverse();
  82.     end;
  83.    
  84.     spawn(function()
  85.         local Network = require(game:GetService('ReplicatedStorage').Modules.Network);
  86.         Network:OnClientEvent('Notify', function(Target, Event)
  87.             if (Target == 'System') then
  88.                 local Buyer, Recipient, Amount = string.match(Event, '([%w_]+) bought ([%w_]+)\'s art for ([%d]+) robux!');
  89.                 if (Recipient == Player.Name) then
  90.                     RecentlySoldArt += 1;
  91.                     rconsoleprint(StringBuilder.new().raw('Sold for [').green('R$').green(tostring(Amount)).raw('];\n')());
  92.                     appendfile('StarvingLogs.txt', string.format('[@%s (%s)]: R$%s;\n', Buyer, Players:FindFirstChild(Buyer).Name, Comma(Amount)));
  93.                     return;
  94.                 end;
  95.                 if (tonumber(Amount) >= ArtWorkThreshold) then
  96.                     RecentlySoldArt += 1;
  97.                     return;
  98.                 end;
  99.             end;
  100.         end);
  101.     end);
  102.    
  103.     local Plots = game:GetService('Workspace'):WaitForChild('Plots');
  104.    
  105.     local function GetServerList(Limit)
  106.         local Cursor, Servers = nil, {};
  107.         repeat
  108.             local Response = game:GetService('HttpService'):JSONDecode(game:HttpGet('https://games.roblox.com/v1/games/' .. game.PlaceId .. '/servers/Public?sortOrder=Asc&limit=100' .. (Cursor and ('&cursor=' .. Cursor) or '')));
  109.             for _, Server in pairs(Response.data) do
  110.                 table.insert(Servers, Server);
  111.             end;
  112.             Cursor = Response.nextPageCursor;
  113.         until (not Cursor) or (#Servers >= Limit);
  114.         return Servers;
  115.     end;
  116.    
  117.     local function Hop()
  118.         local IgnoreIds = {};
  119.         local Success, Servers = pcall(GetServerList, 1024);
  120.         if (Success) then
  121.             rconsoleprint(StringBuilder.new().raw('Hopping Servers [').cyan(tostring(#Servers)).raw('];\n')());
  122.             while true do
  123.                 for _, ServerInfo in pairs(Servers) do
  124.                     if (not table.find(IgnoreIds, ServerInfo.id)) and (ServerInfo.playing < ServerInfo.maxPlayers) then
  125.                         game:GetService('TeleportService'):TeleportToPlaceInstance(game.PlaceId, ServerInfo.id, Players.LocalPlayer);
  126.                         table.insert(IgnoreIds, ServerInfo.id);
  127.                         wait();
  128.                     end;
  129.                 end;
  130.             end;
  131.         else
  132.             rconsoleprint(StringBuilder.new().raw('Failed to Get Servers [').red('Retrying in 5 Seconds').raw('];\n')());
  133.             rconsoleprint(StringBuilder.new('Error Message: [').red(tostring(Servers)).raw('];\n')());
  134.             wait(5);
  135.             return spawn(Hop);
  136.         end;
  137.     end;
  138.    
  139.     local SayMessageRequest = game:GetService('ReplicatedStorage').DefaultChatSystemChatEvents.SayMessageRequest;
  140.     local function Message(m)
  141.         SayMessageRequest:FireServer(m, 'All');
  142.     end;
  143.    
  144.     local function GetArtPrice()
  145.         local LowestPriceArt, HighestPriceArt = (function()
  146.             local LowestPrice, HighestPrice;
  147.             for _, Easel in ipairs(Plots:FindFirstChild(Player.Name).Easels:GetChildren()) do
  148.                 if (Easel.Canvas.SurfaceGui:FindFirstChild('Grid')) then
  149.                     local Price = tonumber(string.match(Easel.ArtInfo.Frame.Info.Price.Text, '%d+'));
  150.                     if (not LowestPrice) or (Price <= LowestPrice) then
  151.                         LowestPrice = Price;
  152.                     end;
  153.                     if (not HighestPrice) or (Price >= HighestPrice) then
  154.                         HighestPrice = Price;
  155.                     end;
  156.                 end;
  157.             end;
  158.             return LowestPrice or 0, HighestPrice or 0;
  159.         end)();
  160.         return LowestPriceArt, HighestPriceArt;
  161.     end;
  162.    
  163.     local function GetBuyers()
  164.         local Buyers, RichCount, RichSpent = 0, 0, 0;
  165.         for _, Player in ipairs(Players:GetChildren()) do
  166.             if (Player ~= Players.LocalPlayer) then
  167.                 if (Player:WaitForChild('leaderstats')) then
  168.                     local Bought = Player.leaderstats.Bought.Value;
  169.                     if (Bought > 0) then
  170.                         Buyers = Buyers + 1;
  171.                         if (RichHunt) and (Bought >= RichMinimum) then
  172.                             RichCount = RichCount + 1;
  173.                             RichSpent += Bought;
  174.                         end;
  175.                     end;
  176.                 end;
  177.             end;
  178.         end;
  179.         return Buyers, RichCount, RichSpent;
  180.     end;
  181.    
  182.     local function SetupStay(StayTime)
  183.         local StartTime = tick();
  184.         local Buyers, RichCount, RichSpent = GetBuyers();
  185.         local HopTimer = ((ServerHopAfterMinutes * 60) * math.clamp(RichCount, 0, 1) + (RichCount * RichTime) + math.ceil(RichSpent * RobuxTime));
  186.         HopTimer += (ArtAddsTime) and (ArtTimeAddition * RecentlySoldArt) or 0;
  187.         rconsoleprint(StringBuilder.new().raw('Staying for [').cyan(tostring(HopTimer)).raw('] seconds;\n')());
  188.         repeat
  189.             local Unclaimed = Plots:FindFirstChild('Unclaimed');
  190.             if (Unclaimed) then
  191.                 (Player.Character or Player.CharacterAdded:Wait()):WaitForChild('HumanoidRootPart').CFrame = Unclaimed.Table.Username.CFrame * CFrame.new(0, 3, 0);
  192.                 local ClaimAttach = Unclaimed.Circle:FindFirstChild('ClaimAttach') or Unclaimed.Table.Username:FindFirstChild('ClaimAttach');
  193.                 fireproximityprompt(ClaimAttach.BoothClaimPrompt);
  194.             end;
  195.             wait(1);
  196.         until Plots:FindFirstChild(Player.Name);
  197.         wait(5);
  198.         if (JoinMessageBool) then
  199.             local function SendJoinMessage()
  200.                 local Lowest, Highest = GetArtPrice();
  201.                 if (Lowest == 0) and (Highest == 0) then
  202.                     wait(30);
  203.                     return spawn(Hop);
  204.                 end;
  205.                 local JoinMessage;
  206.                 if (Lowest == Highest) then
  207.                     JoinMessage = string.format('I sell quality art for %d robux only :)', Lowest);
  208.                 else
  209.                     JoinMessage = string.format('I sell quality art for %d - %d robux only :)', Lowest, Highest);
  210.                 end;
  211.                 Message(JoinMessage);
  212.             end;
  213.             SendJoinMessage();
  214.             spawn(function()
  215.                 while wait(60) do
  216.                     SendJoinMessage();
  217.                 end;
  218.             end);
  219.         end;
  220.         spawn(function()
  221.             while true do
  222.                 local ElapsedTime = (tick() - ServerLoadedTime);
  223.                 local Buyers, RichCount, RichSpent = GetBuyers();
  224.                 local NewHopTimer = (StayTime >= ArtTimeAddition) and StayTime or ((ServerHopAfterMinutes * 60) * math.clamp(RichCount, 0, 1) + (RichCount * RichTime) + math.ceil(RichSpent * RobuxTime));
  225.                 NewHopTimer += (ArtAddsTime) and (ArtTimeAddition * RecentlySoldArt) or 0;
  226.                 if (NewHopTimer ~= HopTimer) then
  227.                     local Difference = (NewHopTimer - HopTimer);
  228.                     local MoreTime = (Difference > 0);
  229.                     HopTimer = NewHopTimer;
  230.                     rconsoleprint(StringBuilder.new().raw('Staying for [').cyan(tostring(math.abs(Difference))).raw('] ')[MoreTime and 'green' or 'red'](MoreTime and 'more' or 'less').raw(' seconds = ').yellow(tostring(NewHopTimer)).raw(';\n')());
  231.                 end;
  232.                 if (ElapsedTime >= NewHopTimer) then
  233.                     return Hop();
  234.                 end;
  235.                 wait(1);
  236.             end;
  237.         end);
  238.     end;
  239.    
  240.     local function TryStay()
  241.         if (PlayerCount >= MinimumPlayers) then
  242.             for _, Player in ipairs(Players:GetChildren()) do
  243.                 if (Player:WaitForChild('leaderstats', 5)) then
  244.                     local Bought = Player.leaderstats.Bought.Value;
  245.                     if (Bought > 0) then
  246.                         Buyers = Buyers + 1;
  247.                         if (RichHunt) and (Bought >= RichMinimum) then
  248.                             RichCount = RichCount + 1;
  249.                             RichSpent += Bought;
  250.                         end;
  251.                     end;
  252.                 end;
  253.             end;
  254.             local BuyerRequirementMet = (Buyers >= MinimumBuyers);
  255.             rconsoleprint(string.rep('-', string.len(string.format('Buyers: [%d];', Buyers))) .. '\n');
  256.             rconsoleprint(StringBuilder.new().raw('Buyers: [')[(BuyerRequirementMet and (not RichHunt)) and 'green' or (RichHunt and 'yellow' or 'red')](tostring(Buyers)).raw('];\n')());
  257.             if (BuyerRequirementMet) or (RichHunt) then
  258.                 if (RichHunt) then
  259.                     local RichRequirementMet = (RichCount >= 1);
  260.                     rconsoleprint(StringBuilder.new().raw('RichHunt: [')[RichRequirementMet and 'green' or 'red'](tostring(RichCount)).raw('];\n')());
  261.                     if (RichRequirementMet) then
  262.                         rconsoleprint(StringBuilder.new().raw('RichSpent: [').green(tostring(RichSpent)).raw(']; (Adds [').cyan(math.ceil(RichSpent * RobuxTime)).raw(']) seconds;\n')());
  263.                         return spawn(SetupStay);
  264.                     else
  265.                         return spawn(Hop);
  266.                     end;
  267.                 end;
  268.                 return spawn(SetupStay);
  269.             else
  270.                 return spawn(Hop);
  271.             end;
  272.         else
  273.             return spawn(Hop);
  274.         end;
  275.     end;
  276.    
  277.     spawn(TryStay);
  278. end;
  279.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement