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

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
VAExtensions, a general purpose plugin
« on: May 04, 2016, 06:44:39 AM »
Hello brand new forum!

On the link below you can find a utility/general purpose plugin for dealing with text files, XML, RSS feed and so on, that I've being thinkering with for quite some time; you may remember my old 'VATextReader/VAMath/etc." plugins posted a while ago in the Google Group... this is a collection and polish of that same stuff, with some new features added

Documentation is still absent, but you may refer to the sample profiles and the old documentation found in the above plugins... feel free to ask for any help

Source and binaries here (follow the 'Releases' link on top for the zipped downloads): https://github.com/Antaniserse/VAExtensions
 
Edit: Version 2.0 is out, with support for the new VoiceAttack plugin interface... requires VoiceAttack 1.6 or later
« Last Edit: July 10, 2017, 06:49:31 AM by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #1 on: September 01, 2016, 10:01:02 PM »
So, I know this an old thread, but I download this plugin to read the Elite Dangerous netlog and I'm having an issue.

It seems that the netlog is inaccessible while ED is running.  I say "seems", because, for some reason MS Access can open the file, read it, copy it (I never actually edit the original file of course). I even tried changing the extension while ED was running, expecting to get the "this file is open in another program...", but I could actually do it.  But this plugin gives me an error in VA saying "Error loading file content".  As soon I shut down ED, the plugin reads it just fine.

Any special settings or something I'm doing wrong?

I would really like to get this going with the netlog, as I've constructed some regex's that pull out a couple of entries that I'm really interested getting into VA for processing.

Thanx

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #2 on: September 02, 2016, 03:30:21 AM »
Any special settings or something I'm doing wrong?
I don't think there's anything wrong in your profile, it looks like a locked file issue of some sort, from what you have described, especially due to the fact that without ED running the file becomes readable again.

Can you remind me the exact name and path of the ED netlog file you are trying to access? I have the game and i can try and reproduce the issue here... the pluging should only try for 'open' access when reading files, but it might have slipped somewhere
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

