Author Topic: VAExtensions, a general purpose plugin  (Read 6365 times)

Exergist

  • Full Member
  • ***
  • Posts: 132
  • Can you dig it?
Re: VAExtensions, a general purpose plugin
« Reply #40 on: May 03, 2017, 06:33:13 am »
Quote
Compared to the ED samples above, where one might need to handle a large number of ships, systems etc., I would guess that you don't need as much dynamic info for the ME3 data you just described.
I've yet to delve into ED or similar games, but you're probably right about that. "Complexity" is simply a matter of perspective :)

I tried out the INI sample, and it looks like an array containing the section titles and keys could be looped through to set all appropriate variables up from scratch. I'll keep plugging away at it. Thanks!

Exergist

  • Full Member
  • ***
  • Posts: 132
  • Can you dig it?
Re: VAExtensions, a general purpose plugin
« Reply #41 on: May 04, 2017, 12:18:37 pm »
I got the variable export to work using:
  • a CSV with the list of all ~270 variables in my ME3 profile
  • VAExtentions for loading & reading the CSV
  • VAExtensions for exporting the variables listed in the CSV to an INI
For anyone interested, here's how the code shakes out:
Code: [Select]
//*Adapted from sample code by Antaniserse*
Write '[Purple] Please standby while exporting commences' to log
Say, 'Please standby while exporting commences'
Write '[Purple] Processing...' to log

//Identify file path for input/output files if necessary
Begin Integer Compare : [file path] Has Not Been Set
    Execute command, 'Get Game File Path' (and wait until it completes)
End Condition

//Initialize CSV-related variables and load CSV file containing master list of profile variables
Set small int (condition) [VxError] value to 0
Set integer [VxRow] value to 1
Set integer [VxColumn] value to 1
Set Text [VxDelimiter] to ','
Set Text [csvFile] to '{EXP:'{TXT:file path}' + '\ME3 Variable List.csv'}'
Set Text [VxFile] to [csvFile]
Execute external plugin, 'VA Extensions 2.0' and wait for return
Begin Small Integer Compare : [VxError] Does Not Equal 0
    Write '[Red] {TXT:VxResult}' to log
End Condition

//Initialize INI processing variables
Set Text [VxResult] to ''
Set Text [iniFile] to '{EXP:'{TXT:file path}' + '\ME3.ini'}'
Set Text [VxINISection] to 'ME3 Variables for VoiceAttack'
Start Loop While : [VxRow] Is Less Than Or Equals [VxRowsCount]
    //Retrieve variable name from CSV file
    Set Text [VxFile] to [csvFile]
    Execute external plugin, 'VA Extensions 2.0' and wait for return
    //Initialize remaining INI processing variables using results from CSV information retrieval
    Set Text [VxFile] to [iniFile]
    Set Text [VxINIKey] to '{TXT:VxResult}'
    Set Text [VxArgs] to '{TXT:{TXT:VxResult}}'
    //Write profile variable to INI file
    Execute external plugin, 'VA Extensions 2.0' and wait for return
    Set integer [VxRow] to [VxRow] plus 1
End Loop

Write '[Purple] Profile variable data export complete' to log
Say, 'Profile variable data export complete'  (and wait until it completes)

Importing the INI back into VA should follow a similar process. Thanks again Antaniserse for your help as well as this awesome plugin!  :D

Exergist

  • Full Member
  • ***
  • Posts: 132
  • Can you dig it?
Re: VAExtensions, a general purpose plugin
« Reply #42 on: May 08, 2017, 08:20:52 am »
@Antaniserse - if you ever have a chance to revisit the VAExtensions coding I would definitely be interested in having additional functionality (if technically possible) to sequentially read through an INI file (as opposed to directly referencing arguments and keys). If that's not possible, then being able to write to a CSV would be slick.

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 80
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #43 on: May 09, 2017, 01:08:56 am »
@Antaniserse - if you ever have a chance to revisit the VAExtensions coding I would definitely be interested in having additional functionality (if technically possible) to sequentially read through an INI file (as opposed to directly referencing arguments and keys). If that's not possible, then being able to write to a CSV would be slick.

Well, to be honest reading an INI file sequentially kind of defeat the purpose of using an INI file in the first place, since it's for when you need a structured format, not a stream of data... besides, technically it's already possible right now, if you name section and keys with an indexer ("[Section1]/[Section2]/... Key1=xx/Key2=yy/...) and loop accordingly in the VA code.

Writing a CSV is again not a problem from the coding aspect, it's just clunky when I think of how one could actually call that from inside a VA action... however, there are already undocumented functions (well, everything is undocumented actually  ::) I mean there's not even a sample profile) in the plugin for reading and writing databases in SQLite format, and I might as well complete that first: it will give you much better control and much better performance than a CSV
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Exergist

  • Full Member
  • ***
  • Posts: 132
  • Can you dig it?
