Пример #1
0
 public void Execute()
 {
     foreach (var x in ItemListManager.GetFUTListItems())
     {
         x.LastPriceCheck = 0;
         x.SaveChanges();
     }
     FUTLogsDatabase.AddFUTNotification("ActionScheduler", "Pricechecks resetted");
 }
Пример #2
0
 public void Execute()
 {
     foreach (var x in ItemListManager.GetFUTListItems())
     {
         x.SellPercent = Percentage;
         x.SaveChanges();
     }
     FUTLogsDatabase.AddFUTNotification("ActionScheduler", "Buypercent set to " + Percentage);
 }
 public void SetUpButton(ItemClass passedItem, ItemListManager passedListManager)
 {
     listManager      = passedListManager;
     item             = passedItem;
     nameText.text    = item.itemType;
     LvlText.text     = "Lvl: " + item.level.ToString();
     QualityText.text = item.QualityIntToString();
     GetComponent <LayoutElement>().preferredHeight = transform.parent.GetComponent <RectTransform>().rect.width / 4;
     iconSprite       = listManager.SetIconSprite(item.itemType);
     iconImage.sprite = iconSprite;
     itemEquipPool    = passedListManager.itemEquipPool;
 }
Пример #4
0
 private void Awake()
 {
     if (instance == null)
     {
         DontDestroyOnLoad(this.gameObject);
         instance = this;
         instance.initItems();
     }
     else
     {
         Destroy(gameObject);
     }
 }
Пример #5
0
 void Start()
 {
     Instance        = GetComponent <ItemListManager>();
     getItemSESource = GetComponent <AudioSource>();
     if (TitleManager.saveData == 0)
     {
         DeleteItem();
         SaveItem();
     }
     else if (TitleManager.saveData == 1)
     {
         LoadItem();
     }
 }
Пример #6
0
        public BotManager()
        {
            this.RequiresAuthentication();
            Get("/botmanager", args =>
            {
                var model = new BotManagerModel();

                model.RunningAccounts = Fifa.Managers.BotManager.GetFutClients().Count(x => x.LogicRunningReal);
                model.TotalAccounts   = Fifa.Managers.BotManager.GetFutClients().Count;

                return(View["BotManager", model]);
            });

            Post("/botmanager", args =>
            {
                var body       = new StreamReader(Request.Body).ReadToEnd();
                var parameters = HttpUtility.ParseQueryString(body);

                if (parameters["startbot"] != null)
                {
                    if (parameters["startbot"] == "true")
                    {
                        Fifa.Managers.BotManager.StartAllBots();
                    }
                }

                if (parameters["stopbot"] != null)
                {
                    if (parameters["stopbot"] == "true")
                    {
                        Fifa.Managers.BotManager.StopAllBots();
                    }
                }

                if (parameters["startnotrunningbot"] != null)
                {
                    if (parameters["startnotrunningbot"] == "true")
                    {
                        Fifa.Managers.BotManager.StartAllNotRunningBots();
                    }
                }
                return("success");
            });

            Post("/resetpricechecks", args =>
            {
                ItemListManager.ResetPriceCheckEverywhere();
                return("");
            });
        }
Пример #7
0
    public void init()
    {
        Stash = new List <Item>();
        for (int i = 0; i < OriginalItemList.Count; i++)
        {
            if (OriginalItemList[i].items != null)
            {
                ItemBaseStat stat = ItemListManager.getItemStats(OriginalItemList[i].items.itemID);
                Item         item = new Item(stat);

                int amount = Random.Range((int)OriginalItemList[i].RandomAmount.x, (int)OriginalItemList[i].RandomAmount.y);
                item.currentStack = amount;
                Stash.Add(item);
            }
        }
    }
Пример #8
0
    public void setupEntry(ItemListManager manager)
    {
        itemIcon = GetComponentInChildren <Image>();
        itemName = GetComponentInChildren <TextMeshProUGUI>();

        this.manager   = manager;
        descriptionBox = manager.descriptionBox;
        entryParent    = manager.entryParent;
        pageOption     = manager.pageOption;

        itemIcon.sprite = item.icon;
        itemName.text   = item.itemName;

        if (!item.usableOnOverworld && !item.isImportantItem)
        {
            GetComponent <CanvasGroup>().alpha = 0.5f;
        }
    }
    public void SetUpButton(ItemClass passedItem, ItemListManager passedListManager)
    {
        listManager = passedListManager;
        item        = passedItem;
        ItemClass.SetItemValues(passedItem);
        nameText.text    = passedItem.TypeName;
        LvlText.text     = "Lvl: " + passedItem.Level.ToString();
        QualityText.text = passedItem.GetQualityStr();
        GetComponent <LayoutElement>().preferredHeight = transform.parent.GetComponent <RectTransform>().rect.width / 4;
        iconImage.sprite = passedItem.Icon;
        itemEquipPool    = passedListManager.itemEquipPool;
        switch (item.qualityInt)
        {
        case 0: QualityColor.color = Color.gray; break;

        case 1: QualityColor.color = Color.white; break;

        case 2: QualityColor.color = new Color(0.5f, 0.5f, 1f, 1f); break;

        case 3: QualityColor.color = Color.yellow; break;

        default: break;
        }

        float         iconSize = listManager.iconSize;
        RectTransform rect     = iconImage.GetComponent <RectTransform>();

        if (passedItem.Size.y >= passedItem.Size.x)
        {
            rect.sizeDelta = new Vector2(iconSize / IntVector2.Slope(passedItem.Size), iconSize);
        }
        else
        {
            rect.sizeDelta = new Vector2(iconSize, iconSize * IntVector2.Slope(passedItem.Size));
        }
    }
