; | / \ | . ; _ -O- . ) (( )) ( -O- ; (@) | + /|\ ))_(( /|\ | . ; |-| / | \ (/\|/\) / | \ (@) ; | | --------------------------/--|-voV---\`|'/--Vov-|--\---------------------------|-| . ; |-| '^` (o o) '^` | | ; | | `\Y/' |-| ; |-| _______ __ __ __ _______ __ __ | | ; | | | | | | |_|__|.--------.---.-.| _ | |__|.---.-.-----.-----.---.-. |-| . o ; |-| | | | | _| || | _ || | | || _ | |-- __| _ | | | ; | | |_______|__|____|__||__|__|__|___._||___|___|__|__||___._|__|__|_____|___._| |-| ; |_|________________________________________________________________________________| | ; (@) l /\ / ( ( \ /\ l `\|-| . ; o l / V \ \ V \ l + (@) ; l/ _) )_ \I + ; + `\ /' ; ; Script Name: Nigromante [ MODO Liche ] ; _..._ ; .' '. ; ; __ __ ; ; |/ \ / \| ; |\| -- ' -- |/| ; |(| \o| |o/ |)| ; _\| > |/_ ; .-' | ,.___., | '-. ; \ ; V'-'V ; / ; `\ \ / /` ; `\ '-...-' /` ; `\ / \ /` ; jgs `\\_//` ; ; Author: Sthil Lauda (Original de Nilaween) ; 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: 30/12/2019 ; Public Release: 17/04/2020 ; Purpose: Entrena nigromancia en la ciudad de Wind, comprando regs a la pareja de Drakos del medio, o con los que andan sueltos por ahí. ; Requisitos: ; - Para activar el modo "liche" hacen falta 40 puntos de Spirit Speak (ir al sabiondo de Wrong). ; - IMPORTANTE: Poner el maná máximo de tu Liche en %max_mana_liche . ; - Es recomendable un bastón de clérigo para acelerar el maná. ; - Es recomendable collar y anillo de inteligencia/medit para acelerar el maná. ; - Es recomendable tener a 100 la habilida de Concentración/Focus, para acelerar el maná y la vida del liche. ; - No te olvides de tener comida en la mochila, y dinero en el banco... :D ;________________________________ ; ; /////////////////////////////// ; ******** CONFIGURACIÓN ******** ; /////////////////////////////// ;________________________________ ; set %typearma TSF_WSF ; Dagas. set %max_mana_liche 145 ; El máximo de maná que tienes cuando eres un liche. set %tiempo_comer 360 ; Cada cuántos segundos comprobar la comida. set %tiempo_ronda 1060 ; Recarga de regs en los vendors. ;________________________________________________ ; ; ////////////////////////////////////////////// ; ************* FIN CONFIGURACIÓN ************* ; ////////////////////////////////////////////// ;________________________________________________ ; set %ronda_timer_drako1 #SCNT set %ronda_timer_drako2 #SCNT 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 %bastones QMH_ZPF_CQF_PMH set %joya_collar SJG set %joya_brazalete IJG set %joya_anillo UJG set %proxima_vez_comer #SCNT set %VENDOR_DRAKE1 N/A set %VENDOR_DRAKE2 N/A set %ultimo_vendor N/A 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. display ok Macro by Nilaween. set #SYSMSGCOL 88 event sysmessage ======================== set #SYSMSGCOL 53 event sysmessage Nigromante 'MOD Sthil' set #SYSMSGCOL 88 event sysmessage ======================== wait 40 chooseskill necr real set %skill_recro #SKILL chooseskill Spir Real set %skill_spirit #SKILL chooseskill Focu real set %skill_focus #SKILL if %skill_recro >= 1000 { set #SYSMSGCOL 88 event sysmessage Ya somos GM Nigro! :D wait 20 set #SYSMSGCOL 43 event sysmessage Fin del macreo... [ HALT ] halt } if %skill_spirit < 400 { display OK ¡ Te faltan 40 puntos de Spirit Speak ! $$ +¡ Son necesarios si quieres transformarte en Liche ! set #SYSMSGCOL 38 event sysmessage [ OK ] Desactivando "Modo LICHE" :-( wait 20 } else { set #SYSMSGCOL 1570 event sysmessage [ OK ] Activando "Modo LICHE" :D wait 1s } finditem %bastones C_ , #CHARID ; Bastón de clérigo :D if #FINDCNT = 0 { finditem %bastones C_ , #BACKPACKID if #FINDCNT = 0 { display OK ¡ No tienes ningún bastón en la mochila ! $$ +¡ Te conviene llevar uno de Clérigo / Medit ! set #SYSMSGCOL 43 event sysmessage [ OK ] Sin ayuda de un BASTON :-( wait 20 } else { set #SYSMSGCOL 1570 event sysmessage [ OK ] BASTON detectado... :D wait 1s } } else { set #SYSMSGCOL 1570 event sysmessage [ OK ] BASTON detectado... :D wait 1s } finditem %joya_collar C_ , #CHARID ; Buscamos el collar en el personaje, if #FINDCNT = 0 ; Si no lo llevamos puesto, { finditem %joya_collar C_ , #BACKPACKID if #FINDCNT > 0 { set #SYSMSGCOL 1570 event sysmessage [ OK ] COLLAR detectado... :D set %collar #FINDID wait 1s } } else { set #SYSMSGCOL 1570 event sysmessage [ OK ] COLLAR detectado... :D wait 1s } finditem %joya_anillo C_ , #CHARID ; Buscamos el anillo en el personaje, if #FINDCNT = 0 ; Si no lo llevamos puesto, { finditem %joya_anillo C_ , #BACKPACKID if #FINDCNT > 0 { set #SYSMSGCOL 1570 event sysmessage [ OK ] ANILLO detectado... :D set %anillo #FINDID wait 1s } } else { set #SYSMSGCOL 1570 event sysmessage [ OK ] ANILLO detectado... :D wait 1s } if %skill_focus < 1000 { display OK ¡ No tienes la habilidad "Concentración/Focus" ! $$ +¡ Te conviene para regenerar el maná rápidamente ! set #SYSMSGCOL 43 event sysmessage [ OK ] Regenerando mana por otros medios... :-( wait 20 } else { set #SYSMSGCOL 1570 event sysmessage [ OK ] Regenerando mana con FOCUS :D wait 1s } _restartVendors: finditem YE if #FINDCNT > 0 { for #FINDINDEX 1 #FINDCNT { set %vendor_drake . #FINDINDEX #FINDID set #SYSMSGCOL 1997 event sysmessage VENDOR [ #FINDINDEX ]: %vendor_drake . #FINDINDEX wait 20 } } else { set #SYSMSGCOL 38 event sysmessage NO HAY VENDORS! :-( halt } finditem %typearma C_ , #BACKPACKID set %num_armas #FINDCNT for %a 1 %num_armas { set %arma . %a #FINDID set #FINDINDEX #FINDINDEX + 1 } set %a 1 magia: if %skill_recro >= 1000 { set #SYSMSGCOL 88 event sysmessage Ya somos GM Nigro! :D halt } gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 set %pre_medit #TRUE repeat finditem YZF C_ , #BACKPACKID set %num_arrabio #FINDSTACK finditem FUF C_ , #BACKPACKID set %num_azufre #FINDSTACK finditem VZF C_ , #BACKPACKID set %num_obsidiana #FINDSTACK finditem TZF C_ , #BACKPACKID set %num_ceniza #FINDSTACK if ( %num_arrabio = 0 || %num_azufre = 0 || %num_obsidiana = 0 || %num_ceniza = 0 ) { if %num_arrabio = 0 { if ( #SCNT >= %ronda_timer_drako1 && %VENDOR_DRAKE1 <> N/A ) || ( #SCNT >= %ronda_timer_drako2 && %VENDOR_DRAKE2 <> N/A ) { set #SYSMSGCOL 73 event sysmessage COMPRANDO ARRABIO... gosub comprar ; Regs para maldecir el arma. goto magia } else { set #SYSMSGCOL 88 if %VENDOR_DRAKE1 <> N/A { set %cuando_toca_drako1 %ronda_timer_drako1 - #SCNT event sysmessage ESPERANDO DRAKO 1 [ %cuando_toca_drako1 ] } if %VENDOR_DRAKE2 <> N/A { set %cuando_toca_drako2 %ronda_timer_drako2 - #SCNT event sysmessage ESPERANDO DRAKO 2 [ %cuando_toca_drako2 ] } wait 15s gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 goto magia } } else { if ( %skill_recro >= 700 && %skill_spirit >= 400 ) && ( %num_azufre = 0 || %num_obsidiana = 0 || %num_ceniza = 0 ) { set #SYSMSGCOL 73 event sysmessage COMPRANDO AZUFRE, ETC... gosub comprar ; Regs para transformarnos en Liche. goto magia } } } if ( %skill_recro >= 700 && %skill_spirit >= 400 ) ; Nos podemos transformar en liche :D { if #MAXMANA < %max_mana_liche ; Ya no somos un liche. { set %tiempo_actual #SCNT if ( %proxima_vez_comer <= %tiempo_actual ) { gosub comprobar_comida } if #HITS <= 40 { set #SYSMSGCOL 43 event sysmessage RECARGANDO VIDA [ #HITS / #MAXHITS ] set %heal_time #SCNT + 10 repeat { wait 1 if #SCNT >= %heal_time { gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 set #SYSMSGCOL 43 event sysmessage RECARGANDO VIDA [ #HITS / #MAXHITS ] set %heal_time #SCNT + 10 } } until #HITS = #MAXHITS } _liche: set %jstart #jindex event macro 1 0 .nigro 11 ; ¡Modo Liche! gosub wait_for MSG El_hechizo_falla 50 if ( #TRUE in #RESULT ) { set #SYSMSGCOL 43 event sysmessage FALLO! :( wait 1s goto _liche } else { set %liche_time #SCNT + 10 while #MAXMANA < %max_mana_liche { set #SYSMSGCOL 11 event sysmessage ESPERANDO AL LICHE! :D wait 1s ; Esperar a la forma de liche. if #SCNT > %liche_time ; Si tarda demasiado es que hemos fallado... { set #SYSMSGCOL 43 event sysmessage FALLO! :( wait 1s ; Esperar a la forma de liche. goto _liche } } } goto medit ; Llenamos a tope el maná del liche. } } else { set %tiempo_actual #SCNT if ( %proxima_vez_comer <= %tiempo_actual ) { gosub comprobar_comida } } event macro 1 0 .nigro 04 set %mana #MANA set %a %a + 1 if %arma . %a = N/A set %a 1 set %tiempo #SYSTIME + 3000 set #LOBJECTID %arma . %a set %jEnd #JINDEX a: if ( #SYSTIME < %tiempo && #MANA >= %mana ) || COMIENZA_LA_GRABACION_DEL_MUNDO in #SYSMSG { wait 1 goto a } event macro 17 0 if ( %pre_medit && #MANA < #MAXMANA - 30 ) ; Meditar 1 vez mientras maldecimos el arma. { wait 20 set %pre_medit #FALSE event macro 13 46 wait 20 } until #MANA < 7 medit: _baston: finditem %bastones C_ , #BACKPACKID ; Bastón de clérigo :D if #FINDCNT > 0 { set #LOBJECTID #FINDID event macro 17 wait 30 goto _baston } _collar: finditem %collar C_ , #CHARID ; Buscamos el collar en el personaje, if #FINDCNT = 0 ; Si no lo llevamos puesto, { finditem %collar C_ , #BACKPACKID if #FINDCNT > 0 { exevent drag %collar exevent droppd wait 30 ; Modo agresivo, subir hasta 30 para suavizar. goto _collar } } _anillo: finditem %anillo C_ , #CHARID ; Buscamos el anillo en el personaje, if #FINDCNT = 0 ; Si no lo llevamos puesto, { finditem %anillo C_ , #BACKPACKID if #FINDCNT > 0 { exevent drag #FINDID exevent droppd wait 30 ; Modo agresivo, subir hasta 30 para suavizar. goto _anillo } } repeat { wait 1 } until #contname <> waiting_gump && #contname <> MainMenu_gump && #contname <> Login_gump && #contname <> normal_gump && %skill_recro < 1000 gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 set %jstart #jindex event macro 13 46 gosub wait_for MSG pierdes trance en_paz 50 if ( #TRUE in #result ) { if pierdes in #result { goto medit ; Meditamos hasta que no perdamos la concentración } if trance in #result { set %jstart #jindex gosub wait_for MSG pierdes en_paz 50 if ( #TRUE in #result ) { if pierdes in #RESULT { goto medit } if en_paz in #RESULT { goto magia } } else ; Meditamos hasta llenar la barra al máximo... { repeat { wait 20 gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 } until #MANA = #MAXMANA goto magia } } if en_paz in #result ; OK, estamos bien de maná. { goto magia } } else { goto medit } goto medit sub comprar chooseskill necr real set %skill_recro #SKILL ; Comprobar si tenemos habilidad para el Liche. chooseskill Spir Real set %skill_spirit #SKILL finditem %VENDOR_DRAKE1 if #FINDCNT > 0 { if ( %ultimo_vendor <> %VENDOR_DRAKE1 ) || ( #SCNT >= %ronda_timer_drako1 ) || ( %num_azufre = 0 && %skill_spirit >= 400 && %skill_recro >= 700 ) || ( %num_obsidiana = 0 && %skill_spirit >= 400 && %skill_recro >= 700 ) || ( %num_ceniza = 0 && %skill_spirit >= 400 && %skill_recro >= 700 ) || ( %VENDOR_DRAKE2 = N/A ) ; Sólo hay un vendor en la zona... { if %num_arrabio = 0 ; Si compramos todo el arrabio, alternamos de vendor... { set %ultimo_vendor %VENDOR_DRAKE1 } _reVendor1: repeat { gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 move #FINDX #FINDY 1 3s finditem %VENDOR_DRAKE1 } until #FINDDIST <= 3 gosub useVendor %VENDOR_DRAKE1 1 if ( #TRUE in #RESULT ) { set %current_vendor %VENDOR_DRAKE1 goto compra } else { goto _reVendor1 } } else { _vendor2: finditem %VENDOR_DRAKE2 if #FINDCNT > 0 { if ( %ultimo_vendor <> %VENDOR_DRAKE2 ) || ( #SCNT >= %ronda_timer_drako2 ) || ( %num_azufre = 0 && %skill_spirit >= 400 && %skill_recro >= 700 ) || ( %num_obsidiana = 0 && %skill_spirit >= 400 && %skill_recro >= 700 ) || ( %num_ceniza = 0 && %skill_spirit >= 400 && %skill_recro >= 700 ) { if %num_arrabio = 0 ; Si compramos todo el arrabio, alternamos de vendor... { set %ultimo_vendor %VENDOR_DRAKE2 } _reVendor2: repeat { gosub CEOWorldSaveChecker Dentro_de_1_minuto grabacion_del_mundo bases_de_datos 45 120 move #FINDX #FINDY 1 3s finditem %VENDOR_DRAKE2 } until #FINDDIST <= 3 gosub useVendor %VENDOR_DRAKE2 1 if ( #TRUE in #RESULT ) { set %current_vendor %VENDOR_DRAKE2 goto compra } else { goto _reVendor2 } } } else { set #SYSMSGCOL 38 event sysmessage NO HAY VENDORS! :-( wait 20 set #SYSMSGCOL 43 event sysmessage REINICIANDO MACRO... wait 20 goto _restartVendors } } } else ; No encontramos el primer vendor... :-( { goto _vendor2 } compra: gosub gump 3000 800_590 medit if %num_arrabio = 0 { gosub click 375 450 dmc ; 200 de Arrabio. gosub gump 3000 800_590 medit } if %skill_recro >= 700 && %skill_spirit >= 400 ; Regs para transformarnos en Liche. { if %num_azufre = 0 { gosub click 417 195 dmc ; 5 de Azufre. gosub gump 3000 800_590 medit } if %num_obsidiana = 0 { gosub click 417 372 dmc ; 5 de Obsidiana. gosub gump 3000 800_590 medit } if %num_ceniza = 0 { gosub click 404 537 dmc ; Siguiente página... gosub gump 3000 800_590 medit gosub click 417 195 dmc ; 5 de Ceniza Volcánica. gosub gump 3000 800_590 medit } } gosub click 600 535 dmc ; OKAY comprar. wait 10 if %num_arrabio = 0 ; Necesitábamos todo el arrabio del vendor... { if %current_vendor = %VENDOR_DRAKE1 { set %ronda_timer_drako1 #SCNT + %tiempo_ronda ; Tiempo de recarga del 1er vendor } else { if %current_vendor = %VENDOR_DRAKE2 { set %ronda_timer_drako2 #SCNT + %tiempo_ronda ; Tiempo de recarga del 2º vendor } } } return sub gump set %tiempo #SYSTIME + %1 repeat if %tiempo < #SYSTIME goto %3 until #CONTSIZE = %2 return sub click set %clickx #CONTPOSX + %1 set %clicky #CONTPOSY + %2 click %clickx %clicky %3 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_comer %tiempo_actual + %tiempo_comer 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_comer %tiempo_actual + %tiempo_comer } } else ; Mensaje extraño, repetimos... { goto hambriento } } } return } ; FIN While } return ;-@ ============================== @-; ;-@ ############################## @-; ;-@ SUBS públicos del Foro EasyUO @-; ;-@ ############################## @-; ;-@ ============================== @-; ; ;----------------------------------------------------------- ; 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_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 ;=============================== ;* @name useVendor ;* @author Quintok ;* @ver 1.0 13 march 04 ;* @purpose opens context menu and clicks the correct option ;* @param %1 vendor id ;* %2 which option to pick on the context menu sub useVendor namespace push namespace local Quintok set !useVendorCnt 0 set !vendorID %1 set !_contextOption %2 set !VendorX -4 set !VendorY -54 _useVendorLoop: ;finditem !vendorID G ;if #findkind = -1 ; { ; namespace pop ; return #false ; } gosub clickScreenXYZ #findx #findy #findz !vendorX !vendorY ;if paper_doll in #contname ; gosub clickScreenXYZ #findx #findy #findz !vendorX !vendorY gosub clickContextMenuOption !_contextOption if ! #result { set !useVendorCnt !useVendorCnt + 1 if !useVendorCnt > 0 ; 6 { namespace pop return #false } set !VendorX !VendorX + 2 set !VendorY !VendorY + 2 goto _useVendorLoop } namespace pop return #true ;=============================== ;* Convert 3D world coordinates to 2D screen coordinates. ;* ;* @purpose Convert 3D world coordinates to 2D screen coordinates. ;* @author the.WZA (namespace edit by Quintok) ;* @param %1 worldx req World x-coordinate. ;* %2 worldy req World y-coordinate. ;* %3 worldz req World z-coordinate. ;* @return %_cursorX and %_cursorY holds the screen coordinates. ;* @see clickScreenXYZ checkScreenXY sub worldXYZToScreenXY set %1 ( %1 - #charPosX ) * 22 set %2 ( #charPosY - %2 ) * 22 set !_cursorX #cliLeft + #cliXRes / 2 + %1 + %2 set !_cursorY #cliTop + #cliYRes / 2 + %1 - %2 - ( %3 - #charPosZ ) * 4 return ;=============================== ;* Clicks on the screen given by world coordinates (with displacement). ;* Initialize the following variables: %_cursorX, %_cursorY. ;* ;* @purpose Clicks on the screen given by world coordinates (with displacement). ;* @author ScriptFellow (namespace edit by Quintok) ;* @param %1 worldx req World x-coordinate. ;* %2 worldy req World y-coordinate. ;* %3 worldz req World z-coordinate. ;* %4 xdisp opt x displacement (to be added to the screen coordinate). ;* %5 ydisp opt y displacement (to be added to the screen coordinate). ;* %6 click1 opt click modifier: D, F, G, N, P, R or X (default if 'F') ;* %7 click2 opt X modifier ;* @return %outsideScreen (#true or #false ) ;* @see worldXYZToScreenXY checkScreenXY openContextMenu sub clickScreenXYZ if %0 < 4 || %4 = N/A set !_dx 0 else set !_dx %4 if %0 < 5 || %5 = N/A set !_dy 0 else set !_dy %5 if %0 < 6 || _ , %6 , _ notIn _D_F_G_N_P_R_X_ set !_clickType F else set !_clickType %6 gosub worldXYZToScreenXY %1 %2 %3 set !_cursorX !_cursorX + !_dx set !_cursorY !_cursorY + !_dy click !_cursorX !_cursorY !_clickType %clickMod wait 20 return ;=============================== ;* @name clickContextMenuOption ;* @author Quintok ;* @ver 1.0 13 march 04 ;* @purpose waits %4 seconds for # . %1 to %2 to %3 ;* @param %1 the number in the list sub clickContextMenuOption set !_vendorNumber %1 _clickContextMenuOptionLoop: gosub waitfor contsize = 71_60 2 if ! #result && #contname = status_gump && #contID = !vendorID { set !x #contposx + 15 set !y #contposy + 15 click !x !y r goto _clickContextMenuOptionLoop } if ! #result { if #contname = normal_gump && #contsize = 101_42 { gosub wait_for GUMP 101_42 CLOSE } else { if #contsize = 432_184 && #contID = !vendorID { gosub wait_for GUMP !vendorID CLOSE } } return #false } gosub _ensureContextSize !_vendorNumber if ! #result return #false set !x #contposx + 25 set !y #contposy + ( 18 * !_vendorNumber ) click !x !y f dmc wait 20 return #true ;=============================== ;* @name waitFor ;* @author Quintok ;* @ver 1.0 13 march 04 ;* @purpose waits %4 seconds for # . %1 to %2 to %3 ;* @param %1 system variable without '#' (req) ;* %2 operation ie = <> in notin (req) ;* %3 to compare with ie abcdef (req) ;* %4 timeout in seconds sub waitFor if %0 < 4 set !timeOut #scnt + 5 else set !timeOut #scnt + %4 _waitForLoop: if #scnt > !timeOut return #false if ! ( # . %1 %2 %3 ) goto _waitForLoop return #true ;=============================== ;* @name _ensureContextSize [internal] ;* @author Quintok ;* @ver 1.0 13 march 04 ;* @purpose make sure context menu could hold atleast %1 options ;* @param %1 the number in the list sub _ensureContextSize str pos #contsize _ set !right #strres - 1 str right #contsize !right set !contsize #strres if !contsize < ( 24 + 18 * %1 ) return #false return #true