cmdrmcdonald

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #3 on: September 02, 2016, 04:17:02 AM »
You might want to take a look at EDDI (https://forums.frontier.co.uk/showthread.php/226649-EDDI-A(nother)-Voice-Attack-Plugin) which probably does what you want it to do.

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #4 on: September 02, 2016, 04:15:24 PM »
Any special settings or something I'm doing wrong?
I don't think there's anything wrong in your profile, it looks like a locked file issue of some sort, from what you have described, especially due to the fact that without ED running the file becomes readable again.

Can you remind me the exact name and path of the ED netlog file you are trying to access? I have the game and i can try and reproduce the issue here... the pluging should only try for 'open' access when reading files, but it might have slipped somewhere

Umm...I think the path is 'C:\Program Files (x86)\Steam\steamapps\common\Elite Dangerous\Products\elite-dangerous-64\logs'...or something really close to that.

Yeah, I thought that reading a 'locked' file shouldn't be a problem either. But I am using a regex on it (just to read the last line, no editing what-so-ever), so I'm not sure if that makes a difference.

Thanx for looking into it.  I would really love to see if this will work. :)
« Last Edit: September 02, 2016, 05:43:34 PM by Technomancer »

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #5 on: September 02, 2016, 04:17:54 PM »
You might want to take a look at EDDI (https://forums.frontier.co.uk/showthread.php/226649-EDDI-A(nother)-Voice-Attack-Plugin) which probably does what you want it to do.

Thanx for the suggestion.  I am already using EDDI.  I really like it and I'm incorporating many of the variables into my own profile to track things and get feedback.

However, what I'm looking to get from the netlog file is the 'interdictions', which I see are logged, but EDDI doesn't mention them.

Is there a way to fish those out with EDDI??

Thanx

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #6 on: September 05, 2016, 07:02:41 AM »
The latest plugin release should have this fixed; now text files should be accessible for reading even when locked

Download from the usual website, link under my avatar
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

cmdrmcdonald

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #7 on: September 05, 2016, 12:10:33 PM »
You might want to take a look at EDDI (https://forums.frontier.co.uk/showthread.php/226649-EDDI-A(nother)-Voice-Attack-Plugin) which probably does what you want it to do.

Thanx for the suggestion.  I am already using EDDI.  I really like it and I'm incorporating many of the variables into my own profile to track things and get feedback.

However, what I'm looking to get from the netlog file is the 'interdictions', which I see are logged, but EDDI doesn't mention them.

Is there a way to fish those out with EDDI??

Thanx

I'm not aware of interdictions being shown in the netlog in a way that makes them possible to use in an interesting fashion.  The next release of Elite (2.2.) is going to have a journal that will have this information (and a lot more besides) made available in a sensible fashion and EDDI will support the journal events on its release.

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #8 on: September 05, 2016, 07:04:25 PM »
The latest plugin release should have this fixed; now text files should be accessible for reading even when locked

Download from the usual website, link under my avatar

Thanks for helping out with this.  Unfortunately, my command (which works, except for the locked file issue) is now returning "Not set" to the VA log instead of the log entry that I fish out with a regex.  :(

I did have to re-select the new plugin in my command and I made sure to re-populate the "Plugin Context" box to "read_file" and "Text Variables" box to "VAReaderFile;VAReaderRegEx".

When I put the old plugin back in, my command works again.

Maybe my regex isn't working with this update??

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #9 on: September 06, 2016, 12:30:36 AM »
Thanks for helping out with this.  Unfortunately, my command (which works, except for the locked file issue) is now returning "Not set" to the VA log instead of the log entry that I fish out with a regex.  :(

I did have to re-select the new plugin in my command and I made sure to re-populate the "Plugin Context" box to "read_file" and "Text Variables" box to "VAReaderFile;VAReaderRegEx".

When I put the old plugin back in, my command works again.

Maybe my regex isn't working with this update??

There shoudn't be any difference in that regard, I just changed the way the stream is opened to load the file in memory, the rest is the same... i tried with a very simple RegEx to fetch the system name from the netlog, with the ED client running, and it worked

You are getting 'Not Set' evwen with the client closed now?

If you wanna try and upload your specific profile, I can make a test focused at that...
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #10 on: September 06, 2016, 02:59:22 AM »
Thank you so much for the quick responses.

I got it sorted out.  I was using v1.07 and v1.4 has a different text variable for the returning result. :P  I copied the text variables to my profile and it seems to be working great.  ED is up and running and your plugin is reading the log file. :D

It's kinda late and I didn't check out if the command actually fishes out the interdiction entry while the game is running, but at least the plugin is able to read the file while it's open now.
« Last Edit: September 06, 2016, 03:03:56 AM by Technomancer »

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #11 on: September 06, 2016, 09:24:52 AM »
I'm not aware of interdictions being shown in the netlog in a way that makes them possible to use in an interesting fashion.  The next release of Elite (2.2.) is going to have a journal that will have this information (and a lot more besides) made available in a sensible fashion and EDDI will support the journal events on its release.

I'm just trying to fish out the line that says "interdictor" so that I can run my "Interdiction routine" of submitting, assigning pips, boosting and low/high waking or deploying weapons to fight.  Of course, if my theory works and the interdiction is detected in a timely manner (I'm not sure how quickly the log is updated), I can also have some dialog to spice things up. :)

EDDI certainly would be better for an "all-in-one" solution. 

Also, I ran into an old post a couple of weeks ago (by jgm I believe) where he put up the code for EDDI for download.  I can't, for the life of me, find that post now.  Do you know what I'm talking about?  I'd like to get it and check it out.

Thanx


cmdrmcdonald

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #12 on: September 06, 2016, 12:16:00 PM »
I'm not aware of interdictions being shown in the netlog in a way that makes them possible to use in an interesting fashion.  The next release of Elite (2.2.) is going to have a journal that will have this information (and a lot more besides) made available in a sensible fashion and EDDI will support the journal events on its release.

I'm just trying to fish out the line that says "interdictor" so that I can run my "Interdiction routine" of submitting, assigning pips, boosting and low/high waking or deploying weapons to fight.  Of course, if my theory works and the interdiction is detected in a timely manner (I'm not sure how quickly the log is updated), I can also have some dialog to spice things up. :)

EDDI certainly would be better for an "all-in-one" solution. 

Also, I ran into an old post a couple of weeks ago (by jgm I believe) where he put up the code for EDDI for download.  I can't, for the life of me, find that post now.  Do you know what I'm talking about?  I'd like to get it and check it out.

Thanx

EDDI won't support the interdiction items until 2.2.

You can find EDDI's source at https://github.com/cmdrmcdonald/EliteDangerousDataProvider/

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #13 on: September 14, 2016, 12:55:26 AM »
Quick question for Antaniserse:

