; ====================================================================================================== ; '|| ||` '||` || /.\ '||` ; || || || || '' // \\ || '' ; || || || ''||'' || '||),,(|, '''|. //...\\ || || '''|. `||''|, '''/ '''|. ; || || || || || || || || .|''|| // \\ || || .|''|| || || // .|''|| ; `|...|' .||. `|..' .||. .|| ||. `|..||. .// \\. .||. .||. `|..||. .|| ||. /... `|..||. ; ====================================================================================================== ; ; Script Name: Herreria ; ; ' ; , ; ' ; ' :=<] ; ' *__ / ; ( (__/ e ; ' ) ('J) / ; ')(' )))____/ ; ( ) )') | | ; ( /(( ) \____m=====\ ; )')(( ) ) +()+ (") ; |E -_-_-_-_-|| ++vv++ ====== ; |J-_-_-_-_-_|| +++++++ \/ ; |M-_-_-_---_|| ++++++++ /\ ; |9-_-_-_-_-_|| // || / \ ; |6-_-_-_---_|| (__D(__D / \ ; ============== ; ; Author: Sthil Lauda ; Version: 2.0 ; Client Tested with: 2.0.3 ; EUO version tested with: EasyUO 1.5 Version 243 ; Shard: Ultima Alianza (¡Hasta la muerte!) ; Revision Date: 07/12/2021 ; Public Release: 05/08/2019 ; Purpose: Subir la skill de Herrería fabricando tornillos y canjeándolos por tickets en el sistema de recompensas :-) ; Instrucciones: En Minoc hay una tienda de caldereros donde podrás comprar las mazas. Compra muchas, haz tres o cuatro viajes, porque pesan mucho. ; Ponlas todas en una bolsa, y configura el ID de esa bolsa en la macro. ; Para ello ábrela y mira en EasyUO en el apartado #LOBJECTID para encontrar el ID de la bolsa que acabas de abrir. ; Haz lo mismo para la bolsa de tickets y también con el barril del sistema de recompensas. Si no tienes uno di "Quiero poner el Sistema de Recompensas". ; ;________________________________ ; ; /////////////////////////////// ; ******** CONFIGURACIÓN ******** ; /////////////////////////////// ;________________________________ ; set %cofre UXVXMND ; Cofre con lingotes de hierro. set %bolsa_mazas LWHDKOD ; Bolsa con Mazas de Herrero. set %bolsa_tickets SOPVEND ; Bolsa para almacenar los tickets generados por la papelera al destruir los tornillos. set %papelera EAELWND ; El ID de tu papelera (como máximo debe estar a 2 casillas de distancia) ;________________________________________________ ; ; ////////////////////////////////////////////// ; ************* FIN CONFIGURACIÓN ************* ; ////////////////////////////////////////////// ;________________________________________________ ; set %tornillos YFG set %martillos GBG_FBG_TLH_CGG set %hierro RMK set %tickets HVF set %peso_disponible ( #MAXWEIGHT - #WEIGHT ) set %menu_reciclarx 0 set %menu_reciclary 0 set %boton_eliminar_offsetx 89 set %boton_eliminar_offsety 168 set %boton_target_offsetx 307 set %boton_target_offsety 334 set %tiempo_alimentacion 360 set %tiempo_actual #SCNT set %proxima_vez #SCNT set %start #TRUE 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_YWI_AXI_PQD_QQD gosub wait_for GUMP 585_401 CLOSE ; Cerrar el menú de la papelera gosub wait_for GUMP 530_480 CLOSE ; Cerrar el menú de la craftear gosub wait_for GUMP 585_401 CLOSE ; Cerrar el menú de la papelera gosub wait_for GUMP 530_480 CLOSE ; Cerrar el menú de la craftear gosub make_tickets ; Limpiar posibles tornillos gosub wait_for GUMP 585_401 CLOSE ; Cerrar el menú de la papelera gosub wait_for GUMP 530_480 CLOSE ; Cerrar el menú de la craftear gosub wait_for GUMP 585_401 CLOSE ; Cerrar el menú de la papelera gosub wait_for GUMP 530_480 CLOSE ; Cerrar el menú de la craftear ;======================================================== ; ; ******************* LOOP PRINCIPAL ******************** ; ;======================================================== inicio: gosub checkHungry gosub hierro gosub tornillos goto inicio ;======================================================== ; ; ***************** FIN LOOP PRINCIPAL ***************** ; ;======================================================== sub checkHungry ;<=======================> set %tiempo_actual #SCNT if %proxima_vez <= %tiempo_actual { gosub comprobar_comida } return sub hierro ;<=======================> finditem %hierro C_ , #BACKPACKID if #FINDSTACK <= 0 { set %peso_disponible ( #MAXWEIGHT - #WEIGHT ) set %max_lingotes abs ( %peso_disponible / 2 ) - 10 ; Cantidad de lingotes a procesar en cada tanda de crafteo (y le restamos los lingotes que pesa una maza). set %for_lingotes %max_lingotes finditem %hierro C_ , %cofre if #FINDSTACK >= %max_lingotes { exevent drag #FINDID %max_lingotes exevent dropc #BACKPACKID wait 30 } else { set #SYSMSGCOL 38 event sysmessage NO QUEDAN SUFICIENTES LINGOTES! :-( halt } } else { set %for_lingotes #FINDSTACK ; Cantidad de lingotes a procesar en cada tanda de crafteo. } return sub martillos ;<=======================> finditem %martillos C_ , %bolsa_mazas if #FINDCNT > 0 { exevent drag #FINDID 1 exevent dropc #BACKPACKID wait 30 } else { set #SYSMSGCOL 38 event sysmessage NO QUEDAN MAZAS! :-( halt } return sub tornillos ;<=======================> for %t 1 %for_lingotes { gosub checkMartillo finditem %hierro C_ , #BACKPACKID if #FINDSTACK > 0 { if ( %start ) { _start: set #LOBJECTID #FINDID event macro 17 gosub wait_for GUMP 530_480 50 contpos 40 40 set %boton_otros_offsetx 69 - #contposx set %boton_otros_offsety 310 - #contposy set %click_x #contposx + %boton_otros_offsetx set %click_y #contposy + %boton_otros_offsety click %click_x %click_y f dmc gosub wait_for GUMP 530_480 50 contpos 40 40 set %boton_fabricar_tornillo_offsetx 273 - #contposx set %boton_fabricar_tornillo_offsety 150 - #contposy set %click_x #contposx + %boton_fabricar_tornillo_offsetx set %click_y #contposy + %boton_fabricar_tornillo_offsety click %click_x %click_y f dmc gosub wait_for GUMP 530_480 50 set %start #FALSE } else { if ( #CONTSIZE = 530_480 ) { contpos 40 40 set %boton_fabricar_ultimo_offsetx 322 - #contposx set %boton_fabricar_ultimo_offsety 496 - #contposy set %click_x #contposx + %boton_fabricar_ultimo_offsetx set %click_y #contposy + %boton_fabricar_ultimo_offsety click %click_x %click_y f dmc gosub wait_for GUMP 530_480 50 } else { goto _start } } } else { gosub make_tickets return } } gosub make_tickets return sub make_tickets { finditem %tornillos C_ , #BACKPACKID set %num_items #FINDCNT if #FINDCNT > 0 { finditem %papelera G_2 if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 gosub wait_for GUMP 585_401 50 ; Esperar a que se abra el menú de la la papelera contpos %menu_reciclarx %menu_reciclary ; Situamos el menú de papelera en su sitio set %click_x #contposx + %boton_eliminar_offsetx set %click_y #contposy + %boton_eliminar_offsety click %click_x %click_y f dmc gosub wait_for GUMP 585_401 50 ; Esperar a que vuelva el menú de la papelera set %click_x #contposx + %boton_target_offsetx set %click_y #contposy + %boton_target_offsety click %click_x %click_y f dmc target 3s for %i 1 %num_items { finditem %tornillos C_ , #BACKPACKID ; CORAZA, ALABARDA PESADA, MALLA ORO... if #FINDCNT > 0 { set #LTARGETKIND 1 set #LTARGETID #FINDID event macro 22 target 3s } } key ESC gosub wait_for GUMP 585_401 CLOSE ; Cerrar el menú de la papelera gosub moveTickets } else { set #SYSMSGCOL 38 event sysmessage LA PAPELERA ESTA MUY LEJOS wait 20 display OK ¡¡LA PAPELERA ESTÁ MUY LEJOS!! :-( halt } } return } sub moveTickets finditem %tickets C_ , #BACKPACKID if #FINDCNT > 0 { for #FINDINDEX 1 #FINDCNT { if #FINDSTACK >= 65500 ; Mover montones de tickets :-)))))) { exevent drag #FINDID #FINDSTACK exevent dropc %bolsa_tickets wait 30 } } } return sub checkMartillo ;<=======================> _reMartillo: finditem %martillos C_ , #CHARID if #FINDCNT = 0 { finditem %martillos C_ , #BACKPACKID if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 wait 20 goto _reMartillo } else ; Reponemos martillos... { gosub martillos goto _reMartillo } } return sub checkPapelera finditem %papelera G_2 if #FINDCNT = 0 { set #SYSMSGCOL 38 event sysmessage LA PAPELERA ESTA MUY LEJOS wait 20 display OK ¡¡LA PAPELERA ESTÁ MUY LEJOS!! :-( 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 3 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 Dentro_de_1_minuto in #journal { wait 120s ; Save del server... } 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 %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 { finditem %comida C_ , #backpackid if #findcnt > 0 { set #lobjectid #findid event macro 17 wait 20 goto hambriento } else { event exmsg #charid 3 48 COMPRA COMIDA!! wait 40 set %proxima_vez %tiempo_actual + %tiempo_alimentacion } } else ; Mensaje extraño, repetimos... { goto hambriento } } } return } ; FIN While } 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 ;====================================================================== 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