
for %i 1 5
 {
                   call keepalive
   msg $bank$
;el banco es tipo IKF
   for %contador 1 100
    {
     if IKF = #CONTTYPE
        goto black_salgo  
     wait 1
     ;Se esta haciendo un savegame
     if WRDSV_A_EN in #SYSMSG
        wait 20s

    }
  }
;No pudimos abrir el banco. Salimos sin soltar nada
exit 

;Tenemos el banco abierto
black_salgo:
 ContPos 438 309
 set %mibanco #CONTID

;Guardamos
;El oro
gosub guardamos POF 479 467
;Los Tickets
gosub guardamos HVF 479 467

;Los botes y ganzuas del tinker
gosub guardamos WUF_NWH 479 467


;Los lingotes
gosub guardamos %t_lingote 577 459

;Los minerales.
gosub guardamos %t_ores 577 426


wait 1s
exit


sub guardamos
ignoreitem reset
; Bug al usar las mismas variables %1 %2 %3, se sobreescribian
set %a1 %1
set %a2 %2
set %a3 %3
newguard:
                   call keepalive
finditem %a1
if #findkind = -1
   goto acabo

if #findkind > 0 
 {
  ignoreitem #FINDID
  goto newguard
 }

;Si no esta en la mochila principal no lo guardamos
if #findbagid <> %mochilapr 
 {
if #findbagid <> %bolsa2
  {
    ignoreitem #FINDID
     goto newguard
   }
 }
;if #findx < 635
;    {    
;      ignoreitem #FINDID
;      goto newguard
;    }

if #findstack = 1
   call drag #FINDID %a2 %a3 Simple
if #findstack > 1
   call drag #FINDID %a2 %a3 ALL

goto newguard
acabo:
return


