예제 #1
0
 public Inventory(RSClient rsClient, Keyboard keyboard, GameScreen screen)
 {
     RSClient    = rsClient;
     Keyboard    = keyboard;
     Screen      = screen;
     RNG         = new Random();
     SelectedTab = TabSelect.Unknown;
     EmptySlots  = new bool[INVENTORY_COLUMNS, INVENTORY_ROWS];
 }
예제 #2
0
        }                                                                               //ex 0.001045

        #endregion

        #region constructors

        internal Banking(GameScreen screen, Vision vision, HandEye handEye, RSClient client, Keyboard keyboard, Inventory inventory, MinimapGauge minimap)
        {
            Screen    = screen;
            Vision    = vision;
            HandEye   = handEye;
            RSClient  = client;
            Keyboard  = keyboard;
            Inventory = inventory;
            Minimap   = minimap;

            PossibleBankTypes = new List <BankLocator>();
            PossibleBankTypes.Add(LocateBankBoothVarrock);
            PossibleBankTypes.Add(LocateBankBoothSeersVillage);
            PossibleBankTypes.Add(LocateBankBoothPhasmatys);
            PossibleBankTypes.Add(LocateBankBoothEdgeville);
            Bank.ResetNAmount();
        }
예제 #3
0
        /// <summary>
        /// Handles rotation cycles among the three bots
        /// </summary>
        protected override void ManageBot()
        {
            int timeToRun;

            while (!StopFlag)
            {
                if (!NextBot())
                {
                    return;
                }

                timeToRun = RandomWorkTime();
                CurrentRunParams.RunUntil = DateTime.Now.AddMilliseconds(timeToRun);

                //Don't actually run a bot without login info
                if (string.IsNullOrEmpty(CurrentRunParams.Login) || string.IsNullOrEmpty(CurrentRunParams.Password))
                {
                    CurrentRunParams.ActiveBot.BotState = BotState.Running;
                    CurrentRunParams.SetNewState(timeToRun);
                    CurrentRunParams.BotIdle = true;
                    SafeWait(timeToRun);
                    CurrentRunParams.BotIdle = false;
                }
                else
                {
                    CurrentBot.Start();
                    SafeWait(timeToRun);
                    while (!CurrentBot.BotIsDone)
                    {
                        SafeWait(LOGOUT_CHECK_INTERVAL);
                    }
                }

                if (!StopFlag)
                {
                    RSClient.PrepareClient(true);    //restart the client to get a random new world
                }
            }
        }
예제 #4
0
        /// <summary>
        /// Initializes a bot program with a client matching startParams
        /// </summary>
        /// <param name="startParams">specifies how to run the bot</param>
        protected BotProgram(RunParams startParams)
        {
            RunParams                       = startParams;
            RunParams.ClientType            = ScreenScraper.Client.Jagex;
            RunParams.DefaultCameraPosition = RunParams.CameraPosition.NorthAerial;
            RunParams.LoginWorld            = 0;

            RSClient = new RSClient(RunParams);
            Screen   = new GameScreen(RSClient, RunParams);
            RSClient.AddScreen(Screen);

            Vision         = new Vision(Screen, RunParams);
            Keyboard       = new Keyboard(RSClient);
            Mouse.RSClient = RSClient;
            HandEye        = new HandEye(Vision, Screen);
            Inventory      = new Inventory(RSClient, Keyboard, Screen);
            Minimap        = new MinimapGauge(RSClient, Keyboard, Screen);
            Textbox        = new TextBoxTool(RSClient, Keyboard, Screen);
            Banking        = new Banking(Screen, Vision, HandEye, RSClient, Keyboard, Inventory, Minimap);
            Conversation   = new Conversation(Textbox, Screen, RunParams.Conversation);

            RNG = new Random();
        }
예제 #5
0
 public TextBoxTool(RSClient rsClient, Keyboard keyboard, GameScreen screen)
 {
     RSClient = rsClient;
     Keyboard = keyboard;
     Screen   = screen;
 }
예제 #6
0
 public GameScreen(RSClient client, RunParams runParams)
 {
     RSClient  = client;
     RunParams = runParams;
 }
예제 #7
0
 public MinimapGauge(RSClient rsClient, Keyboard keyboard, GameScreen screen)
 {
     RSClient = rsClient;
     Keyboard = keyboard;
     Screen   = screen;
 }