Autocard question
Discuss anything concerning this site and its contents
Moderator: CCGHQ Admins
Autocard question
by Aswan jaguar » 04 Oct 2013, 18:18
Is there a way for autocard to show special characters,flipped cards,double faced etc...
---
Trying to squash some bugs and playtesting.
Trying to squash some bugs and playtesting.
-
Aswan jaguar - Super Tester Elite
- Posts: 8078
- Joined: 13 May 2010, 12:17
- Has thanked: 730 times
- Been thanked: 458 times
Re: Autocard question
by Korath » 22 Mar 2014, 13:23
I'll echo this. Split (Fire // Ice), flippable (Nezumi Graverobber // Nighteyes the Desecrator), and double-faced cards (Chalice of Life // Chalice of Death) haven't worked since I started paying attention here. I seem to recall that cards with accents used to work if you translated them to the equivalent ascii, e.g. Oath of Lim-Dûl to Oath of Lim-Dul or Juzám Djinn to Juzam Djinn, but they definitely don't now.
Plus, matching at the start of a post is a bit wonky. If a post starts with a card name (Lightning Axe), it won't be highlit; if it starts with a letter then a card name with no space in between (aLightning Axe), the card will be improperly highlit; and if a post starts with either "A " or "a ", then no cards anywhere in the post will be highlit. Symptoms seem to match a "\a" in the regex not being properly escaped.
Plus, matching at the start of a post is a bit wonky. If a post starts with a card name (Lightning Axe), it won't be highlit; if it starts with a letter then a card name with no space in between (aLightning Axe), the card will be improperly highlit; and if a post starts with either "A " or "a ", then no cards anywhere in the post will be highlit. Symptoms seem to match a "\a" in the regex not being properly escaped.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by Huggybaby » 24 Mar 2014, 17:35
Goblin Hero wrote the autocard software, you could send him a PM.
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 701 times
- Been thanked: 594 times
Re: Autocard question
by Korath » 14 Apr 2014, 00:27
Goblin Hero's sent me the source and data, and I've started poking at it. Split/flippable/double-faced cards turned out to be easy, and I've sent him a fix.
Other issues (which I mostly haven't even begun to investigate):
More tests: Æther Barrier AEther Barrier Gaea´s Liege Gaea’s Liege
Other issues (which I mostly haven't even begun to investigate):
Start of post "A " and "a " disables all matching.Card name at the very start of a post isn't matched.A card name starting in the second character of a post is matched, even if it's not at a word boundary.Card names with apostrophes aren't matched within spoiler tags. (I won't be able to debug this directly.) Test case: Giant Growth Gaea's Liege- both should match within | Open
- Giant Growth Gaea's Liege
- Cards with any but a few non-alphabetic characters don't get matched. SELECT name FROM oracle WHERE name NOT RLIKE '^[A-Z][A-Za-z ,'':|-]*[A-Za-z'']$'; gives me:
- Unhighlit cards | Open
- 1996 World Champion
B.F.M.
Borrowing 100,000 Arrows
Bösium Strip
Chicken à la King
Dandân
Denied!
Déjà Vu
El-Hajjâj
Erase (Not the Urza's Legacy One)
Framed!
Ghazbán Ogre
Ghazbán Ogress
Goblin S.W.A.T. Team
Guan Yu's 1,000-Li March
Ifh-Bíff Efreet
Incoming!
Junún Efreet
Juzám Djinn
Jötun Grunt
Jötun Owl Keeper
Kaboom!
Khabál Ghoul
Kill! Destroy!
Kongming, "Sleeping Dragon"
Land Aid '04
Legions of Lim-Dûl
Lim-Dûl the Necromancer
Lim-Dûl's Cohort
Lim-Dûl's Hex
Lim-Dûl's High Guard
Lim-Dûl's Paladin
Lim-Dûl's Vault
Look at Me, I'm R&D
Mine, Mine, Mine!
Márton Stromgald
Oath of Lim-Dûl
Pang Tong, "Young Phoenix"
Question Elemental?
R&D's Secret Lair
Richard Garfield, Ph.D.
Ring of Ma'rûf
S.N.O.T.
Sarpadian Empires, Vol. VII
Sauté
Séance
The Ultimate Nightmare of Wizards of the Coast® Customer Service
To Arms!
_____
"Ach! Hans, Run!"
- Cards with commas in their names don't highlight if preceded by a capitalized word (Test Emrakul, the Aeons Torn) (test Emrakul, the Aeons Torn). Cards without commas are ok (Test Spawnsire of Ulamog). Seen in the wild here.
More tests: Æther Barrier AEther Barrier Gaea´s Liege Gaea’s Liege
Last edited by Korath on 29 Apr 2014, 20:58, edited 2 times in total.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by silly freak » 14 Apr 2014, 10:48
I have no Idea how the autocard works, but couldn't you fix 2, 3, 4 quick and dirty by adding a space before autocard processing, and removing it afterwards?
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: Autocard question
by Goblin Hero » 14 Apr 2014, 12:06
I can modify my database to replace accented characters with the normal ones. I think it will simplify the script.Korath wrote:Cards with any but a few non-alphabetic characters don't get matched.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
Re: Autocard question
by Korath » 14 Apr 2014, 15:31
The accents should be fixable in the query by altering collation. This way, Juzám Djinn and Juzam Djinn would both get highlit, which is a clear win; on the other hand, so would Jüzâm Djíñn. Apparently mysql doesn't have a case-sensitive, accent-insensitive collation for utf8, which is an annoyance; so I'm also getting "JuzAm djinN" highlit in my tests. First letter still needs to be capitalized - "juzAm djinN" remains unhighlit - so maybe that's acceptable.
The more difficult issue with 5 isn't the accent characters, but the numerals, exclamation marks, and other punctuation; changing the data won't help those cases.
I also have a tentative fix for issue 1 ("A " at start of post). Will send it along in a day or two, once I get a chance to look at the others more closely.
The more difficult issue with 5 isn't the accent characters, but the numerals, exclamation marks, and other punctuation; changing the data won't help those cases.
2 and 3 perhaps, though I'd rather find out why they get mismatched and fix it properly. 4's unrelated.silly freak wrote:I have no Idea how the autocard works, but couldn't you fix 2, 3, 4 quick and dirty by adding a space before autocard processing, and removing it afterwards?
I also have a tentative fix for issue 1 ("A " at start of post). Will send it along in a day or two, once I get a chance to look at the others more closely.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by silly freak » 14 Apr 2014, 21:37
ah, typo, I meant 1, 2 and 3. after adding a space, the post wouldn't begin with "a " of course
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: Autocard question
by Korath » 17 Apr 2014, 09:07
I've sent fixes for 1-3.
Irritatingly, I can't get the accented strings to match anymore by changing collation, just the unaccented ones, and I can't figure out what I'm doing differently from before. So maybe changing the data would be better after all.
My only guess for #4 is that, looking at the generated html, the apostrophe in Gaea's Liege gets translated to ' within the spoiler tag, but apostrophes outside it (whether as part of a card name or not) don't. So maybe replacing that entity in _mtgPrepareName(), the same way ’ is, might work. 3 and 9 will need to be added to the whitelist of allowed characters in mtgParseString() as well. (Probably the rest of the digits should; 0 and 4 will need to be added for Borrowing 100,000 Arrows, Guan Yu's 1,000-Li March, and Land Aid '04 in any case.)
Irritatingly, I can't get the accented strings to match anymore by changing collation, just the unaccented ones, and I can't figure out what I'm doing differently from before. So maybe changing the data would be better after all.
My only guess for #4 is that, looking at the generated html, the apostrophe in Gaea's Liege gets translated to ' within the spoiler tag, but apostrophes outside it (whether as part of a card name or not) don't. So maybe replacing that entity in _mtgPrepareName(), the same way ’ is, might work. 3 and 9 will need to be added to the whitelist of allowed characters in mtgParseString() as well. (Probably the rest of the digits should; 0 and 4 will need to be added for Borrowing 100,000 Arrows, Guan Yu's 1,000-Li March, and Land Aid '04 in any case.)
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by Goblin Hero » 17 Apr 2014, 09:58
Applied.Korath wrote:I've sent fixes for 1-3.
It worked. Also I've extended the string with the possible symbols to "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-'’.,!;/�" so it closes some of the cases.Korath wrote:So maybe replacing that entity in _mtgPrepareName(), the same way ’ is, might work.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
Re: Autocard question
by Korath » 17 Apr 2014, 12:18
The most recent changes broke this post; all the cards in the middle section except Your Inescapable Doom were highlit earlier today. Looks like the comma newly added to the whitelist is to blame.
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by Goblin Hero » 17 Apr 2014, 12:25
Oops. Removed the comma.Korath wrote:Looks like the comma newly added to the whitelist is to blame.
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
Re: Autocard question
by Korath » 17 Apr 2014, 21:03
The period's also causing problems - it causes cards to be matched correctly mid-sentence, but not at the end of one. For example, Giant Growth and Giant Growth. I expect ! will work the same, though it'll be rarer. ; and ' already had the same problem: you should be able to write Giant Growth; and should also be able to talk about Giant Growth's implementation, and have them be highlit.
They'll all need to be handled special, similar to (but not identical to) the way , and : already are. I'll try to take a look tomorrow or this weekend.
The 0 match isn't functional, due to php's... creative... comparison semantics. It either needs to be moved away from the last character of the whitelist (anything else will work fine at the end), or the comparison changed from != FALSE to !== FALSE. This only fixes Land Aid '04, though, not Borrowing 100,000 Arrows or Guan Yu's 1,000-Li March (even if the comma is put back).
They'll all need to be handled special, similar to (but not identical to) the way , and : already are. I'll try to take a look tomorrow or this weekend.
The 0 match isn't functional, due to php's... creative... comparison semantics. It either needs to be moved away from the last character of the whitelist (anything else will work fine at the end), or the comparison changed from != FALSE to !== FALSE. This only fixes Land Aid '04, though, not Borrowing 100,000 Arrows or Guan Yu's 1,000-Li March (even if the comma is put back).
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by Korath » 08 May 2014, 13:49
The problematic accented card names for testing purposes, outside of spoiler tag (which changes them, annoyingly enough)
1996 World Champion
B.F.M.
Borrowing 100,000 Arrows
Bösium Strip Bosium Strip
Chicken à la King Chicken a la King
Dandân Dandan
Denied!
Déjà Vu Deja Vu
El-Hajjâj El-Hajjaj
Erase (Not the Urza's Legacy One)
Framed!
Ghazbán Ogre Ghazban Ogre
Ghazbán Ogress Ghazban Ogress
Goblin S.W.A.T. Team
Guan Yu's 1,000-Li March
Ifh-Bíff Efreet Ifh-Biff Efreet
Incoming!
Junún Efreet Junun Efreet
Juzám Djinn Juzam Djinn
Jötun Grunt Jotun Grunt
Jötun Owl Keeper Jotun Owl Keeper
Kaboom!
Khabál Ghoul Khabal Ghoul
Kill! Destroy!
Kongming, "Sleeping Dragon"
Land Aid '04
Legions of Lim-Dûl Legions of Lim-Dul
Lim-Dûl the Necromancer Lim-Dul the Necromancer
Lim-Dûl's Cohort Lim-Dul's Cohort
Lim-Dûl's Hex Lim-Dul's Hex
Lim-Dûl's High Guard Lim-Dul's High Guard
Lim-Dûl's Paladin Lim-Dul's Paladin
Lim-Dûl's Vault Lim-Dul's Vault
Look at Me, I'm R&D
Mine, Mine, Mine!
Márton Stromgald Marton Stromgald
Oath of Lim-Dûl Oath of Lim-Dul
Pang Tong, "Young Phoenix"
Question Elemental?
R&D's Secret Lair
Richard Garfield, Ph.D.
Ring of Ma'rûf Ring of Ma'ruf
S.N.O.T.
Sarpadian Empires, Vol. VII
Sauté Saute
Séance Seance
The Ultimate Nightmare of Wizards of the Coast® Customer Service
To Arms!
_____
"Ach! Hans, Run!"
1996 World Champion
B.F.M.
Borrowing 100,000 Arrows
Bösium Strip Bosium Strip
Chicken à la King Chicken a la King
Dandân Dandan
Denied!
Déjà Vu Deja Vu
El-Hajjâj El-Hajjaj
Erase (Not the Urza's Legacy One)
Framed!
Ghazbán Ogre Ghazban Ogre
Ghazbán Ogress Ghazban Ogress
Goblin S.W.A.T. Team
Guan Yu's 1,000-Li March
Ifh-Bíff Efreet Ifh-Biff Efreet
Incoming!
Junún Efreet Junun Efreet
Juzám Djinn Juzam Djinn
Jötun Grunt Jotun Grunt
Jötun Owl Keeper Jotun Owl Keeper
Kaboom!
Khabál Ghoul Khabal Ghoul
Kill! Destroy!
Kongming, "Sleeping Dragon"
Land Aid '04
Legions of Lim-Dûl Legions of Lim-Dul
Lim-Dûl the Necromancer Lim-Dul the Necromancer
Lim-Dûl's Cohort Lim-Dul's Cohort
Lim-Dûl's Hex Lim-Dul's Hex
Lim-Dûl's High Guard Lim-Dul's High Guard
Lim-Dûl's Paladin Lim-Dul's Paladin
Lim-Dûl's Vault Lim-Dul's Vault
Look at Me, I'm R&D
Mine, Mine, Mine!
Márton Stromgald Marton Stromgald
Oath of Lim-Dûl Oath of Lim-Dul
Pang Tong, "Young Phoenix"
Question Elemental?
R&D's Secret Lair
Richard Garfield, Ph.D.
Ring of Ma'rûf Ring of Ma'ruf
S.N.O.T.
Sarpadian Empires, Vol. VII
Sauté Saute
Séance Seance
The Ultimate Nightmare of Wizards of the Coast® Customer Service
To Arms!
_____
"Ach! Hans, Run!"
-
Korath - DEVELOPER
- Posts: 3707
- Joined: 02 Jun 2013, 05:57
- Has thanked: 496 times
- Been thanked: 1106 times
Re: Autocard question
by Goblin Hero » 13 May 2014, 07:40
Korath's request is implemented. Now autocard works with Planes/Heroes/other nontraditional cards.
Hydra Head Onakke Catacomb Nature Shields Its Own
Hydra Head Onakke Catacomb Nature Shields Its Own
When you´re a goblin, you don´t have to step forward to be a hero -- everyone else just has to step back.
-
Goblin Hero - Site Admin
- Posts: 1992
- Joined: 23 Oct 2005, 09:37
- Location: Russia
- Has thanked: 218 times
- Been thanked: 351 times
19 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 20 guests