Re: VAExtensions, a general purpose plugin
« Reply #44 on: May 09, 2017, 06:43:47 am »
Quote
technically it's already possible right now, if you name section and keys with an indexer ("[Section1]/[Section2]/... Key1=xx/Key2=yy/...) and loop accordingly in the VA code
Yep I agree on that front. I just didn't want to totally rewrite all my variables to match this format :)

I look forward to trying out reading/writing via SQLite!

M

  • Newbie
  • *
  • Posts: 2
Re: VAExtensions, a general purpose plugin
« Reply #45 on: July 09, 2017, 01:48:40 am »
I'm not able to make this work, the plugin is not loaded and in the command this is displayed "UNABLE TO ACCESS PLUGIN - PLUGIN NOT AVAILABLE"
I placed the VAExtentions folder inside the "Apps" directory in VoiceAttack.
I also tried the spotify plugin and it get loaded fine.

By the way the download link in github is broken, I had to play with the URL in order to download the package (from /archive instead that /downloads).
Attached the file I got.

Thanks to anyone who can help with this!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 935
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #46 on: July 09, 2017, 06:59:02 am »
I placed the VAExtentions folder inside the "Apps" directory in VoiceAttack.
Did you copy the folder from that .zip? That's the source code, it needs to be compiled to a .dll so VoiceAttack can use it.


You should be able to download a precompiled version from https://github.com/Antaniserse/VAExtensions/releases, but that's returning an error, as you've said:
Quote
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>

I would assume that's something the author needs to fix from his end.
« Last Edit: July 10, 2017, 06:37:29 am by Pfeil »

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 80
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #47 on: July 10, 2017, 05:42:57 am »
By the way the download link in github is broken, I had to play with the URL in order to download the package (from /archive instead that /downloads)

The download link is fine: from the main GitHub page follow the link marked "Releases" and simply get the latest compiled version



what you attached here is the source version, which should work too but you need to compile it yourself (however, I'm not sure where you found the /archive and /download links to be honest...)


You should be able to download a precompiled version from https://github.com/Antaniserse/VAExtensions/releases, but that's returning an error, as you've said:
Code: [Select]
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
I would assume that's something the author needs to fix from his end.

Just tested with a fresh download, it looks like it's working as usual here, both on VA 1.6.6 and VA 1.6.7... is that error from a specific command (I tried a few of the usual example within the profiles included included) or with any command in general?
« Last Edit: July 10, 2017, 05:47:11 am by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 935
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #48 on: July 10, 2017, 06:41:59 am »
Just tested with a fresh download, it looks like it's working as usual here, both on VA 1.6.6 and VA 1.6.7... is that error from a specific command (I tried a few of the usual example within the profiles included included) or with any command in general?
Sorry to send you on a wild goose chase  :-\

Checking it again, I'm now getting a cross-site scripting warning which I didn't get before(Rebooting overnight probably fixed it); The download was blocked by security software on my end, works fine when I turn that off.

M

  • Newbie
  • *
  • Posts: 2
Re: VAExtensions, a general purpose plugin
« Reply #49 on: July 12, 2017, 02:00:38 pm »
By the way the download link in github is broken, I had to play with the URL in order to download the package (from /archive instead that /downloads)

The download link is fine: from the main GitHub page follow the link marked "Releases" and simply get the latest compiled version



what you attached here is the source version, which should work too but you need to compile it yourself (however, I'm not sure where you found the /archive and /download links to be honest...)



Hi there, thank you for taking the time to look into my issue.
Since I received an error using the link you showcased in the screenshot I assumed that it may have pointed to a wrong folder and tried to guess a right URL on my own by looking at the other in the same page. I came up with this https://github.com/Antaniserse/VAExtensions/archive/v2.0/VAExtensions.zip that as you mentioned it is unfortunately just an altenative link to the source code.

I don't understand why the download doesn't work for me, I attached a screenshot of the error I receive here.
Do you mind sharing the zip file in this thread? Really curious to try your JSON plugin, it may allow me to easily fetch wikipedia entries.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 935
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #50 on: July 12, 2017, 02:26:08 pm »
I don't understand why the download doesn't work for me, I attached a screenshot of the error I receive here.
I see you're running the "NoScript" plugin for Firefox, that's what's blocking the script(because of its XSS protection) and causing the error.
You can either use a browser without it, or try disabling it, to enable the download.