Código:
; | / \ | .
; _ -O- . ) (( )) ( -O-
; (@) | + /|\ ))_(( /|\ | .
; |-| / | \ (/\|/\) / | \ (@)
; | | --------------------------/--|-voV---\`|'/--Vov-|--\---------------------------|-| .
; |-| '^` (o o) '^` | |
; | | `\Y/' |-|
; |-| _______ __ __ __ _______ __ __ | |
; | | | | | | |_|__|.--------.---.-.| _ | |__|.---.-.-----.-----.---.-. |-| . o
; |-| | | | | _| || | _ || | | || _ | |-- __| _ | | |
; | | |_______|__|____|__||__|__|__|___._||___|___|__|__||___._|__|__|_____|___._| |-|
; |_|________________________________________________________________________________| |
; (@) l /\ / ( ( \ /\ l `\|-| .
; o l / V \ \ V \ l + (@)
; l/ _) )_ \I +
; + `\ /'
;
; Script Name: Archery con Golem
;
; |
; \.
; /|.
; / `|.
; / |.
; / |.
; / `|.
; / |.
; / |.
; / |.
; __ / `|.
; -\ / |.
; \\ / |.
; \\ / |.
; \| / |\
; \#####\ / ||
; ==###########> / ||
; \##== \ / ||
; ______ = =|__/___ ||
; ,--' ,----`-,__ ___/' --,-`-==============================##==========>
; \ ' ##_______ ______ ______,--,____,=##,__
; `, __== ___,-,__,--'#' ===' `-' | ##,-/
; `-,____,---' \####\ | ____,--\_##,/
; #_ |## \ _____,---==,__,---' ##
; # ]===--==\ ||
; #, ] \ ||
; #_ | \ ||
; ##_ __/' \ ||
; ####=' | \ |/
; ### | \ |.
; ## _' \ |.
; ###=======] \ |.
; /// | \ ,|.
; // | \ |.
; \ ,|.
; \ |.
; \ |.
; \|.
; /.
; |
; Author: Sthil Lauda
; Version: 2.10
; Client Tested with: 2.0.3
; EUO version tested with: 1.5 Version 142
; Shard OSI / FS: Ultima Alianza ¡Hasta la muerte!
; Revision Date: 25/03/2019
; Public Release: 15/07/2019
; Purpose: Lanza flechas a un Golem para entrenar la skill de Archery. Recoge las flechas del Golem automáticamente ^^
set %version 2.10
;________________________________
;
; ///////////////////////////////
; ************** CONFIGURACIÓN **************
; ///////////////////////////////
;________________________________
;
set %lote_flechas 100 ; Número de flechas a gastar en cada ronda.
set %tiempo_attack 3 ; En segundos, cada cuánto ordenar el ataque al Golem.
set %tiempo_alimentacion 360 ; En segundos, cada cuanto recoger flechas del suelo y comer (5 minutos).
;________________________________________________
;
; //////////////////////////////////////////////
; ************************* FIN CONFIGURACIÓN *************************
; //////////////////////////////////////////////
;________________________________________________
;
set %arcos TOH_WOH_MMH_LMH_USF_JSF
set %flechas RWF
set %golems YAB
set %comida RGG_NRD_QSD_ZBG_WLI_QRD_END_FUD_YLI_WLI_HGI
+_KGI_EGI_QLI_KLI_MLI_KRD_HQD_AQD_MQE_VQE_TQE_JQE_IQE
+_GQE_SPE_ZPE_OQE_BDF_KPE_RQE_YSD_SQD_AXI_PQD_QQD
set %proxima_vez_comer #SCNT
set %proxima_vez_attack #SCNT
set %_worldsavejournalindex #jindex ; Journal para escanear en busca de save's del server.
set *CEOWorldSaving #FALSE ; Indica si hay un save del server en marcha.
initevents
set #SYSMSGCOL 88
event sysmessage ====================
set #SYSMSGCOL 53
event sysmessage Archery Golem %version
set #SYSMSGCOL 88
event sysmessage ====================
wait 40
gosub setupGolem
gosub setupCofre
;========================================================
;
; ************************************* LOOP PRINCIPAL **************************************
;
;========================================================
;----------------------------------------------------------------------------------------
loop: ;
gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 ;
gosub checkSkill ;
gosub recogerFlechas ;
gosub reponerFlechas ;
gosub comprobarArco ;
gosub atacarGolem ;
goto loop ;
;----------------------------------------------------------------------------------------
;========================================================
;
; ******************************** FIN LOOP PRINCIPAL ************************************
;
;========================================================
sub setupCofre ;<=====================================================>
display OK Haz click en el Cofre que contiene las flechas $$
+ ¡Debes estar cerca de él para abrirlo y cogerlas!.
set #TARGCURS 1
target
while #TARGCURS = 1
{
wait 1
}
set %cofre #LTARGETID ; La ID del cofre donde tienes las flechas.
set #SYSMSGCOL 73
event sysmessage ID Cofre: %cofre
wait 20
set #LOBJECTID %cofre
event macro 17
gosub wait_for GUMP %cofre 30
return
sub checkSkill ;<=====================================================>
chooseskill Arch real ; Comprobar GM
if #SKILL >= 1000
{
set #SYSMSGCOL 19
event sysmessage ¡Somos GM Archery! :)
halt
}
return
sub comprobarArco ;<=====================================================>
_arco:
finditem %arcos C_ , #CHARID ; Reponer el arco roto.
if #FINDCNT < 1
{
finditem %arcos C_ , #BACKPACKID
if #FINDCNT > 0
{
set #LOBJECTID #FINDID
event macro 17
wait 20
goto _arco
}
else
{
set #SYSMSGCOL 39
event sysmessage NO QUEDA NINGUN ARCO!
halt
}
}
return
sub recogerFlechas ;<=====================================================>
set %tiempo_actual #SCNT ; Reloj
if %proxima_vez_comer <= %tiempo_actual
{
event macro 1 0 all drop ; Recuperar flechas ^^
wait 40
_recoge:
finditem %flechas G_4 ; Máxima distancia a la que podemos recoger algo.
if #FINDCNT > 0
{
event sysmessage Recogiendo del suelo...
wait 20
exevent drag #FINDID #FINDSTACK
exevent dropc %cofre
wait 30
goto _recoge
}
gosub comprobar_comida ; Alimentación.
}
return
sub reponerFlechas ;<=====================================================>
set %total_flechas 0
finditem %flechas C_ , #BACKPACKID
if #FINDCNT > 0
{
for #FINDINDEX 1 #FINDCNT ; Sumar todos los stack's de flechas
{
set %total_flechas %total_flechas + #FINDSTACK
}
}
if %total_flechas <= 10 ; Mínimo de flechas en la mochila antes de reponer más.
{
event sysmessage Reponiendo flechas...
wait 20
finditem %flechas C_ , %cofre ; Reponer flechas del cofre
if #FINDSTACK => %lote_flechas
{
exevent drag #FINDID %lote_flechas
exevent dropc #BACKPACKID
wait 30
}
else
{
set #SYSMSGCOL 39
event sysmessage NO QUEDAN SUFICIENTES FLECHAS!
halt
}
}
return
sub atacarGolem ;<=====================================================>
if %proxima_vez_attack <= %tiempo_actual ; Seleccionar y atacar al Golem cada X tiempo.
{
finditem %golem_id
if #FINDCNT > 0 ; Hemos encontrado el Golem
{
set #LTARGETID %golem_id
event macro 27 ; ¡ Attack Last !
set %proxima_vez_attack %tiempo_actual + %tiempo_attack
}
}
return
sub setupGolem ;<=====================================================>
_ClickGolem:
finditem %golems
if #FINDCNT > 0
{
if #FINDCNT > 1 ; Hay más de 1 Golem en la ZONA - [ Modo manual ]
{
display OK Selecciona el Golem con el que quieres macrear
set #TARGCURS 1
target
while #TARGCURS = 1
{
wait 1
}
set %golem_id #LTARGETID
finditem %golem_id ; Comprobar si es un Golem o es otra cosa... XD
if #FINDCNT > 0
{
if %golems NotIn #FINDTYPE
{
set #SYSMSGCOL 39
event sysmessage ESTO NO PARECE SER UN GOLEM!
wait 20
goto _ClickGolem
}
else ; OK, parece un Golem: Sacamos su nombre...
{
set #SYSMSGCOL 73
gosub GetName %golem_id nombre_golem
event sysmessage OK GOLEM: %nombre_golem
wait 40
}
}
}
else ; Sólo vemos 1 Golem en la ZONA - [ Modo automático ]
{
if #FINDCNT = 1
{
set %golem_id #FINDID
}
}
}
else
{
set #SYSMSGCOL 39
event sysmessage NO HAY GOLEMS EN LA ZONA!
halt
}
return
;=====================================================
; Rutina para, en caso de hambre, comer hasta saciarse
;=====================================================
; v2.2
sub comprobar_comida
{
hambriento:
set %jrnl #jindex ; Marcamos un índice de las líneas del diario.
event macro 4 0 .hungry
wait 20
while #true
{
if #jindex > %jrnl ; Si aparece una nueva línea.
{
set %jrnl %jrnl + 1 ; Seleccionamos ese numero de línea.
scanjournal %jrnl ; La leemos...
if Estas_no_le_afecta_el_hambre in #journal || Estas_tan_lleno_que_no_puedes in #journal || Estas_totalmente_saciado in #journal
{
set %proxima_vez_comer %tiempo_actual + %tiempo_alimentacion
return
}
else
{
if Estas_lleno in #journal || Estas_contento in #journal || Estas_en_inanicion in #journal || Estas_hambriento in #journal || Sientes_mucho in #journal || Estas_con_hambre in #journal || Estas_parcialmente in #journal || Estas_bien_lleno in #journal || Te_sientes_casi_lleno in #journal
{
comer:
finditem %comida C_ , #backpackid
if #findcnt > 0
{
set #lobjectid #findid
event macro 17
wait 20
goto hambriento
}
else ; No hay comida en la mochila...
{
finditem %comida C_ , %cofre
if #findcnt > 0
{
exevent drag #findid 1
exevent dropc #BACKPACKID
wait 30
goto comer
}
else ; Y tampoco en el cofre...
{
event exmsg #CHARID 3 48 COMPRA COMIDA!! :-(
wait 40
set %proxima_vez %tiempo_actual + %tiempo_alimentacion
return
}
}
}
else ; Mensaje extraño, repetimos...
{
goto hambriento
}
}
}
return
} ; FIN While
}
return
;-@ ============================== @-;
;-@ ############################## @-;
;-@ SUBS públicos del Foro EasyUO @-;
;-@ ############################## @-;
;-@ ============================== @-;
;
;-----------------------------------------------------------
; Script Name: CEOWorldSaveChecker
; Author: CEO
; Version: 1.0
; Client Tested with: 4.0.10b
; EUO version tested with: 1.42.00A5
; Shard OSI / FS: OSI
; Revision Date: 060105
; Public Release: 060105
; Global Variables Used: *CEOWorldSaving
; Purpose: Used to catch the world save message for freeshards and temporarily pause mainscript during save.
;-------------------------------------------------------------
sub CEOWorldSaveChecker
; sub to pause a script during a RunUO world save.
set %_text1 %1
set %_text2 %2
set %_text3 %3
if %_worldsaveupcoming
{
if %_worldsavetimer < #scnt
{
set %_worldsavetimer #scnt + %5
gosub popupworldsave 25 15 blue
goto _WSC_WAIT1
}
return
}
_WSC1:
if %_worldsavejournalindex > #jindex
return
scanjournal %_worldsavejournalindex
if %_text1 in #JOURNAL
{
set %_worldsaveupcoming #true
set %_worldsavetimer #scnt + %4
set %_worldsavejournalindex %_worldsavejournalindex + 1
return
}
set %_worldsavejournalindex %_worldsavejournalindex + 1
goto _WSC1
_WSC_WAIT1:
if %_worldsavetimer < #scnt
goto _WSC_Complete
wait 5
set *CEOWorldSaving #true
if %_worldsavejournalindex > #jindex
goto _WSC_WAIT1
scanjournal %_worldsavejournalindex
if %_text2 in #journal
{
gosub popupworldsave 25 15 yellow
set %_worldsavejournalindex %_worldsavejournalindex + 1
goto _WSC_WAIT2
}
set %_worldsavejournalindex %_worldsavejournalindex + 1
goto _WSC_WAIT1
_WSC_WAIT2:
if %_worldsavetimer < #scnt
goto _WSC_Complete
wait 5
if %_worldsavejournalindex > #jindex
goto _WSC_WAIT2
scanjournal %_worldsavejournalindex
if %_text3 notin #journal
{
set %_worldsavejournalindex %_worldsavejournalindex + 1
goto _WSC_WAIT2
}
_WSC_Complete:
set %_worldsavejournalindex #jindex
set %_worldsaveupcoming #false
set *CEOWorldSaving #false
menu delete worldsave
return
sub popupworldsave
set %x %1
set %y %2
set %worldcolor %3
menu Clear
menu Window Title World Save Monitor
menu Window Color Black
menu Window Size 160 160
menu shape worldsave 20 15 125 125 1 7 2 olive 7 %worldcolor
menu font bgcolor %worldcolor
menu font color lime
menu font type b
menu font size 15
set %x %x + 30
set %y %y + 30
menu text worldsave %x %y World
set %x %x + 15
set %y %y + 20
menu text worldsave %x %y Save
set %x %x + 15
set %y %y + 20
menu text worldsave %x %y Wait
menu font size 9
menu font bgcolor black
menu font color lime
menu font type n
menu Show 920 770
return
;**
;* @name GetName
;* @author Roadkill
;* @ver 1.0 24Jan04
;* @purpose get the name of a creature/vendor
;* @params %1= the id of the thing whose name you want, required
;* @%2= variable name to return the ID in, required
;* @returns @%2 and #result
;* @changes #property, #strres, @%2, !strlength
;* @example call rksubs.txt GetName %beetle beetlename
;* @status: tested
sub GetName
finditem %1
if #findkind = -1
return error-cant_find
event property #findid
str pos #property $
set !strlength #strres - 2
str left #property !strlength
set %string #strres
str Del %string 1 1
set % . %2 #strres
return % . %2
;=================================================================
sub wait_for
;=================================================================
; This "wait_for" sub package was created by Locke. If you use these subs please keep this header intact.
; Documentation: the sub package grew to large with all the comments. To load them call the sub like this:
; gosub wait_for docs | or you can use doc, documention, what, or my personal favorite, kickass.
; "wait_for core dispatcher" version 1.2 by Locke
if %1 = doc || if %1 = docs || if %1 = documentation || if %1 = what || if %1 = kickass
{
Display ok Please click ok and wait for your browser to start.
execute http://www.easyuo.com/forum/viewtopic.php?t=24716
halt
}
nameSpace Push
namespace local LLNS
set #result N/A ; if #result isn't set by one of my wait_for subs it'll throw an error.
set !LPC #lpc
set #lpc 200
for %i 0 %0
set !_A . %i % . %i
gosub wait_for_ , !_A1
set #lpc !lpc
namespace clear LLNS
namespace pop
if #result <> N/A
return #result
else
display ok You specified an unknown wait_for command. Script returned #result and is halting.
halt
;======================================================================
sub wait_for_GUMP ; version 1.4 ~Locke
;=================================================================
; Añadido #CONTID ^^
if !_A0 < 3
{
display ok You haven't specified enough vars.$
+The basic format is: gosub wait_for GUMP XXX_YYY time_out_in_seconds$
+Script is halting
halt
}
if !_A3 <> CLOSE
set !_timeout #scnt2 + !_A3
else
set !_timeout 0 ; no gump wait if %3 = CLOSE since we already believe it to be open.
_lets_wait_for_a_gump:
if #CONTSIZE = !_A2 || #CONTKIND = !_A2 || #CONTNAME = !_A2 || #CONTTYPE = !_A2 || #CONTID = !_A2
{
if !_A5 <> N/A && !_A6 <> N/A
{
set !clickx !_A5 + #contposx
set !clicky !_A6 + #contposy
click !clickx !clicky
}
if !_A3 = CLOSE || if !_A4 = CLOSE || !_A5 = CLOSE || !_A6 = CLOSE
{
set !string #contsize
str pos !string _
set !pos #strres
str del !string #strres #strres
set !clickX #contposx + ( #strres / 2 )
str del !string 1 !pos
set !clickY #contposy + ( #strres / 2 )
click !clickx !clicky R
}
return #true
}
if ( !_timeout =< #scnt2 ) && ( !_A4 = N/A )
{
return #false
}
if !_A4 <> N/A && !_timeout =< #scnt2
{
finditem !_A4
if #findkind <> -1
{
for #findindex 1 #findcnt
{
if #finddist > 2
ignoreitem #findid LLWAITFOR
else
break
}
set #lobjectid #findid
event macro 17 0
set !_timeout #scnt2 + !_A3
}
else
return #false
}
wait 1
goto _lets_wait_for_a_gump
Saludos,