Results 1 to 7 of 7

Thread: Deposit()

  1. #1
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default Deposit()

    The function is:
    Code:
    (*
    Deposit
    ~~~~~~~
    
    .. code-block:: pascal
    
        Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
    
     Deposits from Slot to ToSlot.
      vType True = Deposit All. vType False = Deposit one by one.
      Any integer is deposit with Deposit X. (except for 5 and 10)
    
    .. note::
    
        Author: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
        Last Modified: Unknown
    
    Example:
    
    .. code-block:: pascal
    
        Deposit(1, 28, True);
    *)
    The problem was: I want to deposit the first 8 items, but beacause they are the same kind, I want to do it with deposit-x=8.
    Deposit(1,8,8)
    And it didnt work, it deposited them 1 by 1 plus spamming '8' in the chat 8 times.

    Here is my repaired version. Maybe its not the best but it works.
    The color is the horizontal line's color above the username.
    Simba Code:
    procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
    var
       DepositX, BScreen, DScreen: Boolean;
       All: Variant;
       I, T, x, y: Integer;
       B: TBox;
    begin
      BScreen := BankScreen;
      if (not(BScreen)) then
        DScreen := DepositScreen;
      if not (BScreen or DScreen) then
        Exit;
      if vType = 2 then
        srl_Warn('Deposit', '2 now means store per 2, not ''All''', 15);
      DepositX := False;
      if VariantIsInteger(vType) then
      begin
        DepositX := not InIntArray([1, 5, 10], vType);
        All := vType <> 1;
      end
      else if VariantIsBoolean(vType) then
        All := vType;
      if (SlotFrom = 1) and (SlotTo = 28) and (All = true) then
        if DepositAll then
          exit;
      for I := SlotFrom to SlotTo do
      begin
        if (BScreen) then
        begin
          If Not ExistsItem(I) Then
            Continue;
          if (not All) then
            MouseItem(I, mouse_left)
          else
            MouseItem(I, mouse_right);
        end else
        begin
          B := DepositItemBox(I);
          if (not(FindColor(X, Y, srl_outline_black, B.X1, B.Y1, B.X2, B.Y2))) then
            Continue;
          if (not All) then
            Mouse((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1, 0, 0, mouse_left)
          else
            Mouse((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1, 0, 0, mouse_right);
        end;
        if DepositX then
        begin
        //WaitOptionMulti(['Deposit-X', 'Deposit'], 200);
          WaitOptionMulti(['Deposit-X'], 200);
          T := GetSystemTime;
        //while (not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) and (GetSystemTime - T < 3000) do
          while (not FindColor(x, y, 6321792, MCX1, MCY1, MCX2, MCY2)) and (GetSystemTime - T < 3000) do
            Wait(100);
          Wait(RandomRange(800,1200));  //+line
          TypeSend(vType);
        end else if VariantIsInteger(vType) then
          WaitOptionMulti(['Deposit-' + IntToStr(Integer(vType)), 'Deposit'], 200)
        else
          if not WaitOptionMulti(['Deposit-All', 'All'], 200) then
            ChooseOptionMulti(['Deposit' , 'osit']);
        T := GetSystemTime;
        Wait(RandomRange(200, 300));
        repeat
          if (BScreen) then
            if (not(ExistsItem(I))) then Break;
          if (DScreen) then
            if (not(FindColor(X, Y, srl_outline_black, B.X1, B.Y1, B.X2, B.Y2))) then Break;
          Wait(50);
        until(GetSystemTime - T > 2000);
      end;
    end;

  2. #2
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

  3. #3
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Simba Code:
    Deposit(1,8,True)
    Should try and deposit all of item 1, then all of item 2, then 3... until out of items.

  4. #4
    Join Date
    Apr 2012
    Location
    Vancouver, BC
    Posts
    291
    Mentioned
    1 Post(s)
    Quoted
    84 Post(s)

    Default

    I tried this with a deposit box and it didnt work ... is there a different code for deposit chests vs banks?

  5. #5
    Join Date
    Sep 2012
    Location
    Australia.
    Posts
    839
    Mentioned
    16 Post(s)
    Quoted
    225 Post(s)

    Default

    Quote Originally Posted by digitalninja View Post
    I tried this with a deposit box and it didnt work ... is there a different code for deposit chests vs banks?
    Well, does your script actually open the deposit box? It should work (if the snippet works) if the deposit box is opened and it can see the screen, aslong as the deposit all and whatever other buttons there are.

  6. #6
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    Simba Code:
    Deposit(1,8,True)
    Should try and deposit all of item 1, then all of item 2, then 3... until out of items.
    I want it to click on the first slot and choose deposit-8. So it has to click on deposit-x and type 8.
    Code:
    Type True = Deposit All. vType False = Deposit one by one.
    Any integer is deposit with Deposit X. (except for 5 and 10)
    This is I have to use Deposit(1,8,8).
    Last edited by Shatterhand; 02-07-2013 at 08:17 AM.

  7. #7
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    If you want it to deposit slots 1-8 of the same item using deposit-8, then
    Code:
    deposit(1,1,8)
    should do exactly that.
    maybe it doesnt, but i assume it will do this.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •