poe.watch api update
This commit is contained in:
@@ -8,68 +8,54 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace PoE_MxFilterGen
|
||||
{
|
||||
public class Sparkline
|
||||
{
|
||||
public List<double?> data { get; set; }
|
||||
public double? totalChange { get; set; }
|
||||
}
|
||||
|
||||
public class ExplicitModifier
|
||||
{
|
||||
public string text { get; set; }
|
||||
public bool optional { get; set; }
|
||||
}
|
||||
|
||||
public class LineWeapon
|
||||
{
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string icon { get; set; }
|
||||
public int mapTier { get; set; }
|
||||
public int levelRequired { get; set; }
|
||||
public string baseType { get; set; }
|
||||
public int stackSize { get; set; }
|
||||
public object variant { get; set; }
|
||||
public object prophecyText { get; set; }
|
||||
public object artFilename { get; set; }
|
||||
public int links { get; set; }
|
||||
public int itemClass { get; set; }
|
||||
public Sparkline sparkline { get; set; }
|
||||
public List<object> implicitModifiers { get; set; }
|
||||
public List<ExplicitModifier> explicitModifiers { get; set; }
|
||||
public string flavourText { get; set; }
|
||||
public string itemType { get; set; }
|
||||
public double chaosValue { get; set; }
|
||||
public double exaltedValue { get; set; }
|
||||
public int count { get; set; }
|
||||
}
|
||||
|
||||
public class RootWeapon
|
||||
{
|
||||
public List<LineWeapon> lines { get; set; }
|
||||
public int id { get; set; }
|
||||
public string name { get; set; }
|
||||
public string type { get; set; }
|
||||
public string category { get; set; }
|
||||
public string group { get; set; }
|
||||
public int frame { get; set; }
|
||||
public List<object> influences { get; set; }
|
||||
public string icon { get; set; }
|
||||
public double mean { get; set; }
|
||||
public double median { get; set; }
|
||||
public double mode { get; set; }
|
||||
public double min { get; set; }
|
||||
public double max { get; set; }
|
||||
public double exalted { get; set; }
|
||||
public int total { get; set; }
|
||||
public int daily { get; set; }
|
||||
public int current { get; set; }
|
||||
public int accepted { get; set; }
|
||||
public double change { get; set; }
|
||||
public List<object> history { get; set; }
|
||||
public int? linkCount { get; set; }
|
||||
public string variation { get; set; }
|
||||
}
|
||||
|
||||
class Generator
|
||||
{
|
||||
private static string iB;
|
||||
|
||||
public static void Gen(string section, string api, string league, int minValue, int chanceMinValue, int confidence)
|
||||
public static void Gen(string section, string api, string league, int minValue)
|
||||
{
|
||||
List<string> itemBase = new List<string>();
|
||||
RootWeapon j = JsonConvert.DeserializeObject<RootWeapon>(File.ReadAllText("data/ninja.weapon.json", Encoding.UTF8));
|
||||
var RootWeapon = JsonConvert.DeserializeObject<List<RootWeapon>>(File.ReadAllText("data/poew.weapon.json", Encoding.UTF8));
|
||||
|
||||
foreach (var ln in j.lines)
|
||||
foreach (var ln in RootWeapon)
|
||||
{
|
||||
// Check if the item count is at least equal to the desired confidence level
|
||||
if (ln.count >= confidence && ln.links <= 4)
|
||||
if (ln.linkCount <= 5)
|
||||
{
|
||||
// Check if the item value is equal or superior to the minimum value
|
||||
if (ln.chaosValue >= minValue)
|
||||
if (ln.min >= minValue)
|
||||
{
|
||||
if (!itemBase.Contains(ln.baseType))
|
||||
if (!itemBase.Contains(ln.type))
|
||||
{
|
||||
itemBase.Add(ln.baseType);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.baseType);
|
||||
itemBase.Add(ln.type);
|
||||
iB = iB + string.Format(@" ""{0}""", ln.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,8 +72,8 @@ namespace PoE_MxFilterGen
|
||||
File.AppendAllText(fn, " SetBackgroundColor 255 255 255" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetBorderColor 180 96 0" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " SetFontSize 45" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_chase.mp3""", Encoding.UTF8);
|
||||
File.AppendAllText(fn, " MinimapIcon 0 White Star", Encoding.UTF8);
|
||||
File.AppendAllText(fn, @" CustomAlertSound ""mx_chase.mp3""" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " MinimapIcon 0 White Star" + Environment.NewLine, Encoding.UTF8);
|
||||
File.AppendAllText(fn, " PlayEffect White", Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user