; INICIALIZACION DEL SISTEMA
set %stand_alone 0 

;Tipos de objeto. Cogemos un arma de sword
; He metido varios tipos por si acaso.
set %t_hacha FSF_ROH_NSF_MPH_LSF_BSF_ZRF_JOH_KTF

; tipo del runebook
set %t_runebook MPF
; color del runebook
set %c_runebook 0x455
set %t_mochila  ZJF_CKF
set %t_bolsa      ZJF_CKF
set %t_log         ZLK
set %t_tronco    ZLK

;Reagentes
set %T_bloodmoss  JUF
set %T_blackpearl   KUF
set %T_mandrake   MZF

set %Finish_Read     _____________________
set %msg_saveworld WORLD_SAVE_HAS_BEEN_INITIATED

;Temporal, pasamos de dirx 2 a dirx 1. A ver si mejoramos el rendimiento
set %dirx %Pasos
set %diry -6


;Primer pico 2317 1215
;   x1<x2 y1>y2
;segundo 2335 1199

princespera:
                   call keepalive
 key %OpenBackpack
 wait 2s
 if OZOC <> #ContKind
   goto princespera
 contpos 610 360
set %mochilapr #Contid
;Apuntando bolsa de regs
if %TiraLogs <> SI
 {
   call apuntar %t_mochila -1
;Pa evitar kedarnos en este bucle
   if %1 = -1
     goto pasosinmochila
   buclebregs:
     key %LastObject
     wait 2s
     if OZOC <> #ContKind
        goto buclebregs
     if #ContID = %mochilapr
        goto buclebregs
     contpos 613 160
     set %bolsa2 #Contid
 }
 pasosinmochila:  


;Buscando el libro de runas
call apuntar %t_runebook %c_runebook
if %TiraLogs <> SI
 {
   if %1 = -1
       {
        msg $/ Error fatal! No encontre el RuneBook!$
        halt         
       }              
  set %MiRuneBook #LObjectId
 }

msg $; Acuerdate de llevar el hacha en la mochila!$
wait 9
msg $; De don't move cursor, del circle of transp!$
wait 9
msg $; de Status, y si puedes lleva un log en la mochila$
wait 9
msg $/ SISTEMA PREPARADO, PULSA CTRL+V PARA SEGUIR$

;Si pasan nueve segundos, intentariamos comenzar de todos modos
for %i 1 180
 {
   onhotkey V Ctrl
      goto takehacha
  wait 1
 }
takehacha:

call apuntar %t_hacha -1
if %1 = -1
  {
    msg $UPS no encuentro ningun hacha!!!$
    halt
   }
set %mihacha #LObjectId
