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]; }
} //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(); }
/// <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 } } }
/// <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(); }
public TextBoxTool(RSClient rsClient, Keyboard keyboard, GameScreen screen) { RSClient = rsClient; Keyboard = keyboard; Screen = screen; }
public GameScreen(RSClient client, RunParams runParams) { RSClient = client; RunParams = runParams; }
public MinimapGauge(RSClient rsClient, Keyboard keyboard, GameScreen screen) { RSClient = rsClient; Keyboard = keyboard; Screen = screen; }