                   call keepalive
 if %mochilapr = #Contid
      {
      if #contposx = 16
           {
            if #contposy = 16
               {
                  click 21 21 d
                  wait 2s
               }
           }
      contpos 610 360
      }

 black_banco:
   msg $bank$
   wait 1s
;el banco es ozoc
  if OZOC = #CONTKIND
    {
       if %mochilapr = #CONTID
           goto black_banco
       goto black_salgo  
   }

  goto black_banco
black_salgo:
 set %mibanco #CONTID
  set #contposx 438
  set #contposy 309

;Guardamos
;Los troncos
set #findmod 19_4 
gosub guardamos %T_log 477 466
wait 1s
exit


sub guardamos
ignoreitem reset
; Bug al usar las mismas variables %1 %2 %3, se sobreescribian. Arreglao
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  %mibanco = #CONTID
     {
       set #contposx 438
       set #contposy 309
     }
goto newguard
acabo:
return



