ronelm2000 / wsmtools Goto Github PK
View Code? Open in Web Editor NEWWeiss Schwarz Montage Tools (including parsing and exporting)
License: GNU General Public License v3.0
Weiss Schwarz Montage Tools (including parsing and exporting)
License: GNU General Public License v3.0
specifically Aobuta deck
You can search for cards using your local card database.
The following command does not work:
./wstools parse "C:\\Path\\to\\file.txt" --with hotc
Since .mse-set files use YAML, it should be possible to parse the set from it, but the user will likely need to specify a local repository of images.
To avoid conflicts with real cards, a new serial standard shall be introduced specifically for custom sets. Serials do not actually exist on the Weiss MSE sets, so serials shall be automatically generated as per the algorithm in the original plugins (which should already be the same).
[ABCDabcd]/[W]C[ZZZ]-001
[ABCDabcd] is the Neo-Standard Code. Unless specified, typical Weiss Schwarz rules for Neo-Standard apply.
[W] is the Side. This may be divided into Weiss [W], Schwarz [S], or Both [WS]. Custom "Sides" are not allowed.
[ZZZ] is the Custom Set's Full ID. This may consist of a value from 0-9, a-z, and A-Z. This adds up to 238,328 potential unique sets per side.
If the Full ID starts with [E], it must mean that it is an Extra Booster.
Planned Supported MSE2 Plugins
I've analyzed the API powering Bushiroad's DeckLog application and it should be possible to get image URL data from it.
This can be done using: POST https://decklog.bushiroad.com/system/app/api/search/2
(2
very likely refers to the Game ID Weiss Schwarz)
This request accepts application/json of the following format:
{"param":{"title_number":"","keyword":"GF/W33-001","keyword_type":["no"],"side":"","card_kind":"0","level_s":"","level_e":"","power_s":"","power_e":"","color":"0","soul_s":"","soul_e":"","cost_s":"","cost_e":"","trigger":"","option_counter":false,"option_clock":false,"deck_param1":"S","deck_param2":""},"page":1}
This will output the following JSON.
[{"id":4970,"card_number":"GF\/W33-001","num":0,"card_kind":2,"name":"\u7d20\u9854\u306e\u79c1\u3092 \u6afb\u4e95\u660e\u97f3","rare":"RR+","img":"g\/gf_w33\/gf_w33_001.png","width":400,"height":559,"direction":0,"sub":"","p_param":{"p1":"","p2":"","p3":"","p4":"","p5":"","p6":"","p7":"","p8":"","p9":"","p10":""},"max":4,"g_param":{"g0":0,"g1":1,"g2":0,"g3":0,"g4":1,"g5":0,"g6":0,"g7":0,"g8":0,"g9":0}}]
The "img" string shall refer to a subdirectory within the following URL (which may be subject to change): https://s3-ap-northeast-1.amazonaws.com/static.ws-tcg.com/wordpress/wp-content/cardimages/
Thus the URL of the serial GF/W33-001 refers to the following image: https://s3-ap-northeast-1.amazonaws.com/static.ws-tcg.com/wordpress/wp-content/cardimages/g/gf_w33/gf_w33_001.png
This Post-Processor should not be able to accept English cards.
This Post-Processor must first get image data via Release ID. Only use a single-card search when necessary. In such a case, the request body should be this.
{"param":{"title_number":"##GF##","keyword":"","keyword_type":["name","text","no","feature"],"side":"","card_kind":"0","level_s":"","level_e":"","power_s":"","power_e":"","color":"0","soul_s":"","soul_e":"","cost_s":"","cost_e":"","trigger":"","option_counter":false,"option_clock":false,"deck_param1":"S","deck_param2":""},"page":1}
When using Title Code/Neo-Standard Code search, the page variable in the JSON must increment by 1 until the resulting JSON becomes []
. This is how all card data for that Title Code/Neo-Standard Code shall be obtained.
Add a migration version to each card. This should allow me as developer to delete/modify broken cards each time there's an update, and especially prevalent during major changes that require card data revisions.
Basically, each time a user parses a set, it adds a timestamp of the wsmtools version.
After this change, all cards will be timestamped for v0.6.1.
IProgress
and CancellationToken
should be implemented in all Task APIs where it's possible.
This will allow future Service API to insert its own implementation and also provide an implementation for cancellation if needed, like say, for a browser extension, or a GUI.
For the old use cases (that is, for implementations that do not need IProgress and CancellationToken), an interface extension (or default implementation) method shall be provided.
Allows wsmtools to accept input from pipe/stdin. Currently, the only parser the should require this input should be Deck JSON Deck Parser.
Sample Usage:
# This command will get Deck Data from EncoreDecks, replace base rarity cards with my foil cards, then export to TTS.
./wstools merge https://www.encoredecks.com/deck/UFo2ADuKC ./path/to/my_foil_cards.json | ./wstools export pipe --with upscaling,sendtcp --exporter tts --out sharex
Users should be able to enter translations and new card details manually. This can be done via a new parser which will take in an input file.
The input file shall be in JSON. This allows inputs to be easier to define and do not scale vertically as they can introduce problems when editing manually.
This needs to be well defined before work on it can be started.
Adds a merge command to wsmtools.
This command merges two decks into 1 deck; overwriting copies of the source_url
to copies of the source2_url
cards, if any. The only output is Deck JSON stdout (as there is no destination output).
Format:
./wstools merge source_url source2_url [--with optional,flag,strings]
Sample Command:
# This command will get Deck Data from EncoreDecks and replace base rarity cards with my foil cards.
./wstools merge https://www.encoredecks.com/deck/UFo2ADuKC ./my_foil_cards.json
Error:
An assembly specified in the application dependencies manifest (wstools.deps.json) was not found:
package: 'Microsoft.DotNet.PlatformAbstractions', version: '3.1.6'
path: 'lib/netstandard2.0/Microsoft.DotNet.PlatformAbstractions.dll'
Hello, I got this error with an empty cards.db.
PS E:\wsmtools> ./wstools export https://decklog.bushiroad.com/view/FHL4 --with sendtcp,upscaling --out sharex
[17:45:27 INF] [] Starting...
[17:45:28 INF] [] The latest version is: "0.6.0"
[17:45:28 INF] [] The latest version on repository: "v0.6.0"
[17:45:28 INF] [Montage.Weiss.Tools.CLI.ExportVerb] Running...
[17:45:32 INF] [Montage.Weiss.Tools.Impls.Parsers.Deck.DeckLogParser] Parsing ID: "FHL4"
Unhandled exception. Montage.Weiss.Tools.Entities.Exceptions.DeckParsingException: The following serials are missing from the DB:
SBY/W64-026
SBY/W64-032
SBY/W64-052
SBY/W64-057
SBY/W64-078S
SBY/W77-044
SBY/W64-070
SBY/W64-096
SBY/W64-030
SBY/W77-055
SBY/W64-056
SBY/W64-094
SBY/W64-P02
SBY/W64-014
SBY/W64-029
SBY/W64-028
SBY/W64-035
SBY/W64-058
SBY/W77-050
SBY/W64-092
SBY/W64-084
SBY/W64-076
SBY/W77-076
SBY/W77-046
SBY/W64-097
SBY/W64-074
SBY/W64-075
at Montage.Weiss.Tools.Impls.Parsers.Deck.DeckLogParser.Parse(String sourceUrlOrFile)
at Montage.Weiss.Tools.CLI.ExportVerb.Run(IContainer ioc)
at Montage.Weiss.Tools.Program.<>c__DisplayClass0_0.<<Main>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Montage.Weiss.Tools.Program.Main(String[] args)
at Montage.Weiss.Tools.Program.<Main>(String[] args)
And if I get informations from encoredeck, images do not load it retry "infinitely".
I am unable to export on v.0.4.0. I receive an error which states that the application at 'C:\Users\Name\AppData\Local\Temp.net\wstools\vof4n0tx.fio\wstools.dll' does not exist.
Because the common APIs and services used for wsmtools are slowly becoming out of sync with r4utools, a new common API library is required to sync both projects' API together.
This needs to be done so that any changes for wsmtools in regards to common APIs are also properly reflected on r4utools and thus it would be easier to synchronize any functionality common between the two.
As originally reported by @ianzzz94:
For now I have not been able to replicate this tho, will need to follow up after finishing work on R4UTools.
Due to how YYT Image Post-Processor currently works, the captured image links for several cards use SEC foil images instead of its RR (or R) rarities.
The current workaround is to cache the entire DMS set (using ./wstools cache W57 jp
) and replace all SEC images.
Hi there, I am having issues entering the export URL and after hitting Enter getting this error message:
ERR] [Montage.Weiss.Tools.Impls.Parsers.Deck.DefaultDeckParser] Cannot find a compatible parser for this URL or File:
I am entering ./wstools export link as usual but it is not working. What can I do?
Thank you :)
An enhancement to use a flag --with sendtcp
with TabletopSimulatorExporter. If this flag is enabled, wsmtools will send the Deck Generator JSON over directly into Tabletop Simulator. This would stop the need to put the Deck Generator JSON into the specified Saved Objects folder.
As an aside, decks with parentheses in the title seem to trip up the program because in tts it throws unsupported image format (*.jpg...). It doesn't seem like a big deal though because I renamed the deck to remove parentheses and it works.
Originally posted by @namtsui in #58 (comment)
Part of a long term goal for completely replacing HOTC as a codestyle. The idea is to be able to parse any card text (from any card style or any language for that matter), convert it into an Expression Tree.
Using this expression tree allows various functions, from being able to serialize it into another language entirely (using any type of card effect style), or use the data to create card scripts (like that for BlakeWS)
[Sample Format]
// [CONT] Assist All of your characters in front of this card gets +500 power.
// [C] ASSIST All your Characters in front of this gain +500 Power.
private static WSExpressionTree GetSample()
{
return new WSExpressionTree()
{
ExpressionType = WSExpressionType.Continous,
Labels = new[] { WSLabel.Assist },
Condition = null,
Effect = new WSGainATKEffect()
{
ATK = +500,
Target = WSZone.YourStage with {
Condition = WSCondition.InFrontOf(WSTarget.ThisCard)
}
}
};
}
Hi,
im trying to export a few Decks and run into an Issue with Decks, that use multiple Sets like Hololive or Sword Art Online.
I use a standard wsttols export [URL] for the export
When I try to export the following Deck https://decklog-en.bushiroad.com/view/J8HV for example i get the following Error Message:
Unhandled exception. System.InvalidOperationException: The instance of entity type 'WeissSchwarzTrait' cannot be tracked because another instance with the same key value for {'TraitID', 'Serial'} is already being tracked. When replacing owned entities, modify the properties without changing the instance or detach the previous owned entity entry first. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.
The second Deck https://www.encoredecks.com/deck/9HkcdZrjq is getting an
Unhandled exception. System.ArgumentException: An item with the same key has already been added. Key: sao/s80-e004sp
Error.
Can you point me on how to export these two successfully please or what seems to be the Issue ?
Thanks
JKTCG pushed a change that causes low quality images to be used as thumbnail for their pages, causing an incompatibility issue.
[Format]
./wstools update rid1;rid2;rid3 postprocessoralias1;postprocessoralias2
This command allows you to update cards that already exist in your ./cards.db
using already existing card post-processors.
This will not skip the compatibility phase for post-processing, but will skip flag checks for skipping (or not skipping) typically employed in ./wstools parse url
, like that used in yuyutei.
[Use Case]
Update YYT pricing by making it possible to schedule a job every day where YYT pricing data will always be obtained to allow price trend tracking.
Due to a recent announcement by JKTCG announcing its closure, this application will need to find a new image sources for Weiss Schawarz English cards. Any insight is welcome!
Allow certain .txt files to be parsed using a format typically reserved for HOTC text.
You must explictly tell the parser that the file to be parsed is HOTC format.
Example:
./wstools parse path/to/file.txt --with hotc
file.txt format:
Random Text Information May Be Inserted Here.
For example, you can put some author notes or links to your discord server
as ads or something.
================================================================================
Interesting Titles Participating!
気になるタイトル続々参戦!
Card No.: CGS/WS01-P01 Rarity: PR
Color: Blue Side: Weiss Climax
Level: 0 Cost: 0 Power: 0 Soul: 0
Traits: None
Triggers: 2 Soul
Flavor: Hey, you should Weiss Schwarz too!
TEXT: [A] When this is placed from hand to the Climax Zone, remove all cards in
your Library and Waiting Room from the game, and use a new deck with a
different sleeve as that Library as Library, and continue the game. For the
rest of the game, whenever a card from the old deck would be placed in the
Waiting Room, instead remove it from the game.
*This card cannot be used in official and sanctioned tournaments.
================================================================================
Shiyoko, Shiro-Kuro Fes 2016
しろくろフェス2016 しよ子
Card No.: CGS/WS01-P02 Rarity: PR
Color: Blue Side: Weiss Character
Level: 0 Cost: 0 Power: 2000 Soul: 1
Traits: カードゲーム (Card Game), 和服 (Yukata)
Triggers: None
Flavor: Let's...... Let's...... Let's......
TEXT: [C] If there are no other Characters in your Front Row, this gains +1500
Power.
[A] At the start of your Opponent's Attack Phase, you may move this to an empty
Front Row Center Slot.
================================================================================
HOTC-style input should be fine I guess. It shouldn't be too difficult for that parser to accept a file. I still like the idea for HOTC file parser tho, so I will include that as a separate card.
Originally posted by @ronelm2000 in #1 (comment)
Started getting this error the other day, unsure what could be done to solve it
Error:
An assembly specified in the application dependencies manifest (wstools.deps.json) was not found:
package: 'Microsoft.DotNet.PlatformAbstractions', version: '3.1.3'
path: 'lib/netstandard2.0/Microsoft.DotNet.PlatformAbstractions.dll'
Hello!
I tried to import an english deck from encoredecks with the help of IanTCGs instructions. Powershell seemed to download the image files and card text, but then seemed to fail to safe it to the export folder. I'm unsure if it is a mistake on my part or if the program is doing something funny, since I don't know anything about coding. You'll find the code in the text file.
Code_WS_Export.txt
The purpose for doing this is to keep the source well-maintained, as well as perform any necessary refactoring due to this change. This includes:
ReadOnlySpan
in the Cursor reader in HOTC parser for possible improvements.record
types where possible.if (c is (>= 0 and < 10))
I'm also experiencing the same error text, but specifically when attempting to export hotc translation pages (decks never cause this).
Originally posted by @MoeGuitarist in #35 (comment)
Can you post the command you used for this?
Currently, some multi-release sets (ie. Little Busters) will create a full grid of 2600x1850 due to a slightly smaller resolution for older sets. This creates difficult to read images of otherwise legible original images. Suggesting a flag to forcefully maintain full grid resolution and scale up images to match the grid, as opposed to scaling down images to match a smaller grid.
It seems that the English Prillya set is not being suffixed with EN in Encore decks and keeps being unable to find images. When I try to use images from either the Encore decks or WS-TCG site they keep complaining about ratio being wrong.
The prefix for the URL for DeckLog images was changed, hence why images are not currently working as intended for DeckLog images.
See #21 for the original format, and the new format is now:
https://ws-tcg.com/wordpress/wp-content/images/cardlist/b/bfr_s78/bfr_s78_t01.png
hi,
I'm building a suite of tools and I'm looking to find a good way to automate getting EN card data. I've tried building my own scraper, but it looks like there's one here that works. I just can't seem to figure out the documentation on how I could use it for things that aren't deck exports.
my goal: call ./wstools --card-id=5HY/W83-E001 --json=cache/5HY_W83_E001.json
and get a json file with all of the relevant card information
(I already plan to handle other aspects of the pipeline)
let me know if this is possible and I just missed it!
Add the following:
[Format]
./wstools fetch [rids_or_card_serial_in_commas] [--with flags]
[Example]
./wstools fetch W95 --with noskip:yyt
This is an easier way to automatically fetch data using default settings when you only have an RID or Card Serial..
The current implementation will be to fetch sets of cards via EncoreDecks API and running parse
commands based on the data. Providing no RID or card serial will attempt to fetch all cards in the game, with visible warning requiring you to prompt yes, unless you use the following flag --with nowarn
.
This will fetch both the JP and EN versions of the RID, when applicable.
It must be reiterated that fetching all cards in the game may cause certain sites (like yuyutei or DeckLog) to ban you as a bot, and is thus not recommended.
Hi,
I'm on guixsd linux and get these artifacts in the output (see the end of this post).
https://github.com/namtsui/imagedump/blob/main/deck_ddm_12events_gate_pants_.jpg
First, I tried running the linux release and got a similar result. Then, I tried using mono to build from source (as in .github/workflows/nightly.yml). Both yielded the same results.
$ ldd wstools
linux-vdso.so.1 (0x00007ffea5733000)
libpthread.so.0 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libpthread.so.0 (0x00007f6dfd827000)
libdl.so.2 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libdl.so.2 (0x00007f6dfd822000)
libstdc++.so.6 => /gnu/store/6d0pl5khj08j3c2619jnypc8bznspgx8-gcc-10.3.0-lib/lib/libstdc++.so.6 (0x00007f6dfd64d000)
libm.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libm.so.6 (0x00007f6dfd50c000)
libgcc_s.so.1 => /gnu/store/6d0pl5khj08j3c2619jnypc8bznspgx8-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00007f6dfd4f2000)
libc.so.6 => /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/libc.so.6 (0x00007f6dfd32e000)
/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2 (0x00007f6dfd870000)
namtsui@antelope ~/workspace/wsmtools_code/wsmtools/MontageWeissTools/bin/Release/net6.0$ file wstools
wstools: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2, BuildID[sha1]=38f32dad6bd760faf250dafce41a819685ce9c84, for GNU/Linux 2.6.32, stripped
To build I used:
dotnet restore
dotnet build --configuration Release --no-restore
Then, I ran the binary from wsmtools/MontageWeissTools/bin/Release/net6.0
$ ./wstools export https://www.encoredecks.com/deck/G17icr9vk
Finally, logs follow. When building a DDM deck (https://www.encoredecks.com/deck/G17icr9yk) it gets the image with artifacts (https://github.com/namtsui/imagedump/blob/main/deck_ddm_12events_gate_pants_.jpg). When trying to build a DAL deck (https://www.encoredecks.com/deck/BhJy3HOn4) it exposes a crash with image 10 in zlib.
wstools cant parse translation from sets like kancolle 5th fleet and bang dream
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.