Пример #10
0
    public CategoryListManager(string[] tags)
    {
        this.categoryTags = tags;
        foreach (string category in categoryTags) {
            GameObject[] categoryItems = GameObject.FindGameObjectsWithTag (category);
            List<GameObject> l = new List<GameObject>();

            for (int i = 0; i < categoryItems.Length; i++) {
                l.Add(categoryItems[i]);
            }

            l.Sort (compareByTag);

            ItemListManager listManager = new ItemListManager();

            foreach (GameObject item in l) {
                GameObjectManipulator itemManipulator = new GameObjectManipulator(item);
                listManager.add (itemManipulator);
            }

            categoriesMap.Add(category, listManager);
            listManager.hideAll();
        }
    }
Пример #11
0
 public void RollUpNewRequest()
 {
     currentRequestItem    = new Item(ItemListManager.pickRandomItemFromGroup());
     RequestItemRef.sprite = currentRequestItem.stats.icon;
 }
Пример #12
0
        static void Main(string[] args)
        {
            var connectionString = AppSettingsManager.GetConnectionString();

            AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));

            SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(connectionString);

            Console.Title = "FifaAutobuyer // " + AppSettingsManager.GetInstanceDescription() + " // Path: " + Path.GetFileName(Environment.CurrentDirectory) + " // Port: " + AppSettingsManager.GetWebappPort();
            Console.WriteLine("Connectionstring: " + connectionString);
            Console.WriteLine();
            Console.WriteLine("Description: " + AppSettingsManager.GetInstanceDescription());


            Console.WriteLine("Create Database if not exists...");
            DatabaseScheduler.CreateDatabaseIfNotExists();


            using (var ctx = new FUTCreationDatabase())
            {
                if (!ctx.WebpanelAccounts.Any())
                {
                    ctx.WebpanelAccounts.Add(new WebpanelAccount()
                    {
                        Username = "******", Password = "******", Role = WebAccessRole.Administrator
                    });
                    ctx.WebpanelAccounts.Add(new WebpanelAccount()
                    {
                        Username = "******", Password = "******", Role = WebAccessRole.Moderator
                    });
                }
                ctx.SaveChanges();
            }


            Console.WriteLine("Updating Settings...");
            ProxyManager.Initialize();

            Console.WriteLine("Updating Players and Consumables...");
            EADatabaseScraper.UpdateAsync().Wait();
            FUTItemManager.LoadItems();

            Console.WriteLine("Initializing BotManager...");
            BotManager.Initialize();
            Console.WriteLine("Initializing ActionScheduler...");
            ActionScheduler.CreateScheduler();
            Console.WriteLine("Resetting PriceChecks...");
            ItemListManager.ResetPriceCheckEverywhere();
            Console.WriteLine("Initializing MailService...");
            MailClientFactory.Initialize();

            Console.WriteLine("Initializing HttpServer...");
            HttpWebServer.Start(AppSettingsManager.GetWebappPort());

            Console.WriteLine("AntiCaptcha: " + AppSettingsManager.GetAntiCaptchaKey());

            Console.WriteLine("HttpServer hosted on port " + AppSettingsManager.GetWebappPort());

            Console.WriteLine("Ready...");

            //var dbScheudulerDeleteOldTrades = new Timer((e) =>
            // {
            //     AuctionManager.RemoveOldAuctions();
            // }, null, 0, (long)TimeSpan.FromHours(1).TotalMilliseconds);


            //var dbScheudulerSaveBotStatistics = new Timer((e) =>
            //{
            //    DatabaseScheduler.SaveBotStatistics();
            //}, null, 0, (long)TimeSpan.FromMinutes(30).TotalMilliseconds);

            //var dbScheudulerDeleteOldLogs = new Timer((e) =>
            //{
            //    DatabaseScheduler.DeleteOldLogs();
            //}, null, 0, (long)TimeSpan.FromMinutes(30).TotalMilliseconds);

            while (true)
            {
                var command = Console.ReadLine();
                if (command == "exit")
                {
                    Environment.Exit(0);
                }
            }
        }
