 ; FUNCION DRAG %1 %2 %3 %4 %5
 ; Descripcion: Arrastra un objeto de un origen a un destino
 ; %1 %2 : X e Y origen
 ; %3 %4 : X e Y destino
 ; %5    : Cantidad a mover
 ;         Caso especial: Si %5 = Simple, moveremos un objeto simple
                          Si %5 = All = $
;Leve modificacion para el lumberjack. Pa que si no puede soltar la madera, la 
; vuelva a poner ande estaba (se modifica lo del kizas?)

   set %dragout 0
 if %5 = ALL
   set %5 $
begindrag:
   click %1 %2 g
     if %5 = Simple
       {
         wait 4
         goto enddrag
       }
     dragwait: 
       set %dragout %dragout + 1
       if %dragout > 10
           {
              scanjournal 1
                if %msg_saveworld in #journal 
                   {
                     msg $/ %Finish_Read $
                     wait 24s
                   }
              call keepalive
             if %dragout > 30
                {
                   gosub recbolsa
;                  goto enddrag 
;kizas?
                  click %1 %2 p
                  exit
                }
           }
       wait 1
       if  GHRD <> #ContKind
         goto dragwait
    msg %5 $
;probando sin esto    wait 2
enddrag:
    click %3 %4 p
exit

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