; ====================================================================================================== ; '|| ||` '||` || /.\ '||` ; || || || || '' // \\ || '' ; || || || ''||'' || '||),,(|, '''|. //...\\ || || '''|. `||''|, '''/ '''|. ; || || || || || || || || .|''|| // \\ || || .|''|| || || // .|''|| ; `|...|' .||. `|..' .||. .|| ||. `|..||. .// \\. .||. .||. `|..||. .|| ||. /... `|..||. ; ===================================================================================================== ; Script Name: Cartografía ; Author: Sthil Lauda ; Version: 1.1 ; Client Tested with: 2.0.3 ; EUO version tested with: EasyUO 1.5 Version 243 ; Shard: Ultima Alianza (¡Hasta la muerte!) ; Revision Date: 04/04/2020 ; Public Release: 04/04/2020 ; Global Variables Used: Ninguna. ; Purpose: Entrena la habilidad de cartografía haciendo mapas de ciudad y convirtiéndolos a tickets de recompensa. ;------------------------------------------------------------------------- ; *** INSTRUCCIONES *** ;---------------------- ; Abrimos la mochila del PJ. ; Dentro de la mochila del PJ, tenemos que tener otra mochila o bolsa. Esta Mochila/Bolsa hay que dejarla abierta antes de darle a PLAY a la macro. ; Escribimos la ID de la bolsa de mapas en blanco, la ID de la bolsa de plumas, la ID de la papalera, y la ID de la Mochila/Bolsa donde se van a guardar los mapas fabricados. ;________________________________ ; ; /////////////////////////////// ; ******** CONFIGURACIÓN ******** ; /////////////////////////////// ;________________________________ ; set %bolsa_lotes_mapas LJOFWMD ; Bolsa con lotes de mapas. set %bolsa_plumas QQWFWMD ; Bolsa con plumas del tipo "Kit de Escritura de Mapas". set %papelera EAELWND ; Ponemos #LOBJECTID del sistema de recompensa. set %bolsa_mapas_ticketearID XSMMPQD ; Bolsa en la mochila del personaje para almacenar mapas hechos y convertirlos a tickets. set %max_lotes_backpack 5 ; Número de lotes de mapas en blanco a mover a la mochila en cada tanda (Cada lote son 4 mapas, luego 5 x 4 = 20 mapas en blanco en cada ronda). set %max_mapas_mochila 60 ; Número máximo de mapas en la bolsa de mapas de la mochila, antes de convertirlos a tickets (cuidado con el peso... XD). set %tiempo_alimentacion 360 ; Cada cuántos segundos va a comprobar si tiene hambre (6 minutos). ;________________________________________________ ; ; ////////////////////////////////////////////// ; ************* FIN CONFIGURACIÓN ************* ; ////////////////////////////////////////////// ;________________________________________________ ; set %mapa XVH_SVH set %lote_mapas MMF set %pluma PBG 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 +_FWI set %fabricar_mapax 104 set %fabricar_mapay 60 set %boton_eliminar_offsetx 89 set %boton_eliminar_offsety 168 set %boton_target_offsetx 307 set %boton_target_offsety 334 set %tiempo_actual #SCNT ; Reloj set %proxima_vez #SCNT ; Trigger 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. set #SYSMSGCOL 1187 event sysmessage ==================== wait 20 set #SYSMSGCOL 1165 event sysmessage Cartografia v1.1 wait 20 set #SYSMSGCOL 1187 event sysmessage ==================== wait 20 ; ;======================================================== ; ; ******************* LOOP PRINCIPAL ******************** ; ;======================================================== ; loop: gosub checkSkill gosub checkHungry gosub plumas gosub mapas gosub clickmenu goto loop ; ;======================================================== ; ; ***************** FIN LOOP PRINCIPAL ***************** ; ;======================================================== ; sub clickmenu _mapaBlanco: gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 finditem %mapa C_ , #BACKPACKID if #FINDCNT > 0 { gosub waitforprop #FINDID if Blanco in #PROPERTY { _clickMenu: finditem %pluma C_ , #BACKPACKID if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 gosub wait_for GUMP 296_135 40 if ( #TRUE in #RESULT ) { contpos 0 0 set %jstart #jindex click %fabricar_mapax %fabricar_mapay d dmc gosub wait_for MSG Fallas_al_escribir Pones_el_mapa_de_ciudad 100 if ( #TRUE in #RESULT ) { goto _mapaBlanco } } } else { gosub plumas goto _clickMenu } } else { finditem #FINDID C_ , #BACKPACKID if #FINDCNT > 0 { exevent drag #FINDID wait 10 exevent dropc %bolsa_mapas_ticketearID gosub wait_for ITEM #FINDID C_ , %bolsa_mapas_ticketearID 40 goto _mapaBlanco } goto _mapaBlanco } } else { finditem %mapa C_ , %bolsa_mapas_ticketearID if #FINDCNT >= %max_mapas_mochila { finditem %papelera G_3 if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 gosub wait_for GUMP 585_401 30 ; 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 %clickx #contposx + %boton_eliminar_offsetx set %clicky #contposy + %boton_eliminar_offsety click %clickx %clicky f dmc gosub wait_for GUMP 585_401 30 ; Esperar a que vuelva el menú de la papelera set %clickx #contposx + %boton_target_offsetx set %clicky #contposy + %boton_target_offsety click %clickx %clicky f dmc target 3s _eliminarMapas: gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 finditem %mapa C_ , %bolsa_mapas_ticketearID if #FINDCNT > 0 { finditem %bolsa_mapas_ticketearID C_ , #BACKPACKID if #FINDCNT > 0 { set #LTARGETID #FINDID set #LTARGETKIND 1 event macro 22 wait 10 goto _eliminarMapas } else { set #SYSMSGCOL 38 event sysmessage LA BOLSA DE MAPAS HECHOS NO ESTA EN LA MOCHILA!! halt } } key ESC } else { set #SYSMSGCOL 38 event sysmessage ESTAS LEJOS DE LA PAPELERA! halt } } } return ;================================================= ================================================== = sub plumas _pluma: gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 finditem %pluma C_ , #BACKPACKID if #FINDCNT <= 1 { finditem %pluma c_ , %bolsa_plumas if #FINDCNT > 0 { exevent drag #FINDID wait 10 exevent dropc #BACKPACKID gosub wait_for ITEM #FINDID C_ , #BACKPACKID 40 goto _pluma } else { set #SYSMSGCOL 38 event sysmessage NO QUEDAN PLUMAS! :-( halt } } return ;================================================= ================================================== = sub mapas _mapa: finditem %mapa C_ , #BACKPACKID if #FINDCNT = 0 { finditem %lote_mapas C_ , %bolsa_lotes_mapas if #FINDCNT > 0 { for #FINDINDEX 1 #FINDCNT { if #FINDCOL = 80 ; Lote de Mapas. { if #FINDSTACK >= %max_lotes_backpack { exevent drag #FINDID %max_lotes_backpack wait 10 exevent dropc #BACKPACKID gosub wait_for ITEM #FINDID C_ , #BACKPACKID 40 _abrirMapas: gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 finditem %lote_mapas c_ , #BACKPACKID if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 wait 20 goto _abrirMapas } goto _mapa } else { goto _noLote } } } finditem %lote_mapas C_ , #BACKPACKID if #FINDCNT = 0 { goto _noLote } } else { _noLote: set #SYSMSGCOL 38 event sysmessage NO QUEDAN MAPAS! :-( halt } } return sub checkSkill chooseskill Cart real if #SKILL >= 1000 { display ¡Somos GM Cartógrafo! :-) halt } return sub checkHungry set %tiempo_actual #SCNT if ( %proxima_vez <= %tiempo_actual ) { gosub comprobar_comida } return sub waitforprop event property #charid wait 1 set %oldprop #property event property %1 _testforprop: if #property = %oldprop { goto _testforprop } 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 %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 ;----------------------------------------------------------- ; 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 ;================================================================= 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 ;================================================================= 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 set *esperando #TRUE goto _lets_wait_for_a_message } else set *esperando #FALSE return #result wait 1 goto _lets_wait_for_a_message ;====================================================================== 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 + #scnt2 repeat { finditem !_A2 !_A3 if #findkind <> -1 return #true wait 1 } until #scnt2 => !_timeout return #false