Пример #13
0
 public void SetCategory(string newCategory)
 {
     if (categoriesMap.ContainsKey(newCategory)) {
         currentCategory = newCategory;
         hideAll ();
         currentManager = categoriesMap [newCategory];
         currentManager.reset ();
         currentManager.showCurrent ();
     }
 }
Пример #14
0
        public ManageList()
        {
            this.RequiresAuthentication();
            Get("/managelist", args =>
            {
                var model = new ManageListModel();


                var itemsInList = ItemListManager.GetFUTListItems();

                model.FutListItems = itemsInList;
                return(View["ManageList", model]);
            });

            Post("/resetpricecheck", args =>
            {
                var body       = new StreamReader(Request.Body).ReadToEnd();
                var parameters = HttpUtility.ParseQueryString(body);

                var databaseID = int.Parse(parameters["item"]);

                var itemsMatching = ItemListManager.GetFUTListItems().FirstOrDefault(x => x.ID == databaseID);
                if (itemsMatching != null)
                {
                    itemsMatching.LastPriceCheck = 0;
                    itemsMatching.PriceChecking  = false;
                    itemsMatching.SaveChanges();
                }

                var itemsMatchingNew = ItemListManager.GetFUTListItems().FirstOrDefault(x => x.ID == databaseID);
                var itemsJson        = JsonConvert.SerializeObject(itemsMatchingNew);

                return(itemsJson);
            });

            Post("/removeitemfromlist", args =>
            {
                var body       = new StreamReader(Request.Body).ReadToEnd();
                var parameters = HttpUtility.ParseQueryString(body);

                var databaseId = int.Parse(parameters["item"]);

                ItemListManager.RemoveFUTListItem(databaseId);

                return(Response.AsRedirect("/managelist"));
            });

            Post("/saveitem", args =>
            {
                var body       = new StreamReader(Request.Body).ReadToEnd();
                body           = HttpUtility.UrlDecode(body);
                var parameters = HttpUtility.ParseQueryString(body);


                var databaseId = int.Parse(parameters["itemDatabaseID"]);

                var item = ItemListManager.GetFUTListItems().FirstOrDefault(x => x.ID == databaseId);
                if (item != null)
                {
                    item.StaticBuyPercent   = int.Parse(parameters["staticBuyPercent"]);
                    item.VariableBuyPercent = int.Parse(parameters["variableBuyPercent"]);
                    item.BuyPercentStep     = int.Parse(parameters["buyPercentStep"]);
                    item.SellPercent        = int.Parse(parameters["sellPercent"]);
                    item.Counter            = int.Parse(parameters["counter"]);
                    item.BuyPrice           = int.Parse(parameters["buyPrice"]);
                    item.SellPrice          = int.Parse(parameters["sellPrice"]);
                    item.IgnorePriceCheck   = parameters["ignorePriceCheck"] != "false";
                    item.BuyItem            = parameters["buyItem"] != "false";
                    item.Discard            = parameters["discardItem"] != "false";
                    item.SaveChanges();
                }


                var itemJson = JsonConvert.SerializeObject(item);

                return(itemJson);
            });

            Post("/searchforitem", args =>
            {
                var body       = new StreamReader(Request.Body).ReadToEnd();
                var parameters = HttpUtility.ParseQueryString(body);

                var item = parameters["item"];

                var items = FUTItemManager.GetMatchingItems(item);

                var userFriendlyItems = items.Select(p => new UserFriendlyItemObject
                {
                    AssetID = p.id, Rating = p.r, Name = p.GetName(), RevisionID = p.RevisionID, Type = p.Type
                }).ToList();

                var itemsJson = JsonConvert.SerializeObject(userFriendlyItems);

                return(itemsJson);
            });

            Post("/additem", args =>
            {
                var body       = new StreamReader(Request.Body).ReadToEnd();
                var parameters = HttpUtility.ParseQueryString(body);

                var assetId   = int.Parse(parameters["addAssetID"]);
                var revId     = int.Parse(parameters["revID"]);
                var itemType  = int.Parse(parameters["itemType"]);
                var position  = parameters["pos"];
                var playStyle = (ChemistryStyle)int.Parse(parameters["playStyle"]);

                if (ItemListManager.ItemExistsInList(assetId, revId, position, playStyle))
                {
                    return(Response.AsRedirect("/managelist?error=1"));
                }

                var newPlayerObject = new FUTListItem(assetId)
                {
                    RevisionID         = revId,
                    Type               = (FUTSearchParameterType)itemType,
                    BuyPercentStep     = 0,
                    StaticBuyPercent   = FUTSettings.Instance.BuyPercent,
                    VariableBuyPercent = FUTSettings.Instance.BuyPercent,
                    SellPercent        = FUTSettings.Instance.SellPercent,
                    Counter            = 10,
                    BuyItem            = false,
                    IgnorePriceCheck   = true,
                    Position           = position,
                    ChemistryStyle     = playStyle
                };

                ItemListManager.InsertFUTListItem(newPlayerObject);

                return(Response.AsRedirect("/managelist"));
            });
        }
