Пример #1
0
        public void Mailer()
        {
            Log(Time() + "[ Starting the Mail Process ]");
            gps = new Gps(this);
            gps.LoadDataBase(Application.StartupPath + _gpsfile);
            Log(Time() + "INFO: Moving to Mailbox");
            gps.GpsMove("Mail");
            List <Item> mailitems = new List <Item>();
            {
                List <Item> Inventory = getInvItems(_plant);
                foreach (Item item in Inventory)
                {
                    if (mailitems.Count <= 8)
                    {
                        break;
                    }
                    mailitems.Add(item);
                }
            }
            var mailcount = itemCount(_plant);

            if (mailcount >= _amtmail)
            {
                Log(Time() + "INFO: Sending " + _plant + " to " + _mailto);
                SendMail(_mailto, _mailsub, _mailtext, _fastmail, 0, mailitems);
            }
            else
            {
                Log(Time() + "[ Mail Processes Finished ]");
            }
        }
Пример #2
0
 public void MoveToSafe()
 {
     gps = new Gps(this);
     Log(Time() + "Loading GPS File");
     gps.LoadDataBase(Application.StartupPath + _gpsfile);
     if (_enabledoor == true)
     {
         Log(Time() + "We need to Open / Close the Door");
         gps.GpsMove("Door0");
         // Time to Open the Door
         DoodadObject doors = getNearestDoodad("Door");
         Log(Time() + "INFO: " + string.Format("Name: {0} - ID: {1}", doors.name, doors.phaseId));
         if (doors != null && ComeTo(doors, 2))
         {
             if (doors.phaseId == 11163)
             {
                 UseDoodadSkill(16828, doors);
                 Thread.Sleep(1000);
                 gps.GpsMove("Door1");
             }
             else
             {
                 gps.GpsMove("Door1");
             }
             // Time to Close the Door
             if (doors.phaseId == 11165)
             {
                 UseDoodadSkill(16828, doors);
                 Thread.Sleep(1000);
             }
         }
         //
         Log(Time() + "Moving to Safe");
         gps.GpsMove("Safe");
         Log(Time() + "Safe Spot has been Reached");
         if (_enablerest == true)
         {
             Relax();
             Log(Time() + "Rest Time");
         }
     }
     else
     {
         Log(Time() + "INFO: _enabledoor Set to False");
     }
 }
Пример #3
0
        // Utility Stuff
        public void BuySeeds()
        {
            while (true)
            {
                var _mygold   = me.goldCount;
                var seedcount = itemCount(_seed);
                if (_mygold <= _mingold)
                {
                    Log(Time() + "INFO: Unable to Purchase due to lack of funds");
                    break;
                }
                else
                {
                    Log(Time() + "Lets go buy seeds");
                    gps = new Gps(this);
                    gps.LoadDataBase(Application.StartupPath + _gpsfile);
                    gps.GpsMove("Seed");
                    SetTarget(_buyvendor);
                    Log(Time() + "Seed Stock: " + seedcount);
                    if (seedcount <= _minseed && seedcount <= _maxseed)
                    {
                        BuyItems(_seed, _buyseedamt);
                        var seedcount2 = itemCount(_seed);
                        Log(Time() + "Updated Seed Cound: " + seedcount2);

                        var mseconds = random.Next(2000, 5000);
                        var seconds  = mseconds / 1000;
                        Log(Time() + "Checking seed stock");
                        Thread.Sleep(mseconds);
                    }
                    else
                    {
                        Log(Time() + "[ Seed Purchase Completed ]");
                        break;
                    }
                }
            }
        }
Пример #4
0
        public bool GpsMove(string name, int moveRetry = 3)
        {
            if (!host.farmModule.readyToActions)
            {
                return(false);
            }
            var oldState = host.farmModule.farmState;

            if (!forceGpsMove)
            {
                host.farmModule.SetFarmAggros();
            }
            gpsMoveEnabled = true;
            bool result = gps.GpsMove(name);

            gpsMoveEnabled = false;
            if (!forceGpsMove)
            {
                host.farmModule.farmState = oldState;
            }
            if (!result)
            {
                Console.WriteLine("GPS MOVE FAIL");
                Console.WriteLine(host.GetLastError());
                if (moveRetry > 0)
                {
                    moveRetry--;
                    return(GpsMove(name, moveRetry));
                }
                else
                {
                    Console.WriteLine("MOVE RETRY = 0. WE STUCK. WE NEED UNSTUCK?");
                }
            }
            return(result);
        }