Can the VxRegEx variable be populated with a token? i.e.: ((?<={TXT:VxResult})[^\]]+)  <---That will populate as intended when sent to the VA log, but I'm not sure if the plugin is resolving the token or if it's taking it literally...?
EDIT: got it working with a token. I had an extra bracket in the regex screwing things up. :P

Plugin is working great...unfortunately, the ED log is not very "reliable".

It throws out entries on time, late, whenever...  ???

It throws out interdiction entries that get picked up by my regex, then no interdiction happens.  It throws out Docked AND Undocked almost simultaneously, even when an Undock has not happened yet.  It's all over the place.

I'll keep hammering at it.

« Last Edit: September 14, 2016, 02:59:46 AM by Technomancer »

cmdrmcdonald

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #14 on: September 14, 2016, 06:14:51 AM »
Quick question for Antaniserse:

Can the VxRegEx variable be populated with a token? i.e.: ((?<={TXT:VxResult})[^\]]+)  <---That will populate as intended when sent to the VA log, but I'm not sure if the plugin is resolving the token or if it's taking it literally...?
EDIT: got it working with a token. I had an extra bracket in the regex screwing things up. :P

Plugin is working great...unfortunately, the ED log is not very "reliable".

It throws out entries on time, late, whenever...  ???

It throws out interdiction entries that get picked up by my regex, then no interdiction happens.  It throws out Docked AND Undocked almost simultaneously, even when an Undock has not happened yet.  It's all over the place.

I'll keep hammering at it.

Bear in mind that the only reliable events in the netlog are entering/leaving supercruise, and jumping systems.  This is because the other items in the log are for all ships and not just your own.

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #15 on: September 15, 2016, 01:43:40 AM »
Bear in mind that the only reliable events in the netlog are entering/leaving supercruise, and jumping systems.  This is because the other items in the log are for all ships and not just your own.

Seriously...?  Even in solo??

Not that I don't believe you.  You obviously have way more experience here, but why in the world does the log spit out entries for anyone but the actual player (in solo)???

Whatever.  Let's see what the Commander's Log has to offer.  Seems pretty comprehensive.

cmdrmcdonald

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #16 on: September 15, 2016, 07:18:49 AM »
Bear in mind that the only reliable events in the netlog are entering/leaving supercruise, and jumping systems.  This is because the other items in the log are for all ships and not just your own.

Seriously...?  Even in solo??

Not that I don't believe you.  You obviously have way more experience here, but why in the world does the log spit out entries for anyone but the actual player (in solo)???

Whatever.  Let's see what the Commander's Log has to offer.  Seems pretty comprehensive.

Yeah 'fraid so.  The other ships are both PCs and NPCs, so even in solo you don't avoid the issue. It's because the netlog has a lot of state tracking information in it but wasn't designed to be used by players.

And yes, the journal should be a lot more useful.  We'll have to wait for the beta to see how close to the document it really comes, of course.

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #17 on: September 28, 2016, 09:11:31 AM »
OK, well, after some regex juggling, I got this working about 90% reliable.  And the only caveat is the log not being updated "immediately" after every action.

Hence, about 90% of the time I dock, almost instantly upon touch down, the VA commands picks up the log entry and notifies me, "Dock successful, contacting station computers..." and runs the EDDI dock event.  Same with undocking (I wrote a little VA routine for undocking which "unlocks" actions that shouldn't/can't take place while docked, like deploying weapons, supercruise, chaff, heat sinks, messing with the landing gear, etc.; that way they stay in sync with the game).

What happens the other, roughly, 10% of the time is that I dock and "nothing happens".  So I'll go to the Mission Boards and browse around a bit. Then after a little while, apparently, the log updates and I get the "Dock successful..." notification and everything runs.  Same with undocking.

I have made a "manual" command version of Docking and Undocking, in case of these failures, so I'm covered.  Just wish the client was consistent in updating the log quickly. :P

JGFarris

  • Newbie
  • *
  • Posts: 49
    • My Facebook Page
Re: VAExtensions, a general purpose plugin
« Reply #18 on: October 06, 2016, 07:38:16 PM »
Hello brand new forum!

On the link below you can find a utility/general purpose plugin for dealing with text files, XML, RSS feed and so on, that I've being thinkering with for quite some time; you may remember my old 'VATextReader/VAMath/etc." plugins posted a while ago in the Google Group... this is a collection and polish of that same stuff, with some new features added

