From 91ef70d2c73bc3fd83bbb9905473e106d6270cd1 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Thu, 11 Jun 2020 12:12:39 +0900 Subject: [PATCH] Fix bug with missing a step to buff counters with Tricks of The Trade --- autocraft.ahk | 40 ++++++++++++++++++++++++++++++++-------- autocraft.exe | Bin 1129984 -> 1130496 bytes 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/autocraft.ahk b/autocraft.ahk index bae2dcb..6e13d55 100644 --- a/autocraft.ahk +++ b/autocraft.ahk @@ -136,6 +136,18 @@ WaitForCraftingWindow() { } } +ChooseConserveBestProgressStep(ByRef step,ByRef cp,cp_save,ByRef durability,stepcount=1) { + if (cp-cp_save >= 32) { + StandardTouch(step,cp,durability,stepcount) + } else + if (cp-cp_save >= 18) { + BasicTouch(step,cp,durability,stepcount) + } else + { + HastyTouch(step,cp,durability,stepcount) + } +} + ChooseBestProgressStep(ByRef step,ByRef cp,ByRef durability,stepcount=1) { ;Stdout("Choosing progress step... " . step . "/" . cp . "/" . durability) if (cp >= 32) { @@ -312,7 +324,7 @@ StrongCraft60(ByRef STEP) { GreatStrides(STEP,CP,DURABILITY,0) } if (IsGood() or IsExcellent()) { - ChooseBestProgressStep(STEP,CP,DURABILITY,0) + ChooseConserveBestProgressStep(STEP,CP,18,DURABILITY,0) } STEP := 3 Case 3: @@ -320,7 +332,7 @@ StrongCraft60(ByRef STEP) { Innovation(STEP,CP,DURABILITY,0) } if (GREATSTRIDES > 0 or CP <= 32) { - ChooseBestProgressStep(STEP,CP,DURABILITY,0) + ChooseConserveBestProgressStep(STEP,CP,18,DURABILITY,0) } STEP := 2 } @@ -338,11 +350,11 @@ LongCraft60(ByRef STEP) { loop { if (IsMaxQuality()) { - STEP := 99 - RECIPEDONE := true Veneration(STEP,CP,DURABILITY,0) BasicSynthesis(STEP,CP,DURABILITY,0) BasicSynthesis(STEP,CP,DURABILITY) + STEP := 99 + RECIPEDONE := true } Switch STEP { @@ -366,15 +378,20 @@ LongCraft60(ByRef STEP) { } Innovation(STEP,CP,DURABILITY) Case 9,10,11,12: - BasicTouch(STEP,CP,DURABILITY) + if (CP >= 36) { + BasicTouch(STEP,CP,DURABILITY) + } else { + HastyTouch(STEP,CP,DURABILITY) + } Case 13: if (DURABILITY <= 20) { - if (CP >= 56) { + if (CP >= 74) { WasteNot(STEP,CP,DURABILITY,0) loop { - ChooseBestProgressStep(STEP,CP,DURABILITY,0) + ChooseConserveBestProgressStep(STEP,CP,18,DURABILITY,0) } until (DURABILITY = 10 or IsMaxQuality()) } + Veneration(STEP,CP,DURABILITY,0) BasicSynthesis(STEP,CP,DURABILITY,0) BasicSynthesis(STEP,CP,DURABILITY) } else { @@ -439,7 +456,11 @@ CraftingRotation(ByRef STEP) { Case 5: if (DURABILITY > 10) { if (IsExcellent() or IsGood()) { - BasicTouch(STEP,CP,DURABILITY) + if (CP >= 18) { + BasicTouch(STEP,CP,DURABILITY) + } else { + HastyTouch(STEP,CP,DURABILITY) + } } else { if (DURABILITY = 20 and CP >= 18) { @@ -731,6 +752,9 @@ TricksOfTheTrade(ByRef cp) { if (IsGood() and KeyPressAllowed()) { PressKeyWithModifier("Ctrl","2") cp := cp + 20 + tempstep := 0 + tempcp := 0 + ProgressStep(tempstep,tempcp,0) loop { sleep, 250 } until ActionReady() diff --git a/autocraft.exe b/autocraft.exe index 125c3cda582f3f4128d7dcde96513edf4d5a446f..24c26920fdc33890a01a177c1dff392be468591e 100644 GIT binary patch delta 529 zcmZqpRJy1|f<@zrD_#ww;M%QvrMv|{9%vYdf|!9kFLVMX&NruI)vj6e*cnSq!E zh*^P{4T#x+m;;D8ftU-3xq+Amh*KY#O2wulGfz0h+z6!|l!1W&F7L;N#w3x2RB-n;7 zxcxYjAV1^OOM=I?&tVZvVC2b6Q_ye@P_VOAFgBZ>!!4*eJ%LkDWx6z*pf;K@)@&EvPDQ8Xq