; ======================/================================================================================ ; '|| ||` '||` || /.\ '||` ; || || || || '' // \\ || '' ; || || || ''||'' || '||),,(|, '''|. //...\\ || || '''|. `||''|, '''/ '''|. ; || || || || || || || || .|''|| // \\ || || .|''|| || || // .|''|| ; `|...|' .||. `|..' .||. .|| ||. `|..||. .// \\. .||. .||. `|..||. .|| ||. /... `|..||. ; ===================================================================================================== ; 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!) ; Public Release: 02/06/2022 ; Revised On: 20/06/2022 ; Propósito: Reparar piezas sueltas de armaduras. ; Instrucciones: Se necesita una bolsa con piezas y otra bolsa con cepillos de durabilidad. set %partes_armor OSH_MSH_NSH_ISH_LSH_HSH_NJL_JKH_KKH_HKH_VKH_QKH set #sysmsgcol 53 setuotitle Haz CLICK en la bolsa de PIEZAS event sysmessage ================ event sysmessage Haz click en la bolsa de PIEZAS event sysmessage ================ set %conf 3 set #TARGCURS 1 target while #TARGCURS = 1 { wait 1 } set %bolsa_amaduras #LTARGETID set #LOBJECTID %bolsa_amaduras event macro 17 gosub wait_for GUMP %bolsa_amaduras 40 wait 40 set #sysmsgcol 53 setuotitle Haz CLICK en la bolsa de CEPILLOS event sysmessage ================ event sysmessage Haz click en la bolsa de CEPILLOS event sysmessage ================ set %conf 3 set #TARGCURS 1 target while #TARGCURS = 1 { wait 1 } set %bolsa_cepillos #LTARGETID set #LOBJECTID %bolsa_cepillos event macro 17 gosub wait_for GUMP %bolsa_cepillos 40 ignoreitem reset piezasProcesadas loop: gosub checkCepillo gosub selectArmor gosub moveArmorIn gosub repairArmor gosub moveArmorOut goto loop sub selectArmor finditem %partes_armor C_ , %bolsa_amaduras if #FINDCNT > 0 { set %pieza #FINDID return } else { set #SYSMSGCOL 88 event sysmessage TERMINADO! gosub moveCepilloOut halt } return sub repairArmor finditem WFG C_ , #BACKPACKID if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 target set #LTARGETID %pieza set #LTARGETKIND 1 event macro 22 wait 20 } return sub moveArmorIn _movePiezaIn: finditem %pieza C_ , %bolsa_amaduras if #FINDCNT > 0 { exevent drag %pieza #FINDSTACK exevent dropc #BACKPACKID wait 20 goto _movePiezaIn } return sub moveArmorOut _movePiezaOut: finditem %pieza C_ , #BACKPACKID if #FINDCNT > 0 { exevent drag %pieza #FINDSTACK exevent dropc %bolsa_amaduras wait 20 goto _movePiezaOut } ignoreitem %pieza piezasProcesadas return sub moveCepilloOut _moveCepilloOut: finditem WFG C_ , #BACKPACKID if #FINDCNT > 0 { exevent drag #FINDID #FINDSTACK exevent dropc %bolsa_cepillos wait 20 goto _moveCepilloOut } return sub checkCepillo _moveCepillo: finditem WFG C_ , #BACKPACKID if #FINDCNT = 0 { finditem WFG C_ , %bolsa_cepillos if #FINDCNT > 0 { exevent drag #FINDID #FINDSTACK exevent dropc #BACKPACKID wait 20 goto _moveCepillo } else { set #SYSMSGCOL 38 event sysmessage NO QUEDAN CEPILLOS! :-( halt } } 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