Documentation is still absent, but you may refer to the sample profiles and the old documentation found in the above plugins... feel free to ask for any help

Source and binaries here: https://github.com/Antaniserse/VAExtensions

when trying to build this project, I get an error about NuGet package not being installed? I'm very new to Visual Studio, but I did a little research  and downloaded the NuGet Package Explorer, and also downloaded System.Data.SQLite.Core through the package Explorer. Unfortunately, I'm still getting the same error message, which is:

Severity   Code   Description   Project   File   Line   Suppression State
Error      This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\System.Data.SQLite.Core.1.0.102.0\build\net40\System.Data.SQLite.Core.targets.   VAExtensions   C:\Users\Jerry Farris\Documents\Visual Studio 2015\Projects\VAExtensions\VAExtensions.vbproj   199

What am I doing wrong?
Jerry Farris, Jr.
Entrepreneur, Programmer and Disability Advocate
jerry@jerryfarris.com

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #19 on: October 07, 2016, 03:53:20 AM »
What am I doing wrong?
More likely than not, it's me that is doing something wrong; I'm still not entirely sure what is the best behaviour concerning GitHub and NuGet packages  ::)

Anyway, if you have downloaded the files all you should need to do is add the library in the project references (Property->references).
The Package Manager integrated with Visual Studio (not entirely sure if the 'NuGet Package Explorer' is the same thing, you shouldn't have to download that separately...) should have already done that for you, but maybe try removing and re-adding manually.

On a different, clean machine with VS2013 and the default NuGet tools, I didn't have to do anything at all: downloaded the ZIP from GitHut, opened the solution and upon first building I saw this little popup


everything missing was downloaded and built succesfully
« Last Edit: October 07, 2016, 03:58:37 AM by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

JGFarris

  • Newbie
  • *
  • Posts: 49
    • My Facebook Page
Re: VAExtensions, a general purpose plugin
« Reply #20 on: October 07, 2016, 10:46:08 AM »
Anyway, if you have downloaded the files all you should need to do is add the library in the project references (Property->references).
The Package Manager integrated with Visual Studio (not entirely sure if the 'NuGet Package Explorer' is the same thing, you shouldn't have to download that separately...) should have already done that for you, but maybe try removing and re-adding manually.
well, I'll keep messing with it. In the meantime,  I was finally able to connect to my SQL server database from within my own project. :-)

I just love programming. :-)
Jerry Farris, Jr.
Entrepreneur, Programmer and Disability Advocate
jerry@jerryfarris.com

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #21 on: November 23, 2016, 08:23:20 AM »
Version 2.0 is out, with support for the new VoiceAttack plugin interface... requires VoiceAttack 1.6 or later
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2800
Re: VAExtensions, a general purpose plugin
« Reply #22 on: November 23, 2016, 09:03:41 AM »
Awesome :)

Frici

  • Newbie
  • *
  • Posts: 15
Re: VAExtensions, a general purpose plugin
« Reply #23 on: November 24, 2016, 01:52:13 PM »
Version 2.0 is out, with support for the new VoiceAttack plugin interface... requires VoiceAttack 1.6 or later

Great! thanks for your hard work :D

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: VAExtensions, a general purpose plugin
« Reply #24 on: February 16, 2017, 10:06:34 AM »
Late to the party...haven't played ED in a while, but...

SCHWEEET!!!

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #25 on: February 27, 2017, 11:33:11 AM »
This sounds super cool and might be a great way to test the water with the plugins. I'll definitely need to check this out!!

Thanks for the great work!  :D

Gangrel

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: VAExtensions, a general purpose plugin
« Reply #26 on: March 12, 2017, 04:58:59 PM »
I am trying to come up with a command that reads a string from a text file and paste it into Elite Dangerous text entry box. And then the next time it does the next line. So on and so forth.

Currently I am having to use 2 commands (one to copy) and another to paste, and I was wondering if there was a method to do this using this extension....

Mr Talkalot

  • Newbie
  • *
  • Posts: 12
Re: VAExtensions, a general purpose plugin
« Reply #27 on: March 28, 2017, 01:02:28 AM »
Would really like some basic information on how to install and use this.

I have some commands in a xlsx format that I would like to convert to a VA Profile,
that I can add to my current profile for ED.

Any other help about how to use txt, html, and other formats with VA would be greatly appreciated
by this non programmer.

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #28 on: March 28, 2017, 04:01:32 AM »
Would really like some basic information on how to install and use this.

