;***************************************** ;******** Tinkering ;***************************************** ; ** FindShovel ** ; Tries to find a shovel, if non are found will initial ; tinkering or recall back to home base Sub FindShovel GoSub UpdateStatusWindow FindShovel FindShovelStart: GoSub CheckEscapeStatus If %CheckEscapeStatus Return GoSub FindUsableMiningTool %BackpackId If #FindId = X { if %UseTinkering { If %TinkerSkill >= 900 Set %_fsIngotsNeeded 10 Else Set %_fsIngotsNeeded 20 FindItem %IngotType C_ , %BackpackId If #FindKind = -1 || #FindStack < %_fsIngotsNeeded GoSub UnloadAtBase #false GoSub MakeShovel Goto FindShovelStart } if ! %UseTinkering { GoSub UnloadAtBase #false Goto FindShovelStart } } Return ; ** MakeShovel ** ; Will make 1-2 shovels using tinkering - Using the menus or ; UOA macros if they have been setup Sub MakeShovel GoSub CheckEscapeStatus If %CheckEscapeStatus Return Set %_msTimeStart #sCnt2 GoSub UpdateStatusWindow MakeShovel FindItem %TinkerType C_ , %BackpackId Wait 5 If #FindKind <> -1 && #FindCnt = 1 { If %UOATinkerToolKey <> N/A { Key %UOATinkerToolKey %UOATinkerToolMod Wait %UOATinkerToolWait } If %UOATinkerToolKey = N/A { GoSub BringUpTinkerMenu #FindId Wait 10 GoSub ClickTinkerButton 30 110 If %return GoSub ClickTinkerButton 230 130 Set %LastMadeWasShovel #false } } FindItem %TinkerType C_ , %BackpackId If #FindKind <> -1 { If %UOAShovelKey <> N/A { Key %UOAShovelKey %UOAShovelMod Wait %UOAShovelWait } If %UOAShovelKey = N/A { GoSub BringUpTinkerMenu #FindId If %LastMadeWasShovel ; If the last thing we made was a shovel, its easy! GoSub ClickTinkerButton 285 410 If ! %LastMadeWasShovel { GoSub ClickTinkerButton 30 110 If %Return { GoSub ClickTinkerButtonNext GoSub ClickTinkerButton 230 70 } } If %return { Set %LastMadeWasShovel #true If %MakeTwoShovels GoSub ClickTinkerButton 285 410 } } Set %_msCancelX #ContPosX + 10 Set %_msCancelY #ContPosY + 10 Click %_msCancelX %_msCancelY R ; Close tinker menu } GoSub RecordTiming %_msTimeStart MakeShovel Return ; ** ClickTinkerButton ** Sub ClickTinkerButton Set %_ctbX %1 + #ContPosX Set %_ctbY %2 + #ContPosY Click %_ctbX %_ctbY Gosub waitForSysVar contSize <> 530_465 30 Gosub waitForSysVar contSize = 530_465 30 Wait 5 Return ; ** ClickTinkerButtonNoWait ** Sub ClickTinkerButtonNext Set %_ctbnX 385 + #ContPosX Set %_ctbnY 270 + #ContPosY Click %_ctbnX %_ctbnY F Wait 2s Return ; ** BringUpTinkerMenu ** ; Lag resistant opening of tinker menu ; Parameter 1: ID of tinker tool Sub BringUpTinkerMenu Set %_butmTinkerTool %1 Wait 5 ; A lot of times the tinker tool usage get 'You must wait...' _butmTinkerMenu: GoSub UseObject %_butmTinkerTool #false #false Gosub waitForSysVar contSize = 530_465 30 if ! %return goto _butmTinkerMenu Return