PoE-TradeMacro / POE-TradeMacro

Price checking script for Path of Exile.
https://poe-trademacro.github.io/
GNU General Public License v3.0
938 stars 189 forks source link

first try at fixing trademacro for ultimatum league #1177

Open froks opened 3 years ago

froks commented 3 years ago

It seems that the format in the clipboard changed and added a item class line at the beginning; no guarantee it works fully, it did for a few simple test items with this patch

froks commented 3 years ago

Seems there are still some issues with some item types (like uniques) looking into it -> should be fixed, we'll see if further issues come up

soockee commented 3 years ago

After a brief test for usual use-case with following Commands:

So this fix is a progress. thank you ! =)

roobrarcade commented 3 years ago

Working for me in game.

When I paste into POB (community fork) it seems to think a rare wand is a unique.

kekemeke commented 3 years ago

advanced search doesnt work for rare items ;d but work for uniq/magick.

anyway ty for the fix ;)

mataski commented 3 years ago

Doesn't read rare maps on CTRL+C, reads white and magic, but not rare.

Nivelm commented 3 years ago

I found a better solution https://github.com/PoE-TradeMacro/POE-TradeMacro/pull/1177#issuecomment-822774321

keep the original ParseItemName function untouched.

It seems that the format in the clipboard changed and added a item class line at the beginning; no guarantee it works fully, it did for a few simple test items with this patch

It seems that the format in the clipboard changed and added a item class line at the beginning; no guarantee it works fully, it did for a few simple test items with this patch

In POE-ItemInfo.ahk file ParseItemName(ItemDataChunk, ByRef ItemName, ByRef ItemBaseName, AffixCount = "", ItemData = "") { isVaalGem := false If (RegExMatch(Trim(ItemData.Parts[1]), "i)^Rarity: Gem") and RegExMatch(Trim(ItemData.Parts[2]), "i)Vaal")) { isVaalGem := true }

If (RegExMatch(ItemData.NamePlate, "i)Rarity\s?+:\s?+(Currency|Divination Card|Gem)", match)) {
    If (RegExMatch(match1, "i)Gem")) {
        ItemBaseName := Trim(RegExReplace(ItemName, "i) Support"))
    } Else {
        ItemBaseName := Trim(ItemName)
    }       
}

ItemDataChunk := SubStr(ItemDataChunk, InStr(ItemDataChunk,"`n") + 1)    ;   <----- new

Loop, Parse, ItemDataChunk, `n, `r
{

In the original file just insert this line before the loop: ItemDataChunk := SubStr(ItemDataChunk, InStr(ItemDataChunk,"`n") + 1) This does the same as your fix. No need to change the inside loop code. .

xkylieo commented 3 years ago

Just to clarify for people the file is resources\ahk and your replacing the code with with what he has above Should look like this Also leaving my fixed version download https://www.dropbox.com/s/l2qlh4vppwbs06l/POE-ItemInfo.ahk?dl=0

mataski commented 3 years ago

Just to clarify for people the file is resources\ahk and your replacing the code with with what he has above Should look like this Also leaving my fixed version download https://www.dropbox.com/s/l2qlh4vppwbs06l/POE-ItemInfo.ahk?dl=0

Any chance of working version on rare maps? CTRL+C only blue/white works.

Nivelm commented 3 years ago

I found a better solution that seems to work for everything, advanced search for rare items too.

https://github.com/PoE-TradeMacro/POE-TradeMacro/blob/eb20d12d1dc875c0bde6731d8b8193031309bffa/resources/ahk/POE-ItemInfo.ahk#L6940-L6945

Insert this line after ; --- Place fixes for data inconsistencies here ---

CBContents:= SubStr(CBContents, InStr(CBContents,"`n") + 1)    ;      <-- new fix

This removes the first line of clipboard content and "simulate" the previous leagues itemdata format.

Brasolis commented 3 years ago

I found a better solution that seems to work for everything, advanced search for rare items too.

https://github.com/PoE-TradeMacro/POE-TradeMacro/blob/eb20d12d1dc875c0bde6731d8b8193031309bffa/resources/ahk/POE-ItemInfo.ahk#L6940-L6945

Insert this line after ; --- Place fixes for data inconsistencies here ---

CBContents:= SubStr(CBContents, InStr(CBContents,"`n") + 1)    ;      <-- new fix

This removes the first line of clipboard content and "simulate" the previous leagues itemdata format.

How do I get this to save? I edit the file and reload the script and it just goes back to how it was before after it tries to update.

Nivelm commented 3 years ago

Close your POETrademacro if it is open Open with Notepad this file in your computer ...\Documents\POE-TradeMacro-2.16.0\resources\ahk\POE-ItemInfo.ahk (that path is an example) but the file is POE-ItemInfo.ahk Add that code line and rerun POETrademacro

Brasolis commented 3 years ago

Thanks 👍

AtrejuCodes commented 3 years ago

I found a better solution that seems to work for everything, advanced search for rare items too. https://github.com/PoE-TradeMacro/POE-TradeMacro/blob/eb20d12d1dc875c0bde6731d8b8193031309bffa/resources/ahk/POE-ItemInfo.ahk#L6940-L6945

Insert this line after ; --- Place fixes for data inconsistencies here ---

CBContents:= SubStr(CBContents, InStr(CBContents,"`n") + 1)    ;      <-- new fix

This removes the first line of clipboard content and "simulate" the previous leagues itemdata format.

Working for me thank you

xkylieo commented 3 years ago

I found a better solution that seems to work for everything, advanced search for rare items too.

https://github.com/PoE-TradeMacro/POE-TradeMacro/blob/eb20d12d1dc875c0bde6731d8b8193031309bffa/resources/ahk/POE-ItemInfo.ahk#L6940-L6945

Insert this line after ; --- Place fixes for data inconsistencies here ---

CBContents:= SubStr(CBContents, InStr(CBContents,"`n") + 1)    ;      <-- new fix

This removes the first line of clipboard content and "simulate" the previous leagues itemdata format.

can confirm this works for everything Posting updated Link to fixed ahk file

https://www.dropbox.com/s/l2qlh4vppwbs06l/POE-ItemInfo.ahk?dl=0

TheL1ne commented 2 years ago

@xkylieo I added your changes to the PR.