; ====================================================================================================== ; '|| ||` '||` || /.\ '||` ; || || || || '' // \\ || '' ; || || || ''||'' || '||),,(|, '''|. //...\\ || || '''|. `||''|, '''/ '''|. ; || || || || || || || || .|''|| // \\ || || .|''|| || || // .|''|| ; `|...|' .||. `|..' .||. .|| ||. `|..||. .// \\. .||. .||. `|..||. .|| ||. /... `|..||. ; ====================================================================================================== ; ; 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: 04/05/2019 ; Revised On: 04/05/2019 ; Propósito: Completar escrituras de comodidad del item especificado. ; Ejemplo: Hacer 25 deeds de 1000 flechas cada uno, etc. ; Instrucciones: Elegir bolsa de deeds y bolsa destino de los deeds (Puede ser la misma, Ejem: la mochila), y por último el tipo de objeto. set %numero_deeds 22 set %tamano_deed 100 gosub setupBank configurar: if %confp = 1 || %confp = N/A { set #sysmsgcol 73 setuotitle Haz CLICK en la bolsa de Escrituras de Comodidad sin usar. event sysmessage ======================== event sysmessage Click bolsa DEEDS Vacios event sysmessage ======================== set #TARGCURS 1 target while #TARGCURS = 1 { wait 1 } set %contenedor_1 #LTARGETID set %conf 1 set %confp 2 goto TESC } if %confp = 2 { set #sysmsgcol 73 setuotitle Haz CLICK en la bolsa de Escrituras de Comodidad completadas. event sysmessage ======================== event sysmessage Click bolsa DEEDS llenos event sysmessage ======================== set #TARGCURS 1 target while #TARGCURS = 1 { wait 1 } set %contenedor_2 #LTARGETID set %conf 2 set %confp 3 goto TESC } if %confp = 3 { if ! %bank_mode { set #sysmsgcol 73 setuotitle Haz CLICK en el cofre a donde mover el material de forma temporal. event sysmessage ========================== event sysmessage Click en un cofre temporal event sysmessage ========================== set #TARGCURS 1 target while #TARGCURS = 1 { wait 1 } set %contenedor_3 #LTARGETID set %conf 3 set %confp 4 goto TESC } else { if %bank_mode { set %contenedor_3 %bank_ID ; Cofre del banco set %conf 3 set %confp 4 goto TESC } } } if %confp = 4 { _reConf4: set #sysmsgcol 73 setuotitle Haz click en el OBJETO a empaquetar (flechas, engranajes, etc). event sysmessage ================ event sysmessage Haz Click en el Material event sysmessage ================ set %conf 4 set #TARGCURS 1 target while #TARGCURS = 1 { wait 1 } set %producto_guardar #LTARGETID finditem %producto_guardar if #FINDCNT > 0 { set %contenedor_4 #FINDBAGID goto TESC } else { _reConf4 } } TESC: if %conf = 1 { goto configurar } if %conf = 2 { goto configurar } if %conf = 3 { goto configurar } if %conf = 4 { set %pedido ( %numero_deeds * %tamano_deed ) finditem %producto_guardar C_ , %contenedor_4 if #FINDSTACK < %pedido { set %falta %pedido - #FINDSTACK set #SYSMSGCOL 38 event sysmessage FALTA MATERIA! [ %falta ] :-( halt } set %item_type #FINDTYPE set %item_col #FINDCOL set #sysmsgcol 1271 set %deeds 0 event sysmessage EMPEZANDO! goto macro } goto TESC macro: repeat { finditem %item_type C_ , %contenedor_4 ; Buscamos el tipo del material... if #FINDCNT > 0 { if #FINDID <> YC && #FINDID <> X { set %num_items #FINDCNT for %K 1 %num_items { set #FINDINDEX %K if #FINDCOL = %item_col ; Es del mismo color... { set %item_id #FINDID if #FINDSTACK >= %tamano_deed ; Hay suficiente para hacer un deed... { finditem %item_type C_ , %contenedor_3 if #FINDSTACK < %tamano_deed ; En el cofre no hay suficiente para hacer el deed... { gosub moveItem %item_id %contenedor_4 %contenedor_3 %tamano_deed gosub makeDeed break } else { if #FINDSTACK > %tamano_deed ; Si hay demasiado en el cofre, lo volvemos a guardar... { gosub moveItem %item_id %contenedor_3 %contenedor_4 } else { if #FINDSTACK = %tamano_deed ; Tenemos justo lo necesario... { gosub makeDeed break } } } } else { set #sysmsgcol 1271 event sysmessage MATERIA INSUFICIENTE! :-( halt } } } } } else { set #sysmsgcol 1271 event sysmessage MATERIA INSUFICIENTE! :-( halt } } until %deeds = %numero_deeds set #sysmsgcol 1271 event sysmessage TERMINADO! :-) halt sub setupBank ;<=========================> display yesno ******************** [ BANK Mode ] ******************** $$ + ¿Quieres hacer deeds en el bank de una ciudad? $$ + ******************************************************* $$ if ( #dispres = yes ) { event macro 1 0 Bank gosub wait_for GUMP 180_240 30 ; Esperar a que se abra el cofre del banco if ( #TRUE in #RESULT ) { set %bank_ID #CONTID set #SYSMSGCOL 73 event sysmessage OK: Bank %bank_ID wait 20 set %bank_mode #TRUE } } else { set %bank_mode #FALSE } return sub makeDeed ;<=========================> finditem %item_type C_ , %contenedor_3 if #FINDSTACK >= %tamano_deed { _cogeDeed: finditem TVH C_ , #BACKPACKID if #FINDCNT > 0 ; Hay deeds en la mochila { for #FINDINDEX 1 #FINDCNT { if #FINDCOL = 34 { ignoreitem #FINDID deeds_completos goto _cogeDeed } else { if #FINDCOL = 436 ; Deed vacío { break ; Hemos encontrado uno para usar... } } } } else ; No hay deeds en la mochila { finditem TVH C_ , %contenedor_1 if #FINDCNT > 0 && #FINDCOL = 436 ; Deed vacío { exevent drag #FINDID 1 exevent dropc #BACKPACKID 80 80 wait 30 goto _cogeDeed } } _makeDeed: finditem TVH C_ , #BACKPACKID if #FINDCNT > 0 && #FINDCOL = 436 ; Deed vacío { set #LOBJECTID #FINDID finditem %item_type C_ , %contenedor_3 if #FINDSTACK >= %tamano_deed { event macro 17 target set #LTARGETID #FINDID set #LTARGETKIND 1 event macro 22 wait 30 set %deeds %deeds + 1 goto _makeDeed } } if %contenedor_2 <> #BACKPACKID { _dropDeed: finditem TVH C_ , #BACKPACKID if #FINDCNT > 0 && #FINDCOL = 34 ; Deed completado { exevent drag #FINDID #FINDSTACK exevent dropc %contenedor_2 wait 30 goto _dropDeed } } } 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 ;================================== ; Script Name: sub moveItem *ExEvent* ; Author: Tecmo, Bad_Maniac, Sthil ; Version: 1.12 ; Client Tested with: 5.0.1a patch 21 ; EUO version tested with: 1.50 build 60 ; Shard OSI / FS: OSI and FS ; Revision Date: 2005-Oct-07 ; Public Release: 2005-Aug-04 ; Copyright: Tecmo, Bad_Maniac ; ********************************* ;* @packageversion 1.12 ;* @purpose move an item from one location to another ;* @author Tecmo, Bad_Maniac ;* @param ; %1 req Item to move ; %2 req Move from location ; %3 req Move to location ; %4 opt Quantity ;* @return Returns the value True or False ;* @Calling Example ; Inside script = gosub moveItem [Item to Move] [From location] [To location] [Quantity] (nothing in qty uses #findstack) ; Outside calling = call subMoveItem.txt [Item to Move] [From location] [To location] [Quantity] (nothing in qty uses #findstack) ; Examples: ;user Variable such as %loot ;system Variable such as #findid ;--> Move from Location - 2nd Variable aka %2 (Required) ; This is the variable that tells the sub where to look for the items. ; Examples: ;user Variable = a storage container, etc., %lootBag ;system Variable = #contid, #backpackid, etc. ;open Containers = C ;specific Container = C_ , %corpse ;Ground = G_4 ;--> Move to Location - 3rd Variable aka %3 (Required) ; This is the variable that tells the sub where to move the item(s) to. ; Examples: ;user Variable = a storage container, etc., %storageBag ;system Variable = #contid, #backpackid, etc. ;Ground = G_4 ;--> Quantity - 4th Variable aka %4 (Optional) ; This is the variable that tells the sub how many of the item(s) you wish to move. ; Examples: ;nothing / left blank = Sub will grab the complete stack if #findstack > ;1 or more = grabs up to specified amount. ; Calling the sub ; You are required to include AT LEAST 3 parameters when calling this sub. The 4th is optional as noted above. ; Examples: ; gosub moveItem %loot %corpse #BACKPACKID (moves all selected loot from corpse to your pack) ; gosub moveItem %loot %corpse #BACKPACKID 1 (moves 1 item from stack off of corpse to pack ; gosub moveItem %loot C #BACKPACKID (moves selected items from any open pack to your main pack) ;================================== SUB moveItem { SET %_itemId %1 SET %_itemLocation C_ , %2 SET %_newItemLocation %3 IF %0 = 4 SET %_qty %4 ELSE SET %_qty 0 moveLoop: set %peso #WEIGHT FINDITEM %_itemId %_itemLocation IF #FINDKIND <> -1 { SET %_litemID #FINDID SET %_litemTypeID #FINDTYPE SET %qty %_qty IF %qty = 0 SET %qty #FINDSTACK EXEVENT drag %_litemID %qty WAIT 15 if #WEIGHT >= #MAXWEIGHT ; Seguro de peso. { event sysmessage ESTO PESA MUCHO!! :-( EXEVENT dropC %_itemLocation wait 15 halt } EXEVENT dropC %_newItemLocation WAIT 15 set %count %count + 1 GOTO moveLoop } RETURN }