From 3e2641cf9ddf35e24abe4815e9a32fa5e3fd6204 Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Sun, 18 Apr 2021 12:33:19 +0200 Subject: [PATCH 1/4] first try at fixing trademacro for ultimatum league# --- resources/ahk/POE-ItemInfo.ahk | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/resources/ahk/POE-ItemInfo.ahk b/resources/ahk/POE-ItemInfo.ahk index 24375da0..faeb7d62 100644 --- a/resources/ahk/POE-ItemInfo.ahk +++ b/resources/ahk/POE-ItemInfo.ahk @@ -7365,24 +7365,12 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" Loop, Parse, ItemDataChunk, `n, `r { - If (A_Index == 1) - { - IfNotInString, A_LoopField, Rarity: - { - return - } - Else - { - Continue - } - } - If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 3) { return } - If (A_Index = 2) + If (A_Index = 1) { If InStr(A_LoopField, ">>") { @@ -7433,6 +7421,17 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" } } } + If (A_Index == 2) + { + IfNotInString, A_LoopField, Rarity: + { + return + } + Else + { + Continue + } + } If (A_Index = 3) { ItemBaseName := A_LoopField From 116dfa4eb9ade6b131ed650c4507094eecc67b1c Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Sun, 18 Apr 2021 13:01:43 +0200 Subject: [PATCH 2/4] fix issue with name detection --- resources/ahk/POE-ItemInfo.ahk | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/ahk/POE-ItemInfo.ahk b/resources/ahk/POE-ItemInfo.ahk index faeb7d62..f220f1fb 100644 --- a/resources/ahk/POE-ItemInfo.ahk +++ b/resources/ahk/POE-ItemInfo.ahk @@ -7365,12 +7365,23 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" Loop, Parse, ItemDataChunk, `n, `r { - If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 3) + If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 4) { return } - If (A_Index = 1) + If (A_Index == 2) + { + IfNotInString, A_LoopField, Rarity: + { + return + } + Else + { + Continue + } + } + If (A_Index = 3) { If InStr(A_LoopField, ">>") { @@ -7421,18 +7432,7 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" } } } - If (A_Index == 2) - { - IfNotInString, A_LoopField, Rarity: - { - return - } - Else - { - Continue - } - } - If (A_Index = 3) + If (A_Index = 4) { ItemBaseName := A_LoopField } From d9e58dc42b2e8210d77b33053023d60138ea6935 Mon Sep 17 00:00:00 2001 From: Florian Roks Date: Sun, 18 Apr 2021 13:03:47 +0200 Subject: [PATCH 3/4] it's = and not == in autohotkey --- resources/ahk/POE-ItemInfo.ahk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/ahk/POE-ItemInfo.ahk b/resources/ahk/POE-ItemInfo.ahk index f220f1fb..2423594d 100644 --- a/resources/ahk/POE-ItemInfo.ahk +++ b/resources/ahk/POE-ItemInfo.ahk @@ -7370,7 +7370,7 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" return } - If (A_Index == 2) + If (A_Index = 2) { IfNotInString, A_LoopField, Rarity: { From a6caf2ee607c50c32af8dda95e53c9e4cbb8b16c Mon Sep 17 00:00:00 2001 From: Benjamin Riedel Date: Mon, 2 Aug 2021 15:42:45 +0200 Subject: [PATCH 4/4] adapting new iteminfo format for 3.15 --- resources/ahk/POE-ItemInfo.ahk | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/resources/ahk/POE-ItemInfo.ahk b/resources/ahk/POE-ItemInfo.ahk index 2423594d..f5df9d7e 100644 --- a/resources/ahk/POE-ItemInfo.ahk +++ b/resources/ahk/POE-ItemInfo.ahk @@ -6943,6 +6943,7 @@ PreProcessContents(CBContents) ; Remove the line that indicates an item cannot be used due to missing character stats ; Matches "Rarity: ..." + anything until "--------"\r\n + CBContents:= SubStr(CBContents, InStr(CBContents,"`n") + 1) If (RegExMatch(CBContents, "s)^(.+?:.+?\r\n)(.+?-{8}\r\n)(.*)", match)) { ; Matches any ".", looking for the 2 sentences saying "You cannot use this item. Its stats will be ignored." ; Could be improved, should suffice though because the alternative would be the item name/type, which can't have any dots. @@ -7365,12 +7366,7 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" Loop, Parse, ItemDataChunk, `n, `r { - If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 4) - { - return - } - - If (A_Index = 2) + If (A_Index == 1) { IfNotInString, A_LoopField, Rarity: { @@ -7381,7 +7377,13 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" Continue } } - If (A_Index = 3) + + If (StrLen(A_LoopField) == 0 or A_LoopField == "--------" or A_Index > 3) + { + return + } + + If (A_Index = 2) { If InStr(A_LoopField, ">>") { @@ -7432,7 +7434,7 @@ ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "" } } } - If (A_Index = 4) + If (A_Index = 3) { ItemBaseName := A_LoopField } @@ -13408,4 +13410,4 @@ ShowHotKeyConflictUI(hkeyObj, hkey, hkeyLabel, oldLabel = "", preventedAssignmen ; ############ (user) macros ############# -; macros are being appended here by merge script \ No newline at end of file +; macros are being appended here by merge script