; | / \ | . ; _ -O- . ) (( )) ( -O- ; (@) | + /|\ ))_(( /|\ | . ; |-| / | \ (/\|/\) / | \ (@) ; | | --------------------------/--|-voV---\`|'/--Vov-|--\---------------------------|-| . ; |-| '^` (o o) '^` | | ; | | `\Y/' |-| ; |-| _______ __ __ __ _______ __ __ | | ; | | | | | | |_|__|.--------.---.-.| _ | |__|.---.-.-----.-----.---.-. |-| . o ; |-| | | | | _| || | _ || | | || _ | |-- __| _ | | | ; | | |_______|__|____|__||__|__|__|___._||___|___|__|__||___._|__|__|_____|___._| |-| ; |_|________________________________________________________________________________| | ; (@) l /\ / ( ( \ /\ l `\|-| . ; o l / V \ \ V \ l + (@) ; l/ _) )_ \I + ; + `\ /' ; ; Script Name: Cristalero ; Author: Sthil Lauda ; Version: 1.1 with: 2.0.3 ; EUO version tested with: EasyUO 1.5 Version 243 ; Shard: Ultima Alianza (¡Hasta la muerte!) ; Revision Date: 20/08/2019 ; Public Release: 20/08/2019 ; Purpose: Entrena la habilidad de cristalero fabricando vasos decorativos y haciendo tickets. También puede hacer frascos de pociones si configuras la macro para ello. ; set %version v1.1 ;________________________________ ; ; /////////////////////////////// ; ******** CONFIGURACIÓN ******** ; /////////////////////////////// ;________________________________ ; set %bolsa_arena WTMMPQD set %bolsa_frascos WTMMPQD set %bolsa_sopladores WTMMPQD set %max_items 40 ; Número de objetos fabricados en la mochila antes de vaciarla. set %monton_arena 50 ; Número de lingotes de arena a reponer en la mochila. set %tiempo_alimentacion 360 ;________________________________________________ ; ; ////////////////////////////////////////////// ; ************* FIN CONFIGURACIÓN ************** ; ////////////////////////////////////////////// ;________________________________________________ ; set %papelera BKF set %frascos_decorativos SGJ_RGJ_CHJ_BHJ set %botellas WUF_CHJ_RGJ_GGJ_BHJ set %soplador GFF set %arena RMK set %menu_reciclarx 0 set %menu_reciclary 0 set %start #TRUE set %tiempo_actual #SCNT ; Reloj set %proxima_vez %tiempo_actual ; Trigger 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 set #SYSMSGCOL 88 event sysmessage ============= set #SYSMSGCOL 53 event sysmessage Cristalero %version set #SYSMSGCOL 88 event sysmessage ============= wait 40 gosub setupMacro gosub setupHid ; _____________________ inicio: ;| gosub hiding ;| gosub comer ;| gosub arena ;| gosub soplador ;| gosub items ;| goto inicio ;| ; --------------------- sub setupMacro _askConfig: display yesno ¿Quieres fabricar frascos para pociones? if ( #dispres = yes ) { set %subir_skill_cristaleria #FALSE set %producir_frascos #TRUE } else { display yesno ¿Quieres entrenar la habilidad de cristalero? if ( #dispres = yes ) { set %subir_skill_cristaleria #TRUE set %producir_frascos #FALSE } else { set #SYSMSGCOL 38 event sysmessage DEBES RESPONDER "SI" EN ALGUNA PREGUNTA wait 40 goto _askConfig } } return sub setupHid display yesno ¿Quieres OCULTAR al personaje mientras macreas? if ( #dispres = yes ) { set %hiding #TRUE } else { set %hiding #FALSE } return sub hiding if %hiding { while H Notin #CHARSTATUS { event macro 13 21 ; Use SKILL Hiding gosub waitForSysVar CHARSTATUS = H 50 } } return sub comer set %tiempo_actual #SCNT if %proxima_vez <= %tiempo_actual { gosub comprobar_comida } return sub arena finditem %arena C_ , #BACKPACKID if #FINDSTACK < 4 { finditem %arena C_ , %bolsa_arena if #FINDCNT > 0 { for #FINDINDEX 1 #FINDCNT { if #FINDCOL = 553 ; Arena { if #FINDSTACK >= %monton_arena { exevent drag #FINDID %monton_arena gosub waitForSysVar Weight <> %peso 50 ; Esperamos a que cambie el peso del PJ exevent dropC #BACKPACKID gosub waitForItem #FINDID 50 #BACKPACKID ; Esperamos a que caiga el objeto en la mochila } else { set #sysmsgcol 28 event sysmessage NO QUEDA MAS ARENA! halt } } } } else { set #sysmsgcol 28 event sysmessage NO QUEDA MAS ARENA! halt } } return sub soplador finditem %soplador C_ , #BACKPACKID if #FINDCNT = 0 { finditem %soplador C_ , %bolsa_sopladores if #FINDCNT > 0 { exevent drag #FINDID gosub waitForSysVar Weight <> %peso 50 ; Esperamos a que cambie el peso del PJ exevent dropC #BACKPACKID gosub waitForItem #FINDID 50 #BACKPACKID ; Esperamos a que caiga el objeto en la mochila } else { set #sysmsgcol 28 event sysmessage NO QUEDAN MAS SOPLADORES! halt } } return sub items finditem %soplador C_ , #BACKPACKID if #FINDCNT > 0 { if ( %producir_frascos && ! %subir_skill_cristaleria ) { gosub menuCristalero set %jstart #jindex click 60 60 d dmc ; Frasco vacío [ 2 x arena ] gosub wait_for MSG Has_fallado Pones_el_frascos 50 if ( #true in #result ) { if ( Has_fallado in #result ) { goto inicio } if ( Pones_el_frascos in #result ) { wait 130 ; Tienpo de espera obligatorio del propio UO. gosub dejarFrascos } } } else { if ( %subir_skill_cristaleria && ! %producir_frascos ) { gosub menuCristalero click 177 58 d dmc ; Frascos Decorativos [ 4 x arena ] gosub wait_for GUMP 296_135 20 set %jstart #jindex click 76 58 d dmc ; Botella [ 4 x arena ] gosub wait_for MSG Pones_el_botella Has_fallado ahora_es_de_1000 50 if ( #true in #result ) { if ( Has_fallado in #result ) { goto inicio } if ( Pones_el_botella in #result ) { wait 7s ; Tienpo de espera obligatorio del propio UO. gosub make_tickets } if ( ahora_es_de_1000 in #result ) { display ¡Somos GM Cristalero! :-) ; Somos GM Tailor halt } } } else { set #sysmsgcol 28 event sysmessage REVISA LA CONFIGURACION!! halt } } } return sub menuCristalero gosub wait_for GUMP 296_135 CLOSE set #LOBJECTID #FINDID event macro 17 gosub wait_for GUMP 296_135 50 return sub make_tickets { finditem %frascos_decorativos C_ , #BACKPACKID set %num_items #FINDCNT if #FINDCNT >= %max_items { 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 %boton_eliminar_offsetx 89 set %boton_eliminar_offsety 168 set %clickx #contposx + %boton_eliminar_offsetx set %clicky #contposy + %boton_eliminar_offsety click %clickx %clicky f gosub wait_for GUMP 585_401 50 ; Esperar a que vuelva el menú de la papelera set %boton_target_offsetx 307 set %boton_target_offsety 334 set %clickx #contposx + %boton_target_offsetx set %clicky #contposy + %boton_target_offsety click %clickx %clicky f _reTicket: finditem %frascos_decorativos C_ , #BACKPACKID if #FINDCNT > 0 { set %peso #WEIGHT set %id #FINDID target 2s set #LTARGETKIND 1 set #LTARGETID %id event macro 22 gosub waitForSysVar Weight <> %peso 20 ; Esperamos a que cambie el peso del PJ goto _reTicket } } } key ESC gosub wait_for GUMP 585_401 CLOSE ; Cerrar el menú de la papelera return } sub dejarFrascos _dumpFrascos: finditem %botellas C_ , #BACKPACKID if #FINDCNT > 0 { if #FINDSTACK >= %max_items { exevent drag #FINDID #FINDSTACK wait 15 exevent dropC %bolsa_frascos gosub waitForSysVar Weight <> %peso 50 ; Esperamos a que cambie el peso del PJ gosub waitForItem #FINDID 50 #BACKPACKID ; Esperamos a que caiga el objeto en la mochila goto _dumpFrascos } } 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 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. ; // end header ; 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. ; Thanks to ~BookWibble~ for helping with all the debugging and spotting a bug or three. ; "wait_for core dispatcher" version 1.3 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 ignoreitem reset LLWAITFOR 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 ;================================================================= 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 { 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 ;====================================================================== sub wait_for_ITEM ; Version 0.1 ~Locke ;================================================================= ; %A2 = #findid ; %A3 = C_ , %mod || G_ , %mod ; %A4 = wait_time in seconds if !_A0 < 4 { display ok You haven't specified enough vars.$ +The basic format is: gosub wait_for ITEM # , findid C_ , % , mod % , timeout +Script is halting halt } set !_timeout !_A4 + #scnt repeat { finditem !_A2 !_A3 if #findkind <> -1 return #true wait 1 } until #scnt => !_timeout return #false sub waitForSysVar ;<=========================> if %0 < 4 || %4 = N/A set %4 %_defaultWaitForTimeout if %0 < 5 set %5 return set %4 #sCnt2 + %4 _waitForSysVar: set % . %5 # . %1 %2 %3 if ! % . %5 && #sCnt2 < %4 { Wait 1 goto _waitForSysVar } return sub waitForItem ;<=========================> { set %time #SCNT2 + %2 ; Segundos dropwait2: finditem %1 C_ , %3 if ( #FINDKIND = -1 ) ; Not Found { wait 1 if ( #SCNT2 >= %time ) { return #false } goto dropwait2 } return