Beispiel #1
0
        private void BuildFactoryItemIfNeeded(FactoryResource resource, IEnumerable <FactoryResource> factoryList)
        {
            var alwaysBuildItem = !new List <FactoryResource> {
                FactoryResource.Plastic, FactoryResource.Metal, FactoryResource.Wood, FactoryResource.Seeds
            }
            .Contains(resource);

            if (factoryList.Contains(resource))
            {
                log.Info("Picking up items");
                PickUpItems();
            }
            else
            {
                log.Info("Don't need to build " + resource.ToString());
            }

            if (alwaysBuildItem || factoryList.Contains(resource))
            {
                BuildingMatch buildingMatch = buildingSelector.SelectABuilding(", Trying to build " + resource.ToString());
                if (buildingMatch != null && buildingMatch.BuildingType == BuildingType.Factory)
                {
                    var button = GetResourceLocation(resource);
                    touch.Swipe(button, Bot.Location.FactoryQueuePositionStart, Bot.Location.FactoryQueuePositionend, 10, false);
                }
            }
        }
Beispiel #2
0
        private Bot.Location GetResourceLocation(FactoryResource resource)
        {
            switch (resource)
            {
            case FactoryResource.Metal: return(Bot.Location.ButtonLeftInner1);

            case FactoryResource.Wood: return(Bot.Location.ButtonLeftInner2);

            case FactoryResource.Plastic: return(Bot.Location.ButtonLeftInner3);

            case FactoryResource.Textiles: return(Bot.Location.ButtonLeftOuter1);

            case FactoryResource.SugarAndSpices: return(Bot.Location.ButtonLeftOuter2);

            case FactoryResource.Glass: return(Bot.Location.ButtonLeftOuter3);

            case FactoryResource.Seeds: return(Bot.Location.ButtonRightInner1);

            case FactoryResource.Minerals: return(Bot.Location.ButtonRightInner2);

            case FactoryResource.Chemicals: return(Bot.Location.ButtonRightInner3);
            }

            throw new Exception("Unknown factory resource location for " + resource.ToString());
        }
Beispiel #3
0
 void RunFactory()
 {
     StopAllDrops();
     StopResources();
     foreach (var res in resources)
     {
         FactoryResource fac_res = Instantiate(factoryRes, transform);
         fac_res.SetData(res.Key, res.Value[1] / 1000f, res.Value[0], this);
         resource_list.Add(fac_res);
     }
 }
Beispiel #4
0
 private void BuildAtAllL8Factories(FactoryResource resource)
 {
     BuildFactoryItem(resource);
     touch.ClickAt(Bot.Location.RightButton);
     BuildFactoryItem(resource);
     touch.ClickAt(Bot.Location.RightButton);
     BuildFactoryItem(resource);
     touch.ClickAt(Bot.Location.RightButton);
     BuildFactoryItem(resource);
     touch.ClickAt(Bot.Location.RightButton);
     BuildFactoryItem(resource);
     touch.ClickAt(Bot.Location.RightButton);
     BuildFactoryItem(resource);
 }
Beispiel #5
0
 private void BuildFactoryItem(FactoryResource resource)
 {
     BuildFactoryItemIfNeeded(resource, new List <FactoryResource> {
         resource
     });
 }