; ====================================================================================================== ; '|| ||` '||` || /.\ '||` ; || || || || '' // \\ || '' ; || || || ''||'' || '||),,(|, '''|. //...\\ || || '''|. `||''|, '''/ '''|. ; || || || || || || || || .|''|| // \\ || || .|''|| || || // .|''|| ; `|...|' .||. `|..' .||. .|| ||. `|..||. .// \\. .||. .||. `|..||. .|| ||. /... `|..||. ; ====================================================================================================== ; ; Script Name: Pastorear ; ; __ _ ; .-.' `; `-._ __ _ ; (_, .-:' `; `-._ ; ,'o"( (_, ) ; (__,-' ,'o"( )> ; ( (__,-' ) ; `-'._.--._( ) ; ||| |||`-'._.--._.-' ; ||| ||| ; ; Author: Sthil Lauda ; Version: 1.0 ; Client Tested with: 2.0.3 ; EUO version tested with: EasyUO 1.5 Version 243 ; Shard: Ultima Alianza (¡Hasta la muerte!) ; Release: 16/11/2020 ; Revised On: 16/11/2020 ; Purpose: Macro para entrenar pastorear ; Instrucciones: Necesitas un animal y un cayado de pastor. ; ________________________________ ; ; /////////////////////////////// ; ******** CONFIGURACIÓN ******** ; /////////////////////////////// ; ________________________________ ; set %tiempo_alimentacion 360 ; Cada cuantos segundos comprobar el hambre. ; _______________________________________________ ; ; ////////////////////////////////////////////// ; ************* FIN CONFIGURACIÓN ************* ; ////////////////////////////////////////////// ; _______________________________________________ ; set #SYSMSGCOL 88 event sysmessage ================ set #SYSMSGCOL 53 event sysmessage Pastorear v1.0 set #SYSMSGCOL 88 event sysmessage ================ wait 40 set %comida RGG_NRD_QSD_ZBG_WLI_QRD_END_FUD_YLI_WLI_HGI +_KGI_EGI_QLI_KLI_MLI_KRD_AQD_MQE_VQE_TQE_JQE_IQE_SQD +_GQE_SPE_ZPE_OQE_BDF_KPE_RQE_YSD_SQD_YWI_AXI_PQD_QQD +_HND_YRD_ set %tiempo_actual #SCNT set %proxima_vez #SCNT gosub selectPet ;======================================================== ; ; ******************* LOOP PRINCIPAL ******************* ; ;======================================================== loop: gosub chekSkill gosub checkHungry gosub herding goto loop ;======================================================== ; ; ***************** FIN LOOP PRINCIPAL ***************** ; ;======================================================== sub herding { finditem EMH C_ , #CHARID if #FINDCNT > 0 ; OK tenemos un cayado... { set %jstart #JINDEX set #LOBJECTID #FINDID event macro 17 target 3s set #LTARGETID %animal set #LTARGETKIND 1 event macro 22 gosub wait_for MSG logra_pastorear falla_al_intentar_pastorear 100 if ( #TRUE in #RESULT ) { return } } else ; Lo buscamos en la mochila... { finditem EMH C_ , #BACKPACKID if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 wait 20 key ESC } else ; Tampoco está... { set #SYSMSGCOL 38 event sysmessage NO HAY CAYADO DE PASTOR! ¬¬ halt } } return } sub selectPet set #SYSMSGCOL 88 event sysmessage SELECCIONA EL ANIMAL set #TARGCURS 1 while #TARGCURS = 1 { wait 1 } set %animal #LTARGETID return sub checkHungry set %tiempo_actual #SCNT if %proxima_vez <= %tiempo_actual { gosub comprobar_comida } return sub chekSkill chooseskill Herd real ; (Herding) if #SKILL >= 1000 { set #SYSMSGCOL 73 event sysmessage SOMOS GM PASTOR! :) halt } return ;===================================================== ; Rutina para, en caso de hambre, comer hasta saciarse ;===================================================== ; v2.5 sub comprobar_comida { _hambriento: set %jstart #jindex event macro 4 0 .hungry gosub wait_for MSG Estas_no_le_afecta_el_hambre Estas_tan_lleno_que_no_puedes Estas_totalmente_saciado Estas_lleno Estas_contento Estas_en_inanicion Estas_hambriento Sientes_mucho Estas_con_hambre Estas_parcialmente Estas_bien_lleno Te_sientes_casi_lleno 50 if ( #TRUE in #RESULT ) { if ( Estas_no_le_afecta_el_hambre in #RESULT || Estas_tan_lleno_que_no_puedes in #RESULT ) { set %proxima_vez %tiempo_actual + %tiempo_alimentacion return } else { if ( Estas_lleno in #RESULT || Estas_contento in #RESULT || Estas_en_inanicion in #RESULT || Estas_hambriento in #RESULT || Sientes_mucho in #RESULT || Estas_con_hambre in #RESULT || Estas_parcialmente in #RESULT || Estas_bien_lleno in #RESULT || Te_sientes_casi_lleno in #RESULT || Estas_totalmente_saciado in #RESULT ) { finditem %comida C_ , #BACKPACKID if #FINDCNT > 0 { set %jstart #jindex set #LOBJECTID #FINDID event macro 17 gosub wait_for MSG Estas_tan_lleno_que_no_puedes Estas_no_le_afecta_el_hambre no_te_puedes_comer_eso 20 if ( #TRUE in #RESULT ) { set %proxima_vez %tiempo_actual + %tiempo_alimentacion return } else { wait 20 goto _hambriento } } else { wait 20 set #SYSMSGCOL 38 event sysmessage COMPRA COMIDA!! wait 20 event exmsg #CHARID 3 48 COMPRA COMIDA!! wait 40 set %proxima_vez %tiempo_actual + %tiempo_alimentacion } } } } else ; Mensaje extraño, repetimos... { goto _hambriento } } return ;================================================================= 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_MSG ; version 1.4 ~Locke ;================================================================= if !_A0 < 3 { display ok You haven't specified enough vars.$ +The basic format is: gosub wait_for MSG %message time_out_in_seconds$ +Script is halting halt } set !_timeout ( #scnt2 + !_A . !_A0 ) _lets_wait_for_a_message: for %i %jstart #jindex { scanjournal %i for %ii 2 !_A0 { if !_A . %ii in #journal && %jstart <> %i set #result #true , #spc , !_A . %ii } } if #true notin #result { set #result #false if !_timeout =< #scnt2 return #result wait 1 goto _lets_wait_for_a_message } else return #result wait 1 goto _lets_wait_for_a_message