I have some commands in a xlsx format that I would like to convert to a VA Profile,
that I can add to my current profile for ED.

Any other help about how to use txt, html, and other formats with VA would be greatly appreciated
by this non programmer.

Installation is pretty straightforward: take the folder (not the single files) inside the zipped archive, and extract inside the \Apps directory in your main VoiceAttack folder, so that you end up with a \Apps\VAExtensions\<some files> structure

After that, just launch VoiceAttack and, if you have plugin enabled in your options, you should see a confirmation message in the log that VAExtensions has been loaded... import the sample profiles included to have a look at the various functions

Note, however, that all the TXT/XML/CVS/etc. reading capabilities of the plugin are not meant to directly import new commands from those files into your profiles, but rather to use the data inside to feed your various actions with whatever extra info you might need from external files

"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

rpoteat

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #29 on: March 28, 2017, 09:51:08 PM »
Note, however, that all the TXT/XML/CVS/etc. reading capabilities of the plugin are not meant to directly import new commands from those files into your profiles, but rather to use the data inside to feed your various actions with whatever extra info you might need from external files

 ???
This is the part I find most confusing and would want a little more guidance and instruction on..,,,,,

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #30 on: March 29, 2017, 08:20:26 AM »
This plugin can read and write data to and from VoiceAttack values/variables. It does not make profiles or commands.

In a way, it's a more advanced version of the "Value from file/URI" feature built into VoiceAttack's "Set a Text Value" action.

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #31 on: March 30, 2017, 08:20:33 AM »
This plugin can read and write data to and from VoiceAttack values/variables. It does not make profiles or commands.

In a way, it's a more advanced version of the "Value from file/URI" feature built into VoiceAttack's "Set a Text Value" action.
Yes, pretty much this... it gives you a finer control over what format and what chunks of data you can extract from those files, compared to the built in "Value from file" action
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #32 on: May 01, 2017, 02:38:53 PM »
I tried out the VAExtensions plugin and the CSV Sample. For ease of viewing as of this writing, the CSV example file contains:

Code: [Select]
Ship            System        Station
Asp Explorer    Caledo        Jael Port
Sidewinder BD-02 5286     Borlaug Dock

...and the spoken output from running the "load file" command from the CSV Sample profile is: "file loaded, 2 rows and 3 columns."

The "read value" command from the CSV Sample profile contains:

Code: [Select]
Set Text [VxFile] to 'TestData\testcsv.csv'
Set integer [VxRow] value to 1
Set integer [VxColumn] value to 2
Execute external plugin, 'VA Extensions 2.0' and wait for return
Begin Small Integer Compare : [VxError] Equals 0
    Say, '{TXT:VxResult}'  (and wait until it completes)
End Condition
Begin Small Integer Compare : [VxError] Does Not Equal 0
    Write '[Red] {TXT:VxResult}' to log
End Condition - Exit when condition met
Pause 1 second
Set integer [VxRow] value to 2
Set Text [VxColumn] to 'Ship'
Execute external plugin, 'VA Extensions 2.0' and wait for return
Begin Small Integer Compare : [VxError] Equals 0
    Say, '{TXT:VxResult}'  (and wait until it completes)
End Condition
Begin Small Integer Compare : [VxError] Does Not Equal 0
    Write '[Red] {TXT:VxResult}' to log
End Condition - Exit when condition met

...and the spoken output for this command is: "Caledo" (pause) "BD-02 5286"

What I don't quite understand is how the "BD-02 5286" was returned when I'm sending VxColumn as 'Ship' (which would technically be the first column). I was expecting the output to be "Sidewinder" for the second spoken phrase (VxRow = 2 and VxColumn = Ship).

Am I mistaken here or does the "read_csv" plugin context not accept text variables for referencing rows or columns?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #33 on: May 01, 2017, 02:47:41 PM »
It's a little confusing when you're following the examples, but the column number takes precedence over the column name, so you have to clear the column number variable for the plugin to read the text variable:
Code: [Select]
Set integer [VxColumn] value to [Not Set]
So to get the example working:
Code: [Select]
Set Text [VxFile] to 'TestData\testcsv.csv'
Set integer [VxRow] value to 1
Set integer [VxColumn] value to 2
Execute external plugin, 'VA Extensions 2.0' and wait for return
Begin Small Integer Compare : [VxError] Equals 0
    Say, '{TXT:VxResult}'  (and wait until it completes)
