Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first try at fixing trademacro for ultimatum league #1177

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

froks
Copy link

@froks froks commented Apr 18, 2021

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
Copy link
Author

froks commented Apr 18, 2021

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
Copy link

soockee commented Apr 18, 2021

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

  • ctrl+c: a windows is popping up
  • ctrl+d: seems to work as before
  • ctrl+alt+d: advanced search is working as before
  • ctrl+w: nothing happens -> seems broken
  • ctrl+q: nothing happens -> seems broken
  • ctrl+alt+q: nothing happens - seems broken

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

@roobrarcade
Copy link

roobrarcade commented Apr 18, 2021

Working for me in game.

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

@kekemeke
Copy link

kekemeke commented Apr 18, 2021

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

anyway ty for the fix ;)

@mataski
Copy link

mataski commented Apr 18, 2021

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

@Nivelm
Copy link

Nivelm commented Apr 19, 2021

I found a better solution #1177 (comment)

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
Copy link

xkylieo commented Apr 19, 2021

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
Copy link

mataski commented Apr 19, 2021

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
Copy link

Nivelm commented Apr 19, 2021

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

PreProcessContents(CBContents)
{
; --- Place fixes for data inconsistencies here ---
; Remove the line that indicates an item cannot be used due to missing character stats
; Matches "Rarity: ..." + anything until "--------"\r\n

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.

@Nivelm Nivelm mentioned this pull request Apr 19, 2021
@Brasolis
Copy link

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

PreProcessContents(CBContents)
{
; --- Place fixes for data inconsistencies here ---
; Remove the line that indicates an item cannot be used due to missing character stats
; Matches "Rarity: ..." + anything until "--------"\r\n

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
Copy link

Nivelm commented Apr 19, 2021

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
Copy link

Thanks 👍

@AtrejuCodes
Copy link

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

PreProcessContents(CBContents)
{
; --- Place fixes for data inconsistencies here ---
; Remove the line that indicates an item cannot be used due to missing character stats
; Matches "Rarity: ..." + anything until "--------"\r\n

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
Copy link

xkylieo commented Apr 21, 2021

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

PreProcessContents(CBContents)
{
; --- Place fixes for data inconsistencies here ---
; Remove the line that indicates an item cannot be used due to missing character stats
; Matches "Rarity: ..." + anything until "--------"\r\n

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

adapting new iteminfo format for 3.15
@TheL1ne
Copy link

TheL1ne commented Aug 2, 2021

@xkylieo I added your changes to the PR.

Copy link

@kuratsak kuratsak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to another PR, using this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet