; ====================================================================================================== ; '|| ||` '||` || /.\ '||` ; || || || || '' // \\ || '' ; || || || ''||'' || '||),,(|, '''|. //...\\ || || '''|. `||''|, '''/ '''|. ; || || || || || || || || .|''|| // \\ || || .|''|| || || // .|''|| ; `|...|' .||. `|..' .||. .|| ||. `|..||. .// \\. .||. .||. `|..||. .|| ||. /... `|..||. ; ====================================================================================================== ; ; Script Name: Magia o Medit [ In-Lor ] ; ; ____ ; .'* *.' ; __/_*_*(_ ; / _______ \ ; _\_)/___\(_/_ ; / _((\- -/))_ \ ; \ \())(-)(()/ / ; ' \(((()))/ ' ; / ' \)).))/ ' \ ; / _ \ - | - /_ \ ; ( ( .;''';. .' ) ; _\"__ / )\ __"/_ ; \/ \ ' / \/ ; .' '...' ' ) ; / / | \ \ ; / . . . \ ; / . . \ ; / / | \ \ ; .' / b '. '. ; _.-' / Bb '-. '-._ ; _.-' | BBb '-. '-. ; (________mrf\____.dBBBb.________)____) ; ; Author: Sthil Lauda ; Version: 1.5 ; Client Tested with: 2.0.3 ; EUO version tested with: EasyUO 1.5 Version 243 ; Shard: Ultima Alianza (¡Hasta la muerte!) ; Revision Date: 08/02/2019 ; Public Release: 02/01/2019 ; Global Variables Used: ; Purpose: Macrea Magia o Medit desde un cofre o directamente comprando a los vendors (ir a la ciudad de Wind o Ver Lor Reg). ; ================================== set %numeroregs 200 ; Número de regs que cogerá para reponerse cada vez. set %tiempo_ronda 1020 ; Segundos que les cuesta a los vendors reponer los regs. set %tiempo_alimentacion 360 ; Cada cuántos segundos va a comprobar si tiene hambre (6 minutos). ; ================================== chooseskill mage real set %skillinimagia #skill chooseskill medi real set %skillinimedit #skill set %seda RZF set %ceniza SZF 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 set %ceniza_sulfurosa 1 set %seda_aracnido 1 set %stats_timer #SCNT set %ronda_timer #SCNT set %tiempo_actual #SCNT set %proxima_vez #SCNT event sysmessage Iniciando Macro... :D event sysmessage set #targCurs 0 configurar: if %confp = 1 || %confp = N/A { _modeMacro: display yesno ¿Quieres subir la habilidad de MAGIA? if ( #dispres = yes ) { set %subir_magia #TRUE set %subir_medit #FALSE set %managastado #MAXMANA - abs ( #MAXMANA - 4 ) ; Este número simboliza el maná gastado máximo antes de meditar } else { display yesno ¿Quieres subir la habilidad de MEDITAR? if ( #dispres = yes ) { set %subir_medit #TRUE set %subir_magia #FALSE set %managastado #MAXMANA - 4 ; Este número simboliza el maná gastado máximo antes de meditar } else { display OK DEBES CONTESTAR SI EN ALGUNA PREGUNTA! ¬¬ set #SYSMSGCOL 43 event sysmessage DEBES CONTESTAR SI EN ALGUNA PREGUNTA! ¬¬ goto _modeMacro } } display yesno ¿Quieres macrear en casa usando un cofre? if ( #dispres = yes ) { set #sysmsgcol 1264 setuotitle Abre el contenedor donde estan los Regs. event sysmessage ================ event sysmessage Abre el contenedor de Regs event sysmessage Presiona la tecla ESC. event sysmessage ================ set %confp 2 set %modo_tienda #FALSE goto TESC } else { display yesno ¿Quieres macrear desde una tienda de magia? if ( #dispres = yes ) { set %modo_tienda #TRUE goto loop } else { set #SYSMSGCOL 43 event sysmessage DEBES SELECCIONAR UNA OPCION! goto configurar } } } if %confp = 2 { goto loop } TESC: onHotKey ESC { set %idcaja #LOBJECTID set #LOBJECTID %idcaja event macro 17 gosub wait_for GUMP %idcaja 4 goto configurar } goto TESC loop: repeat { ; Comer cada cierto tiempo si hay hambre set %tiempo_actual #SCNT if %proxima_vez <= %tiempo_actual { gosub comprobar_comida } gosub check event macro 15 5 target event macro 23 wait 20 ;gosub uotitle } until #mana <= %managastado gosub meditar goto loop sub uotitle chooseskill mage real set %skillmagiaahora #SKILL if %skillmagiaahora >= 1000 && %subir_magia { set #SYSMSGCOL 73 event sysmessage Somos GM Magery! :D halt } chooseskill medi real set %skillmeditahora #SKILL if %skillmeditahora >= 1000 && %subir_medit { set #SYSMSGCOL 73 event sysmessage Somos GM Medit! :D halt } finditem KZF C_ , #BACKPACKID set %cuantogarlic #FINDSTACK finditem WZF C_ , #BACKPACKID set %cuantonight #FINDSTACK setuotitle || Magia | Ini: %skillinimagia | Actual: %skillmagiaahora || Medit | Ini: %skillinimedit | Actual: %skillmeditahora || Regs | Garlic: %cuantogarlic | Night: %cuantonight || return sub meditar _reMedit: set %jstart #jindex event macro 13 46 gosub wait_for MSG pierdes trance en_paz 5 if ( #TRUE in #result ) { if pierdes in #result { goto _reMedit ; Meditamos hasta que no perdamos la concentración } if trance in #result { set %jstart #jindex gosub wait_for MSG pierdes en_paz 5 if ( #TRUE in #result ) { if pierdes in #RESULT { goto _reMedit } if en_paz in #RESULT { return } } else ; Meditamos hasta llenar la barra al máximo... { repeat { wait 1 } until #MANA = #MAXMANA wait 2s } } if en_paz in #result ; OK, estamos bien de maná. { return } } else { goto _reMedit } return sub check gosub ceniza gosub seda if %modo_tienda && %ceniza_ok && %seda_ok { set %ceniza_ok #FALSE set %seda_ok #FALSE set %ronda_timer #SCNT + %tiempo_ronda ; Último Vendor al que le compramos algo... } return sub ceniza _ceniza: finditem %ceniza C_ , #BACKPACKID if #FINDSTACK = 0 { set %matcnt #findstack set %debocoger %numeroregs - %matcnt finditem %ceniza C_ , %idcaja if #FINDSTACK >= %debocoger { exevent drag #FINDID %debocoger exevent dropc #BACKPACKID wait 30 goto _ceniza } else { if %modo_tienda { set %ceniza_sulfurosa 1 set %seda_aracnido 0 _waitToVendors: if #SCNT >= %ronda_timer { gosub buyRegsMagos } else ; Todavía no podemos comprar los regs { if #SCNT > %stats_timer { gosub infoRoda } wait 20 goto _waitToVendors } } else { set #SYSMSGCOL 38 event sysmessage NO QUEDA CENIZA! :-( halt } } } return sub seda _seda: finditem %seda C_ , #BACKPACKID if #FINDSTACK = 0 { set %matcnt #findstack set %debocoger %numeroregs - %matcnt finditem %seda C_ , %idcaja if #FINDSTACK >= %debocoger { exevent drag #FINDID %debocoger exevent dropc #BACKPACKID wait 30 goto _seda } if %modo_tienda { set %ceniza_sulfurosa 0 set %seda_aracnido 1 _waitToVendors: if #SCNT >= %ronda_timer { gosub buyRegsMagos } else ; Todavía no podemos comprar los regs { if #SCNT > %stats_timer { gosub infoRoda } wait 20 goto _waitToVendors } } else { set #SYSMSGCOL 38 event sysmessage NO QUEDA SEDA! :-( halt } } return sub infoRoda if %ronda_timer - #SCNT > 0 { set %ronda_secs %ronda_timer - #SCNT set %ronda_mins abs ( %ronda_secs / 60 ) } else { set %ronda_secs 0 set %ronda_mins abs ( %ronda_secs / 60 ) } if %ronda_secs <= 60 { set %ronda_secs_fin abs ( %ronda_secs ) event sysmessage Proxima Ronda: [ %ronda_secs_fin Secs ] set %stats_timer #SCNT + 30 } else { event sysmessage Proxima Ronda: [ %ronda_mins Mins ] set %stats_timer #SCNT + 30 } return sub buyRegsMagos ; <==============================> if ( %ceniza_sulfurosa = 1 || %seda_aracnido = 1 ) { ignoreitem #CHARID YO _checkVendors: finditem HS_IS_OCB_NCB G_10 if #FINDCNT > 0 { for #FINDINDEX 1 #FINDCNT { if #FINDREP = 1 { set %vendor_id #FINDID set %vendor_X #FINDX set %vendor_Y #FINDY set %vendor_Z #FINDZ event property %vendor_id set %bad_proper $ repeat { event property %vendor_id wait 1 } until ( %bad_proper <> #PROPERTY ) if Comerciante in #PROPERTY { gosub GetName %vendor_id nombre_vendor set %jstart #jindex event macro 1 0 %nombre_vendor profesion wait 20 gosub wait_for MSG Soy_herrero Forjo_acero armas_y_armaduras artes_arcanas hago_pociones herbalista 5 if ( #TRUE in #RESULT ) { if Soy_herrero in #RESULT || Forjo_acero in #RESULT || armas_y_armaduras in #RESULT || escrib in #RESULT || herbalista in #RESULT { ignoreitem #FINDID BAD_MAGERY_VENDORS continue } else { if artes_arcanas in #RESULT ; 6 páginas en el menú { move %vendor_X %vendor_Y 1 5s event macro 1 0 %nombre_vendor buy gosub wait_for GUMP GPDC 4 if ( #TRUE in #RESULT ) { contpos 0 0 wait 10 } set %cambiopagina #FALSE set %menu_cambiado #FALSE gosub selectMageryReg } else { if hago_pociones in #RESULT ; 2 páginas en el menú { set %alquimista %alquimista , _ , #FINDID move %vendor_X %vendor_Y 1 5s event macro 1 0 %nombre_vendor buy gosub wait_for GUMP GPDC 4 if ( #TRUE in #RESULT ) { contpos 0 0 wait 10 } set %cambiopagina #FALSE set %menu_cambiado #FALSE gosub selectMageryReg } else { ignoreitem #FINDID BAD_MAGERY_VENDORS } } } } } } wait 20 } ignoreitem reset YO } else { set #SYSMSGCOL 43 event sysmessage ESPERANDO AL VENDOR... wait 10s goto _checkVendors } } return sub selectMageryReg ; <==============================> if %ceniza_sulfurosa = 1 { if ! %cambiopagina { set %cambiopagina #TRUE } gosub comprar 7 set %ceniza_ok #TRUE } if %seda_aracnido = 1 { if ! %cambiopagina { set %cambiopagina #TRUE } gosub comprar 8 ; %seda_aracnido set %seda_ok #TRUE } repeat { gosub click %1 %2 %3 600 530 l ; OK Confirmar la compra. wait 20 } until #CONTSIZE <> 800_590 || #CONTSIZE <> 805_590 || #CONTKIND <> GPDC return sub comprar ; <==============================> if %vendor_id in %alquimista { set %1 %1 + 1 } if %1 > 6 { if %cambiopagina = #TRUE && ! %menu_cambiado { set %click_timer #SCNT + 5 _reClick1: gosub click %1 %2 %3 400 540 l gosub gump %1 %2 %3 GPDC 3 if ( #TRUE in #RESULT ) { contpos 0 0 wait 20 set %menu_cambiado #TRUE } else { if #SCNT >= %click_timer { set #result #false return #result } goto _reClick1 } } set %1 %1 - 6 set %1 90 + ( 60 * %1 ) set %click_timer #SCNT + 5 _reClick2: gosub click %1 %2 %3 375 %1 l gosub gump %1 %2 %3 GPDC 3 if ( #TRUE in #RESULT ) { contpos 0 0 wait 20 } else { if #SCNT >= %click_timer { set #result #false return #result } goto _reClick2 } } else { set %1 90 + ( 60 * %1 ) set %click_timer #SCNT + 5 _reClick3: gosub click %1 %2 %3 375 %1 l gosub gump %1 %2 %3 GPDC 3 if ( #TRUE in #RESULT ) { contpos 0 0 wait 20 } else { if #SCNT >= %click_timer { set #result #false return #result } goto _reClick3 } } return #true sub gump ; <==============================> set %gump_timeout #SCNT2 + %5 _gump_loop: if #CONTSIZE = %4 || #CONTKIND = %4 || #CONTNAME = %4 || #CONTTYPE = %4 || #CONTID = %4 { return #true } if #SCNT2 >= %gump_timeout { return #false } wait 1 goto _gump_loop return sub click ; <==============================> set %clickx #CONTPOSX + %4 set %clicky #CONTPOSY + %5 click %clickx %clicky f dmc 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 ;* @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 event property #findid set %bad_proper $ repeat { event property %vendor_id wait 1 } until ( %bad_proper <> #PROPERTY ) str pos #property $ set !strlength #strres - 1 str left #property !strlength 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. ; // 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 ( #scnt + !_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 =< #scnt 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 #scnt + !_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 #CONTID = !_A2 || #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 =< #scnt && !_A4 = N/A return #false if !_A4 <> N/A && !_timeout =< #scnt { 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 #scnt + !_A3 } else return #false } wait 1 goto _lets_wait_for_a_gump