Skip to content

Commit 5d8ab41

Browse files
committed
league parsing/propecy/fractured item fixes
1 parent 7e78b50 commit 5d8ab41

File tree

5 files changed

+71
-10
lines changed

5 files changed

+71
-10
lines changed

resources/Updates_Trade.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
The following is a list of what has been updated, starting with 1.1.0
22

3+
2.14.2
4+
================================================================================================
5+
* Fixed event leagues not being parsed and therefore not being available in the league selection.
6+
37
2.14.1
48
================================================================================================
59
* Hotfixed the parsing of crafted mords (advanced search) which was broken in PoE 3.6.

resources/VersionTrade.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
TradeReleaseVersion := "v2.14.1"
1+
TradeReleaseVersion := "v2.14.2"
22
TradeAHKVersionRequired := "1.1.26.00"

resources/ahk/POE-ItemInfo.ahk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ class Item_ {
346346
This.GemColor := ""
347347
This.veiledPrefixCount := ""
348348
This.veiledSuffixCount := ""
349+
This.fracturedModsCount := ""
349350

350351
This.HasImplicit := False
351352
This.HasEnchantment := False
@@ -8096,7 +8097,10 @@ ParseItemData(ItemDataText, ByRef RarityLevel="")
80968097
If (Item.IsLeagueStone or Item.IsScarab) {
80978098
ItemDataIndexAffixes := ItemDataIndexAffixes - 1
80988099
}
8099-
If (Item.IsBeast) {
8100+
Else If (Item.IsProphecy) {
8101+
ItemDataIndexAffixes := ItemDataIndexAffixes - 1
8102+
}
8103+
Else If (Item.IsBeast) {
81008104
ItemDataIndexAffixes := ItemDataIndexAffixes - 1
81018105
}
81028106
ItemData.Affixes := RegExReplace(ItemDataParts%ItemDataIndexAffixes%, "[\r\n]+([a-z])", " $1")
@@ -8151,6 +8155,9 @@ ParseItemData(ItemDataText, ByRef RarityLevel="")
81518155
{
81528156
ParseAffixes(ItemData.Affixes, Item)
81538157
}
8158+
Else If (Item.IsProphecy) {
8159+
ParseAffixes(ItemData.Affixes, Item)
8160+
}
81548161
Else If (RarityLevel > 1 and RarityLevel < 4 and Item.IsMap = True)
81558162
{
81568163
MapModWarnings := ParseMapAffixes(ItemData.Affixes)
@@ -8180,6 +8187,7 @@ ParseItemData(ItemDataText, ByRef RarityLevel="")
81808187
Item.BaseName := ItemBaseName
81818188

81828189
pseudoMods := PreparePseudoModCreation(ItemData.Affixes, Item.Implicit, RarityLevel, Item.isMap)
8190+
fracturedModsCount := ; can't be reliably determined that easily since a hybrid mod (which counts as as single ractured mod) gets displayed as two fractured mods in the item data
81838191

81848192
; Start assembling the text for the tooltip
81858193
TT := Item.Name

resources/ahk/TradeMacro.ahk

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -689,10 +689,10 @@ TradeFunc_Main(openSearchInBrowser = false, isAdvancedPriceCheck = false, isAdva
689689
If (s.mods[A_Index].selected > 0) {
690690
modParam := new _ParamMod()
691691

692-
If (s.mods[A_Index].spawntype = "fractured" and s.inlcudeFractured) {
692+
If (s.mods[A_Index].spawntype = "fractured" and s.includeFractured) {
693693
modParam.mod_name := TradeFunc_FindInModGroup(TradeGlobals.Get("ModsData")["fractured"], s.mods[A_Index])
694694
}
695-
695+
696696
If (not StrLen(modParam.mod_name)) {
697697
modParam.mod_name := s.mods[A_Index].param
698698
}
@@ -702,6 +702,19 @@ TradeFunc_Main(openSearchInBrowser = false, isAdvancedPriceCheck = false, isAdva
702702
RequestParams.modGroups[1].AddMod(modParam)
703703
}
704704
}
705+
If (s.includeFracturedCount and s.fracturedCount > 0) {
706+
modParam := new _ParamMod()
707+
modParam.mod_name := "(pseudo) # Fractured Modifiers" ; TradeFunc_FindInModGroup(TradeGlobals.Get("ModsData")["pseudo"], "# Fractured Modifiers")
708+
/*
709+
_tmpitem := {}
710+
_tmpitem.mods := []
711+
_tmpitem.mods.push({name : "# Fractured Modifiers"})
712+
modParam.mod_name := TradeFunc_GetItemsPoeTradeMods(_tmpitem)
713+
*/
714+
modParam.mod_min := s.fracturedCount
715+
modParam.mod_max := s.fracturedCount
716+
RequestParams.modGroups[1].AddMod(modParam)
717+
}
705718
Loop % s.stats.Length() {
706719
If (s.stats[A_Index].selected > 0) {
707720
; defense
@@ -1307,6 +1320,22 @@ TradeFunc_Main(openSearchInBrowser = false, isAdvancedPriceCheck = false, isAdva
13071320
;Item.UsedInSearch.abyssJewel := 1
13081321
}
13091322
}
1323+
1324+
/*
1325+
prophecies
1326+
*/
1327+
If (Item.IsProphecy and RegExMatch(Item.Name, "i)A Master seeks Help")) {
1328+
_tempItem := {}
1329+
_tempItem.name_orig := "(prophecy) " ItemData.Affixes
1330+
_tempItem.name := "(prophecy) " ItemData.Affixes
1331+
_tempItem.param := "(prophecy) " ItemData.Affixes
1332+
1333+
modParam := new _ParamMod()
1334+
modParam.mod_name := _tempItem.param
1335+
modParam.mod_min :=
1336+
modParam.mod_max :=
1337+
RequestParams.modGroups[1].AddMod(modParam)
1338+
}
13101339

13111340
/*
13121341
predicted pricing (poeprices.info - machine learning)
@@ -5101,6 +5130,12 @@ TradeFunc_AdvancedPriceCheckGui(advItem, Stats, Sockets, Links, UniqueStats = ""
51015130

51025131
GuiAddPicture(A_ScriptDir "\resources\images\info-blue.png", "x+-" 193 " yp+" fracturedImageShift - 1 " w15 h-1 0x0100", "FracturedInfo", "FracturedInfoH", "", "", "SelectModsGui")
51035132
AddToolTip(LblFracturedInfoH, "Includes selected fractured mods with their ""fractured"" porperty`n instead of as normal mods.")
5133+
5134+
GuiAddText("Fractured mods count", "x" RightPosText " y+10 right w130 0x0100", "LblFracturedCount", "LblFracturedCountH", "", "", "SelectModsGui")
5135+
Gui, SelectModsGui:Add, CheckBox, x%RightPos% yp+0 vTradeAdvancedSelectedFracturedCount Checked, % " "
5136+
Gui, SelectModsGui:Add, Edit , x+1 yp-4 w30 vTradeAdvancedFracturedCount ,
5137+
GuiAddPicture(A_ScriptDir "\resources\images\info-blue.png", "x+-" 193 " yp+" 3 " w15 h-1 0x0100", "FracturedCount", "FracturedCountH", "", "", "SelectModsGui")
5138+
AddToolTip(LblFracturedCountH, "The correct number of fractured mods can't be determined from the item data reliably.`n`nMake sure to check it by pressing ""Alt"" when hovering over your item, `nwhich requires ""Advanced Mod Descriptions"" to be enabled.")
51045139
}
51055140

51065141
If (ModNotFound) {
@@ -5266,6 +5301,8 @@ TradeFunc_ResetGUI() {
52665301
TradeAdvancedSelectedVeiledSuffix :=
52675302
TradeAdvancedVeiledSuffixCount :=
52685303
TradeAdvancedSelectedIncludeFractured :=
5304+
TradeAdvancedSelectedFracturedCount :=
5305+
TradeAdvancedFracturedCount :=
52695306

52705307
TradeGlobals.Set("AdvancedPriceCheckItem", {})
52715308
}
@@ -5342,7 +5379,9 @@ TradeFunc_HandleGuiSubmit() {
53425379
newItem.veiledPrefixCount := TradeAdvancedVeiledPrefixCount
53435380
newItem.useVeiledSuffix := TradeAdvancedSelectedVeiledSuffix
53445381
newItem.veiledSuffixCount := TradeAdvancedVeiledSuffixCount
5345-
newItem.inlcudeFractured := TradeAdvancedSelectedIncludeFractured
5382+
newItem.includeFractured := TradeAdvancedSelectedIncludeFractured
5383+
newItem.includeFracturedCount := TradeAdvancedSelectedFracturedCount
5384+
newItem.fracturedCount := TradeAdvancedFracturedCount
53465385

53475386
TradeGlobals.Set("AdvancedPriceCheckItem", newItem)
53485387
Gui, SelectModsGui:Destroy
@@ -5645,7 +5684,7 @@ ReadPoeNinjaCurrencyData:
56455684
fallBackDir := A_ScriptDir . "\data_trade"
56465685
url := "https://poe.ninja/api/Data/GetCurrencyOverview?league=" . league
56475686
parsedJSON := CurrencyDataDownloadURLtoJSON(url, sampleValue, false, isFallback, league, "PoE-TradeMacro", file, fallBackDir, usedFallback, loggedCurrencyRequestAtStartup, loggedTempLeagueCurrencyRequest, TradeOpts.CurlTimeout)
5648-
5687+
56495688
; fallback to Standard and Hardcore league if used league seems to not be available
56505689
If (!parsedJSON.currencyDetails.length()) {
56515690
isFallback := true

resources/ahk/TradeMacroInit.ahk

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ ReadTradeConfig("", "config_trade.ini", _updateConfigWrite)
141141
TradeGlobals.Set("LeagueName", TradeGlobals.Get("Leagues")[TradeOpts.SearchLeague])
142142

143143
TradeFunc_CheckIfCloudFlareBypassNeeded()
144+
; call it again (TradeFunc_CheckIfCloudFlareBypassNeeded reads poetrades available leagues but can't be called before the first TradeFunc_GetLeagues call at the moment (bad coding))
145+
TradeGlobals.Set("Leagues", TradeFunc_GetLeagues())
144146

145147
; set this variable to skip the update check in "PoE-ItemInfo.ahk"
146148
SkipItemInfoUpdateCall := 1
@@ -391,7 +393,7 @@ TradeFunc_GetLeagues() {
391393
standard := "standard"
392394

393395
For key, val in LeaguesData {
394-
If (!val.event and not RegExMatch(val.id, "i)^SSF")) {
396+
If (not val.event and not RegExMatch(val.id, "i)^SSF")) {
395397
If (val.id = standard) {
396398
leagues[standard] := val.id
397399
}
@@ -405,9 +407,17 @@ TradeFunc_GetLeagues() {
405407
leagues["tmp" standard] := val.id
406408
}
407409
}
410+
Else If (val.event and not RegExMatch(val.id, "i)^SSF")) {
411+
If (InStr(val.id, " HC ")) {
412+
leagues["event" hardcore] := val.id
413+
}
414+
Else {
415+
leagues["event" standard] := val.id
416+
}
417+
}
408418
Else {
409419
For i, value in poeTradeLeagues {
410-
If (value = val.id) {
420+
If (value = val.id and not RegExMatch(value, "i)^PS4|^XBOX")) {
411421
trimmedValue := Format("{:L}", RegExReplace(value, "i)\s", ""))
412422
leagues[trimmedValue] := value
413423
}
@@ -419,7 +429,7 @@ TradeFunc_GetLeagues() {
419429
; make sure there are no duplicate temp leagues (hardcoded keys)
420430
For j, value in poeTradeLeagues {
421431
trimmedValue := Format("{:L}", RegExReplace(value, "i)\s", ""))
422-
If (not leagues[trimmedValue]) {
432+
If (not leagues[trimmedValue] and not RegExMatch(value, "i)^PS4|^XBOX")) {
423433
found := false
424434
For i, l in leagues {
425435
If (value = l) {
@@ -431,7 +441,7 @@ TradeFunc_GetLeagues() {
431441
}
432442
}
433443
}
434-
444+
435445
Return leagues
436446
}
437447

0 commit comments

Comments
 (0)