Docs / C# Projects/Zoro - Roblox Trading Bot
Zoro - Roblox Trading Bot
Roblox item trading bot.
C# ProjectsC#.NETNewtonsoft.jsonRoblox APIs
Overview
C# tool that finds viable roblox users to trade with, calculates the best trade to make, and sends the compiled trade to the user.
Key Systems & Features
- Custom item scoring
- Outbound trading system
- Item combination compiler
- Customizeable configuration files
Code Examples
Below are some code snippets from this project.
Get player items function
CSHARPpublic static List<LimitedData.Item> GrabPlayerItems(long userid)
{
List<LimitedData.Item> items = new List<LimitedData.Item>();
WebClient wc = new WebClient();
wc.Proxy = Settings.LoadedProxy;
wc.Credentials = Settings.LoadedProxy.Credentials;
try
{
dynamic json = JsonConvert.DeserializeObject(wc.DownloadString($"https://inventory.roblox.com/v1/users/{userid}/assets/collectibles?sortOrder=Asc&limit=100"));
JArray array = (JArray)json["data"];
for (int i = 0; i < array.Count; i++)
{
long itemId = Convert.ToInt64(array[i]["assetId"]);
LimitedData.Item item = LimitedData.ItemHelper.CreateItemObject(itemId);
items.Add(item);
if (item != null)
{
if (LimitedData.ItemHelper.FindItemById(itemId) == null)
{
Settings.CachedItems.Add(item);
}
}
}
wc.Dispose();
return items;
}
catch (WebException ex)
{
if ((int)ex.Status == 429 || (int)ex.Status == 401 || (int)ex.Status == 400)
{
WebData.ProxyHelper.RotateProxy();
Misc.Output.Basic("Rotated proxy.");
}
Misc.Output.Error($"Unable to grab {userid}'s items!");
wc.Dispose();
return items;
}
}Create combo function
CSHARPprivate static List<List<LimitedData.Item>> CreateCombo(List<LimitedData.Item> Inventory)
{
List<List<LimitedData.Item>> Combinations = new List<List<LimitedData.Item>>();
for (int i = 1; i <= 4; i++)
{
List<List<LimitedData.Item>> temp = new List<List<LimitedData.Item>>();
for (int j = 0; j <= Inventory.Count - i; j++)
{
List<LimitedData.Item> current = new List<LimitedData.Item>();
for (int k = 0; k < i; k++)
{
current.Add(Inventory[j + k]);
}
temp.Add(current);
}
Combinations.AddRange(temp);
}
return Combinations;
}
}