 call recbolsa

for %i 1 10
 {
                   call keepalive
   msg $bank Guards$
   wait 3s
;el banco es tipo IKF
   if IKF = #CONTTYPE
     goto black_salgo  
;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:
 set %mibanco #CONTID
  set #contposx 438
  set #contposy 309

;Guardamos
;El oro
set #findmod 21_13
gosub guardamos POF 479 467

;Movemos el pico
; Para que no interfiera en el movimiento de lingotes y ores
;Aki puede haber problemas con algunos picos
;set #findmod 8_7
;gosub guardamos %t_pico 721 267

;Los botes y ganzuas del tinker
set #findmod 19_13
gosub guardamos WUF 479 467
set #findmod 22_4
gosub guardamos NWH 479 467


;Los lingotes
set #findmod 30_10
gosub guardamos %t_lingote 580 465

;Los minerales
set #findmod 27_17
gosub guardamos  DWJ_EWJ_GWJ 578 426
set #findmod 16_13
gosub guardamos  TVJ 578 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
wait 5 

if #findkind = -1
   goto acabo

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

if #findx < 635
    {    
      ignoreitem #FINDID
      goto newguard
    }
if %a1 = POF
  {
     if #findstack < 9
          {
           msg $ es POF < 9 $
            ignoreitem #FINDID
            goto newguard
         }
  }

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

    if %mochilapr = #CONTID
      {
       set #contposx 610
       set #contposy 360
      }
    if %bolsa2 = #CONTID
      {
       set #contposx 611
       set #contposy 160               
      }
 if  %mibanco = #CONTID
     {
       set #contposx 438
       set #contposy 309
     }
goto newguard
acabo:
return