Пример #15
0
        public ItemStatistic()
        {
            this.RequiresAuthentication();
            Get("/itemstatistic", args =>
            {
                var model           = new ItemStatisticModel();
                model.ItemStatistic = new List <SimpleItemStatistic>();
                var listItems       = ItemListManager.GetFUTListItems();
                var allProfits      = FUTLogsDatabase.GetFUTProfitLogs();
                var allTpItems      = Fifa.Managers.BotManager.GetTradepileItems();

                foreach (var futListItem in listItems)
                {
                    var profits = new List <FUTItemProfit>();
                    var tpValue = 0;
                    if (futListItem.ChemistryStyle == ChemistryStyle.All && futListItem.Position == Position.Any)
                    {
                        profits = allProfits.Where(x => x.AssetID == futListItem.AssetID && x.RevisionID == futListItem.RevisionID).ToList();
                        tpValue =
                            (int)allTpItems.Where(
                                x =>
                                ResourceIDManager.GetAssetID(x.itemData.resourceId) == futListItem.AssetID &&
                                ResourceIDManager.GetRevID(x.itemData.resourceId) == futListItem.RevisionID)
                            .Sum(x => x.buyNowPrice * 0.95);
                    }
                    else if (futListItem.ChemistryStyle == ChemistryStyle.All && futListItem.Position != Position.Any)
                    {
                        profits = allProfits.Where(x => x.AssetID == futListItem.AssetID && x.RevisionID == futListItem.RevisionID && x.Position == futListItem.Position).ToList();
                        tpValue =
                            (int)allTpItems.Where(
                                x =>
                                ResourceIDManager.GetAssetID(x.itemData.resourceId) == futListItem.AssetID &&
                                ResourceIDManager.GetRevID(x.itemData.resourceId) == futListItem.RevisionID && x.itemData.preferredPosition == futListItem.Position)
                            .Sum(x => x.buyNowPrice * 0.95);
                    }
                    else if (futListItem.ChemistryStyle != ChemistryStyle.All && futListItem.Position == Position.Any)
                    {
                        profits = allProfits.Where(x => x.AssetID == futListItem.AssetID && x.RevisionID == futListItem.RevisionID && x.ChemistryStyle == futListItem.ChemistryStyle).ToList();
                        tpValue =
                            (int)allTpItems.Where(
                                x =>
                                ResourceIDManager.GetAssetID(x.itemData.resourceId) == futListItem.AssetID &&
                                ResourceIDManager.GetRevID(x.itemData.resourceId) == futListItem.RevisionID && x.itemData.playStyle == (int)futListItem.ChemistryStyle)
                            .Sum(x => x.buyNowPrice * 0.95);
                    }
                    else if (futListItem.ChemistryStyle != ChemistryStyle.All && futListItem.Position == Position.Any)
                    {
                        profits = allProfits.Where(x => x.AssetID == futListItem.AssetID && x.RevisionID == futListItem.RevisionID && x.ChemistryStyle == futListItem.ChemistryStyle && x.Position == futListItem.Position).ToList();
                        tpValue =
                            (int)allTpItems.Where(
                                x =>
                                ResourceIDManager.GetAssetID(x.itemData.resourceId) == futListItem.AssetID &&
                                ResourceIDManager.GetRevID(x.itemData.resourceId) == futListItem.RevisionID && x.itemData.playStyle == (int)futListItem.ChemistryStyle && x.itemData.preferredPosition == futListItem.Position)
                            .Sum(x => x.buyNowPrice * 0.95);
                    }

                    var statistic                  = new SimpleItemStatistic(profits);
                    statistic.TradepileValue       = tpValue;
                    statistic.ItemsLeftOnTradepile = profits.Count(x => x.SellTimestamp == 0);
                    statistic.Name                 = futListItem.DisplayName;
                    statistic.RevisionID           = futListItem.RevisionID;
                    statistic.AssetID              = futListItem.AssetID;
                    statistic.TotalSearched        = futListItem.TimesSearched + 1;
                    statistic.RPMProfit            = (int)(statistic.TotalProfit / (futListItem.TimesSearched + 1));

                    model.ItemStatistic.Add(statistic);
                }

                return(View["ItemStatistic", model]);
            });
        }