3
« on: June 29, 2015, 08:38:13 AM »
Hi All,
I have working with a mining script the last couple of year that I found and tailored parts of it to fit my needs. I have had one on going error since the beginning which I just can not seem to get tracked down.
The script tinkers its own shovels and when the tinkering tools get down it makes new tinkering tool kits. The problem is that it fills the back pack with them! lol
I think its missing a counter or stop but I can not seem to figure it out. If you could take a look and tell me what is missing I would greatly appreciate it.
Thanks!
;*****************************************
;******** 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 135
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 455
If ! %LastMadeWasShovel
{
GoSub ClickTinkerButton 380 290
If %Return
{
GoSub ClickTinkerButtonNext
GoSub ClickTinkerButton 380 290
}
}
If %return
{
Set %LastMadeWasShovel #true
If %MakeTwoShovels
GoSub ClickTinkerButton 285 455
}
}
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_497 30
Gosub waitForSysVar contSize = 530_497 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_497 30
if ! %return
goto _butmTinkerMenu
Return