[Tool] Trial Script Exporter

Learn how to use AAO by reading tutorials, and seek help from the AAO community.

Moderator: EN - Forum Moderators

User avatar
kwando1313
Posts: 7684
Joined: Tue Jul 22, 2008 6:33 pm
Gender: Male
Spoken languages: English, Français (un peu), Ancient Belkan
Location: Uminari City

[Tool] Trial Script Exporter

Post by kwando1313 »

I figured this would be nice to make into its own topic now, since I actually finished it off.
Spoiler : Old Instructions :
Firstly, there are two versions of the tool.

The first version is the one that I've posted in the previous thread. To use that version, follow the following steps:

Firstly, use this tool that Ferdie made to extract your trial's data.

Once you get that saved, use this to get the script. It should be pretty self explanatory, but... Just in case here are the instructions.

1. Either paste the data that was dumped into the text box (Yes, I know the text box is super tiny. But... It's not like it matters, anyways.) or click "Choose File" and select the file you just created.
2. Click extract or extract with frames. The difference between the two is that extract with frames tells you the frame number, and extract doesn't. Again, pretty self explanatory.
3. A popup should appear (on Firefox) or a file should start downloading right away (on Chrome) called script.txt.
4. Voila! A version of your script. All nice and happy.

The second version is a bookmarklet tool, akin to the one Ferdie made to extract the JSON to begin with. (So, thanks to Ferdie on that front. I basically looked at his code and tweaked it a bit to make it do what I wanted to do.)

I'll copy his instructions here for getting the bookmarklet to work in the first place (but replacing the link for his tool with mine instead.):
Ferdielance wrote: 1: Open the Firefox bookmark toolbar. If it isn't visible, try right clicking the bookmark (star) icon and clicking "Bookmarks Toolbar."

2: Copy the code below (control-V)

Code: Select all

javascript:%20(function(){var%20jsCode=document.createElement('script');%20jsCode.setAttribute('src','http://kwando1313.github.io/js/scriptExtractorDirect.js');%20document.body.appendChild(jsCode);}());
3: Right-click on the bookmarks toolbar and paste that code. Yes, paste it right into the bookmark toolbar, even though there's no text box there. It'll work.

4: A new button should appear. If you like, you can rename the bookmark by right-clicking on it.

5: Open the trial you want to back up in the v6 player. Click the new bookmark.
Once you get the bookmarklet up and running, it should be pretty smooth sailings.

The first prompt asks you whether or not you want to show the frames in the script (OK means yes, Cancel means no. Which is kind of confusing, but I can't really easily edit it to say yes or no, so you're going to have to deal with that...), and then it'll ask you for the name of the file.

Hopefully you'll find this tool useful!
It's even easier to use now! All you have to do is... Put in the Trial ID for the trial you want to get the script from, and then you can download it!

Script Extractor

We're back!
Last edited by kwando1313 on Fri Jun 02, 2017 3:08 am, edited 5 times in total.
Avatar made by Rimuu~

Image

"The Knight of the Iron Hammer, Vita, and the Steel Count, Graf Eisen. There's nothing in this world we can't destroy."
User avatar
HellPuppy
Posts: 16
Joined: Fri Oct 02, 2015 3:31 pm
Gender: Male
Spoken languages: English
Location: Canada, Eh?

Re: [Tool] Trial Script Exporter

Post by HellPuppy »

Thought I'd give some feedback on this by trying it out.

Followed the instructions and got text files that had scripts with frames and such.

Tried out both copy and pasting directly into the text field and uploading the document. Both work.

Results (Forgive the caps):
Spoiler : Extract :
Hi, Mr. Wright!
I'M GOING SO FAST!
Spoiler : Extract w/ Frames :
1 - Hi, Mr. Wright!
2 - I'M GOING SO FAST!
I'll just let you know what else I did.

One thing with Ferdielance's bookmarklet. At this stage:
Spoiler : Image :
Image
It must be saved with a (.txt) at the end of it. Without that, it saves it as an unrecognizable file.

*Also, he mentioned something about getting another piece of data, but I only received a single file.

With this Example.txt file I obtained, I opened up:
(http://aceattorney.sparklin.org/V6_Test/save.php)

*Note, throwing in your trial ID while the box is empty will delete the trial!

I created a dummy trial (that was already saved as v6!) to get its ID. I threw in the contents from Example.txt and hit submit query.

It took me to a page that had a single 1 on it.

But looking back at the trial, everything had successfully loaded. So great, the trial was duplicated.
No problems with saving.

But if you create a completely new trial and try this trick, you get this:
Spoiler : :
[phpBB Debug] PHP Warning: in file /media/Data/domains/AAOprod/www/includes/TrialMetadataHandler.class.php on line 240: max(): Array must contain at least one element
1
But the trial still was duplicated, and when saving it does not warn you about saving in v6.

So, it looks like these tools would be very useful to duplicate and save your own trials externally. The script exporter would be useful for that other problem mentioned, where someone could just simply check grammar.

I didn't receive a prompt when clicking on either "Extract" or "Extract with Frames".
Did you adjust it so it doesn't ask?

Now if we could reverse this process... :wink:
About my avatar: That is literally a picture of my dog. I edited in the red-eye.
Picture was taken in the evening with no flash, and that's how it turned out.
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: [Tool] Trial Script Exporter

Post by Enthalpy »

Would it be possible to simply input a trial ID and have the program fetch the trial_data for us? It would make things a bit more automatic.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
User avatar
kwando1313
Posts: 7684
Joined: Tue Jul 22, 2008 6:33 pm
Gender: Male
Spoken languages: English, Français (un peu), Ancient Belkan
Location: Uminari City

Re: [Tool] Trial Script Exporter

Post by kwando1313 »

I'd love to, but I have no idea where to find the JSON for the trials. Tried to inspector it away, but... No luck. You have any idea where it's stored? If I can find that out, I should be able to make it so it extracts it purely from the frame ID...

EDIT: Actually, it's even more annoying because I can't even make Cross-Script access to the resources, which means I can't just plonk down the trial ID and get info from it.


nvm, got it to work. I'll upload soon.
Avatar made by Rimuu~

Image

"The Knight of the Iron Hammer, Vita, and the Steel Count, Graf Eisen. There's nothing in this world we can't destroy."
User avatar
kwando1313
Posts: 7684
Joined: Tue Jul 22, 2008 6:33 pm
Gender: Male
Spoken languages: English, Français (un peu), Ancient Belkan
Location: Uminari City

Re: [Tool] Trial Script Exporter

Post by kwando1313 »

Shorter than 12 hour bump, but figured this is actually important, so imma post.

Got it to work purely off of Frame ID. Also added a few adjustments, so you don't see blank text frames with names, and it also will show the OBJECTION, HOLD ITs, and TAKE THATs.
Avatar made by Rimuu~

Image

"The Knight of the Iron Hammer, Vita, and the Steel Count, Graf Eisen. There's nothing in this world we can't destroy."
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: [Tool] Trial Script Exporter

Post by Enthalpy »

Thanks very much!
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
User avatar
kwando1313
Posts: 7684
Joined: Tue Jul 22, 2008 6:33 pm
Gender: Male
Spoken languages: English, Français (un peu), Ancient Belkan
Location: Uminari City

Re: [Tool] Trial Script Exporter

Post by kwando1313 »

I added the old version back in, for those who want it. (You can access that link in the spoilered text area.)

this is for you spyro
Avatar made by Rimuu~

Image

"The Knight of the Iron Hammer, Vita, and the Steel Count, Graf Eisen. There's nothing in this world we can't destroy."
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: [Tool] Trial Script Exporter

Post by Enthalpy »

There's a tiny error in the new version - it asks us to input the frame number instead of the trial ID. Also, could you clarify what number the "with frames" gives you? It didn't match the frame ID. Is it the frame index?

The ability to just input the trial ID works great!
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
User avatar
Phoenixwrite23
Posts: 6
Joined: Wed Jul 24, 2013 4:19 pm
Gender: Male
Spoken languages: English

Re: [Tool] Trial Script Exporter

Post by Phoenixwrite23 »

How do you get the frame ID to extract properly?
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: [Tool] Trial Script Exporter

Post by Enthalpy »

Properly? Is there a problem?
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
User avatar
Phoenixwrite23
Posts: 6
Joined: Wed Jul 24, 2013 4:19 pm
Gender: Male
Spoken languages: English

Re: [Tool] Trial Script Exporter

Post by Phoenixwrite23 »

Yeah, and I've typed in the 5 digit frame number and it says that it's unable to get frames from the trial. I don't know what I'm doing wrong. I have not submitted my trial to be played yet, is that the problem?
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: [Tool] Trial Script Exporter

Post by Enthalpy »

Frame number or trial ID, first of all? You need to input the trial ID. I know the web page says "frame number," but that's a mistake.

As best as I know, this system can only be used for public trials, so yes, that would be a problem.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
User avatar
Phoenixwrite23
Posts: 6
Joined: Wed Jul 24, 2013 4:19 pm
Gender: Male
Spoken languages: English

Re: [Tool] Trial Script Exporter

Post by Phoenixwrite23 »

The trial ID. For example I put: http://aceattorney.sparklin.org/editor.php?trial_id=5**** I put the 5 digits when asked to put the trial ID in.
User avatar
Enthalpy
Community Manager
Posts: 5169
Joined: Wed Jan 04, 2012 4:40 am
Gender: Male
Spoken languages: English, limited Spanish

Re: [Tool] Trial Script Exporter

Post by Enthalpy »

Which brings me right back to the second half of my post: As best as I know, this system can only be used for public trials, so yes, [trying to use the script extractor for a trial that is not public] would be a problem.
[D]isordered speech is not so much injury to the lips that give it forth, as to the disproportion and incoherence of things in themselves, so negligently expressed. ~ Ben Jonson
User avatar
kwando1313
Posts: 7684
Joined: Tue Jul 22, 2008 6:33 pm
Gender: Male
Spoken languages: English, Français (un peu), Ancient Belkan
Location: Uminari City

Re: [Tool] Trial Script Exporter

Post by kwando1313 »

Yeah, it needs to be a public trial because I need to get the trial data somehow.
Avatar made by Rimuu~

Image

"The Knight of the Iron Hammer, Vita, and the Steel Count, Graf Eisen. There's nothing in this world we can't destroy."
Post Reply