End Condition
Begin Small Integer Compare : [VxError] Does Not Equal 0
    Write '[Red] {TXT:VxResult}' to log
End Condition - Exit when condition met
Pause 1 second
Set integer [VxRow] value to 2
Set integer [VxColumn] value to [Not Set]
Set Text [VxColumn] to 'Ship'
Execute external plugin, 'VA Extensions 2.0' and wait for return
Begin Small Integer Compare : [VxError] Equals 0
    Say, '{TXT:VxResult}'  (and wait until it completes)
End Condition
Begin Small Integer Compare : [VxError] Does Not Equal 0
    Write '[Red] {TXT:VxResult}' to log
End Condition - Exit when condition met

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #34 on: May 01, 2017, 02:56:52 PM »
As usual, Pfeil is the man (and freaky quick with his response)!

As a side note I have a sneaking suspicion that the comparison of VxRow in the "search value" command within the CSV Sample profile should be an INTEGER comparison and not a SMALL INTEGER comparison.

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #35 on: May 02, 2017, 12:15:41 AM »
It's a little confusing when you're following the examples, but the column number takes precedence over the column name, so you have to clear the column number variable for the plugin to read the text variable

Yes, this is pretty much true elsewhere in the examples too.

Ever since the introduction of the new plugin interface, VA gives access to the whole range of existing variables to the plugin code (while the previous implementation only pushed the specific variables mentioned in the 'execute plugin' window), so it is not always obvious which ones you want to consider in the specific call and which ones are to be ignored

Now, to avoid any ambiguity, you need to clear the unused variables before executing other functions; at some point I should probably rework the code and samples a bit to make use of the new scoped variables (with ~ and >), which avoids these kind of issues

Quote
As a side note I have a sneaking suspicion that the comparison of VxRow in the "search value" command within the CSV Sample profile should be an INTEGER comparison and not a SMALL INTEGER comparison.
That is correct: line should read
Code: [Select]
    Begin Integer Compare : [VxRow] Equals 0
« Last Edit: May 02, 2017, 12:20:32 AM by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #36 on: May 02, 2017, 08:02:49 AM »
Is it possible to use VAExtensions to write to a CSV? If so is there an example to reference?

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #37 on: May 02, 2017, 11:15:01 AM »
Is it possible to use VAExtensions to write to a CSV? If so is there an example to reference?

Not at this time

So far, basically every file manipulating function has been set for reading only, both as a safety measure and because for the most part people seems more interested in fetching data to feed to VA rather than the opposite

What kind of use did you have in mind: writing a file from scratch (easy) or saving data in specific "cells" of an existing CSV , by specifying row and colums (more complex)?
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #38 on: May 02, 2017, 11:52:18 AM »
I'm nearly finished developing a Mass Effect 3 profile that requires a fair amount of voiced user input depending on how much the user wants to customize his/her experience. I intend to publish the work as a mod, so I'm aiming to minimize the time required to get users up and running as well as the time users need to spend working directly with VA (besides issuing setup and in-game commands). I'm still refining and testing all the commands, but I can provide you more detail here or via PM if you want more context. Basically VA has to be "taught" the state of the game by the user (Shepard's class, current squadmates, available powers, etc), and VA saves all these variables for later use. Being able to export these variables outside of the profile would be quite handy, especially since different saved games may required different values for the profile variables.

Ideally it would be great to be able to search an external file for whatever variable I need, which keeps me from having to make sure that the order that VA defines variables exactly matches the order they appear in the external file. I also really like the array aspect of the CSV, which makes visualization and transfer of blocks of variables easier.

