Deposit plat in bank

Discussion in 'Macros' started by Remi, Feb 13, 2022.

  1. Remi

    Remi Orc Pawn

    Messages:
    44
    The purpose of this code is to deposit all of your plat in the bank.

    Save the following in the macro folder as bankmyplat.mac.

    Syntax:
    /ma bankmyplat banks all platinum.
    /ma bankmyplat 1000 banks 1000pp.

    Code:
    |#warning
    #turbo 80
    
    Sub Main(str ppQty)
        /declare i int outer
        |- Open windows / bags cleanup
        /cleanup
    
        |- Clear cursor
        /if (${Cursor.ID} && !${Me.FreeInventory}) {
          /bc [+r+]CANNOT CLEAR CURSOR. ABORTING.
          /return
        } else /autoinventory
    
        |- Target banker
        /tar banker radius 200
        /tar class banker radius 200
    
        |- Check for line of sight
        /if (!${Target.LineOfSight}) {
          /bc [+r+]I AM NOT IN LINE OF SIGHT OF A BANKER. ABORTING.
          /return
        }
    
        |- Check for available platinum
        /if (${Me.Platinum} == 0) {
          /bc [+r+]I HAVE NO MONEY TO DEPOSIT. ABORTING.
          /return
        }
    
        |- Check if banker is targeted
        /if (!${Target.ID}) {
          /bc [+r+]THERE IS NO BANKER AROUND ME. ABORTING.
          /return
        }
    
        :findBanker
        |- Move to banker
        /if (${Target.Distance} > 15) {
          /stick 15
          /delay 5
          /goto :findBanker
        }
    
        |- Open bank window
        /click right target
        /delay 5
    
        |- Ensure bank window is still open
        /if (!${Window[BigBankWnd].Open}) /goto :findBanker
    
        |- Convert coins to platinum
        /notify BigBankWnd BIGB_ChangeButton leftmouseup
    
        |- Report quantity of platinum
        /echo Platinum on me: ${Me.Platinum}
        /echo Platinum in the bank: ${Window[BigBankWnd].Child[BIGB_Money0].Text}
    
        |- Retrieve inventory platinum
        /notify inventorywindow IW_Money0 leftmouseup
        /if (${ppQty} != 0) {
          /shift /keypress delete chat
           /varset i 0
           /for i 1 to ${ppQty.Length}
               /nomod /keypress ${ppQty.Mid[${i},1]} chat
               /delay 3
           /next i
        }
        /delay 5
    
        |- Confirm platinum amount
        /notify quantitywnd QTYW_Accept_Button leftmouseup
        /delay 5
    
        |- Deposit platinum into bank
        /notify BigBankWnd BIGB_AutoButton leftmouseup
        /delay 5
    
        |- Close bank window
        /notify BigBankWnd BIGB_DoneButton leftmouseup
    
        |- Report quantity of platinum
        /bc Platinum on me: ${Me.Platinum}
        /bc Platinum in the bank: ${Window[BigBankWnd].Child[BIGB_Money0].Text}
    /return
    
     
    Last edited: Feb 4, 2023
    • Like Like x 2
  2. slith

    slith Orc Pawn

    Messages:
    12
    nice, window manipulation drives me nuts.
     
  3. Skream

    Skream Orc Legionnaire

    Messages:
    133
    Doesn't work in Guidhall (which was the primary ask).

    Says banker is not in Line of Sight even if you are right next to it.

    The !${Spawn[banker].LineOfSight} returns Null there but not in the Guild Lobby.

    EDIT - Also a /bcaa doesn't seem to get it working on all bots. Just a random sample. That's me running 36 btw.
     
    Last edited: Feb 15, 2022
  4. Remi

    Remi Orc Pawn

    Messages:
    44
    Updated to work with any banker and allow control for the amount to deposit.
     
    Last edited: May 16, 2022
  5. Remi

    Remi Orc Pawn

    Messages:
    44
    Updated to fix keypress error
     
  6. chance

    chance Enraged War Boar

    Messages:
    732