I agree with you in that more users probably just want to read a file instead of write to a file, but for my purposes VA is the engine by which everything is created and storing it externally would add more flexibility and robustness.

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #39 on: May 02, 2017, 03:30:03 PM »
Basically VA has to be "taught" the state of the game by the user (Shepard's class, current squadmates, available powers, etc), and VA saves all these variables for later use.


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.
So, I would suggest having a look at the INI sample profile instead, which is one of the few set of functions that has also writing support already coded, and should also be faster than CSV parsing
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #40 on: May 03, 2017, 07: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

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #41 on: May 04, 2017, 01: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

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #42 on: May 08, 2017, 09: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: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #43 on: May 09, 2017, 02: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

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: VAExtensions, a general purpose plugin
« Reply #44 on: May 09, 2017, 07: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

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #45 on: July 09, 2017, 02: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: 4647
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #46 on: July 09, 2017, 07: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, 07:37:29 AM by Pfeil »

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #47 on: July 10, 2017, 06: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, 06: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: 4647
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #48 on: July 10, 2017, 07: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

  • Guest
Re: VAExtensions, a general purpose plugin
« Reply #49 on: July 12, 2017, 03: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: 4647
  • RTFM
Re: VAExtensions, a general purpose plugin
« Reply #50 on: July 12, 2017, 03: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.

blueknight

  • Newbie
  • *
  • Posts: 14
Re: VAExtensions, a general purpose plugin
« Reply #51 on: October 23, 2017, 12:24:45 AM »
Is there a way to grab the whole Row and assign it to variables with one lookup?

here is an example of flow:
1. Search for something
2. Get Answer Back on a Row (lets Say 2)
3. Do Lookup on Row and automatically come back with.
a. Row2 / Column 1 - Then stick the result in Variable-2-1
b. Row2 / Column 2 - The Stick the result in Variable-2-2

etc

I have the logic of doing multiple reads, but since you have all of this already loaded in memory, what would be the easier way to look it up.


blueknight

  • Newbie
  • *
  • Posts: 14
Re: VAExtensions, a general purpose plugin
« Reply #52 on: October 24, 2017, 11:02:02 PM »
So I am getting an error what I am trying to do is create a suffix in Voice attack then take the data and feed it through to the  script to be able to look up things.

So as an example my file contains.
VAName,Row 2, Row 3, Row 4

So what I am trying to do is grab the variable from the command (When I say). Then look that up in VAName, then grab the row and bring back all the other variables.

So what I am noticing is that I am getting a ROW not set. Can anyone help with this?

Code: [Select]
    Set Text [VxArgs] to '{SUFFIX}'
    Write '[Pink] VxArgs = {TXT:VxArgs}' to log
    DISABLED - Set Text [VxFile] to [Var-Systems-File]
    Write '[Purple] File set to = {TXT:VxFile}' to log
    Set Text [VxColumn] to 'VAName'
    Write '[Pink] Column = {TXT:VxColumn}' to log
    Write '[Purple] Executing Plugin for Search' to log
    Execute external plugin, 'VA Extensions 2.0' and wait for return
    Write '[Red] {TXT:VxResult}' to log
    Begin Small Integer Compare : [VxError] Equals 0
        Begin Small Integer Compare : [VxRow] Equals 0
            Say, 'Commander {TXT:VAR-CMDR-Name}, System name not found. Please add it to my list if you want to go there frequently. '  (and wait until it completes)
        End Condition
    End Condition
    Begin Small Integer Compare : [VxError] Does Not Equal 0
        Write '[Red] {TXT:VxResult}' to log
    End Condition - Exit when condition met
    Set integer [VxRow] value to the value of [VxResult]
    Set integer [VxColumn] value to [Not Set]
    Set integer [VxColumn] value to 2
    Execute external plugin, 'VA Extensions 2.0' and wait for return
    Begin Small Integer Compare : [VxError] Equals 0
        Say, '{TXT:VxResult}'  (and wait until it completes)
    End Condition
    Begin Small Integer Compare : [VxError] Does Not Equal 0
        Write '[Red] {TXT:VxResult}' to log
    End Condition - Exit when condition met


Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: VAExtensions, a general purpose plugin
« Reply #53 on: October 28, 2017, 12:14:10 AM »
Sorry, are we talking about what plugin function, exactly? The one that reads CSV files?

If I understand the code above correctly, after you call the plugin for a "search_csv" action, you don't need to do:

Code: [Select]
    Set integer [VxRow] value to the value of [VxResult]
because it already contains the index of the found row; VxResult is also storing this, but a a text variable, not a int one

I'll have a look into the full row result you mentioned earlier....
« Last Edit: October 28, 2017, 12:26:12 AM by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Wolfang42

  • Newbie
  • *
  • Posts: 13
Re: VAExtensions, a general purpose plugin
« Reply #54 on: November 25, 2023, 01:18:51 PM »
Is there a way to make
Code: [Select]
[VxResult] *not* have
Code: [Select]
" surrounding the result?

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 264
  • Upstanding Lunatic
    • My AVCS Homepage
Re: VAExtensions, a general purpose plugin
« Reply #55 on: November 26, 2023, 09:32:28 AM »
You can just replace it with nothing: