Author Topic: v1.8+ plugin/inline function documentation not fully consistent  (Read 1446 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
v1.8+ plugin/inline function documentation not fully consistent
« on: January 12, 2020, 09:06:14 AM »
A few corrections that could be made to the plugin/inline function documentation:

Quote from: VoiceAttackHelp.pdf v1.8+ page 187
InternalID() – returns a nullable Guid (Guid?) that indicates the internal id specified by the
profile author.
   Guid? commandId = vaProxy.Command. InternalID();
   if (commandId.HasValue) //if the internal id was indicated
   {
      //do something with the ID here
   }
Has a space between "Command." and "InternalID();"

Quote from: VoiceAttackHelp.pdf v1.8+ page 191
Exists(string CommandName) – This Boolean function returns true if a command is
available to the active profile with the name specified in CommandName.

   if (vaProxy.CommandExists(“fire weapons”))
   {
      vaProxy.ExecuteCommand(“fire weapons”);
   }
Uses the old methods, rather than the new sub-class ones

Quote from: VoiceAttackHelp.pdf v1.8+ page 191
Active(string CommandName) - This Boolean function returns true if the command
indicated by name in CommandName is actively executing (most likely long-running or
running in a loop).

   if (vaProxy.CommandActive(“fire weapons”) == false) //if command not active
   {
      vaProxy.ExecuteCommand(“fire weapons”); //execute the command
   }
Uses the old methods, rather than the new sub-class ones

Quote from: VoiceAttackHelp.pdf v1.8+ page 199
Example for inline function usage:

   public void main()
   {
      VA.ProfileChanging += MyProfileChangingAction;
   }

   public void MyProfileChangingAction(Guid? currentID, Guid? loadingID,
   String currentName, String loadingName)
   {
      VA.WriteToLog("Profile changing to " + loadingName, "orange");
   }
"+ loadingName" is erroneously highlighted in red (the snippet for plugin usage right below it does highlight the syntax correctly).

Quote from: VoiceAttackHelp.pdf v1.8+ page 200
public void main()
{
   VA.ProfileChanged += MyProfileChangedAction;
}

public void MyProfileChangedAction(Guid? previousID, Guid? currentID
String previosName, String currentName)
{
   VA.WriteToLog("Profile changed to " + currentName, "orange");
}
"previosName" is a typo
"+ currentName" is erroneously highlighted in red (the snippet for plugin usage right below it does highlight the syntax correctly).

Quote from: VoiceAttackHelp.pdf v1.8+ page 201
Example for inline function usage:

   public void main()
   {
      VA.ApplicationFocusChanged += MyApplicationFocusChangedAction;
   }

   public void MyApplicationFocusChangedAction(Process pFocus, String title)
   {
      VA.WriteToLog(title + " - " + pFocus.ProcessName , "orange");
   }
"+ pFocus.ProcessName" is erroneously highlighted in red (the snippet for plugin usage right below it does highlight the syntax correctly).
There is also a space between "ProcessName" and "," that isn't there in the plugin example


EDIT: All corrected.
« Last Edit: February 04, 2020, 08:40:06 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: v1.8+ plugin/inline function documentation not fully consistent
« Reply #1 on: January 14, 2020, 09:04:35 PM »
Wow - that was a lot of info and digging there, Pfeil.  Thanks for the help!

This has all been touched up and will be available in the next beta :)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: v1.8+ plugin/inline function documentation not fully consistent
« Reply #2 on: January 21, 2020, 08:22:40 PM »
Went over the changes, found one occurrence of an old method reference I didn't spot previously (came across it with the search function):

Quote from: VoiceAttackHelp.pdf v1.8+/v1.8.3.7 page 13
Plugin ExecuteCommand() function (command not executed)
references (only) the old method.

Quote from: VoiceAttackHelp.pdf v1.8+/v1.8.3.7 page 195
Exists(string CommandName) – This Boolean function returns true if a command is
available to the active profile with the name specified in CommandName.
if (vaProxy.Command.Exists(“fire weapons”))
{
   vaProxy.Command.Execute (“fire weapons”);
}
Now has a space between "Execute" and "(“fire"; The same snippet for "Active" below it does not.

Quote from: VoiceAttackHelp.pdf v1.8+/v1.8.3.7 page 203
Example for inline function usage:

   public void main()
   {
      VA.ProfileChanging += MyProfileChangingAction;
   }

   public void MyProfileChangingAction(Guid? currentID, Guid? loadingID,
   String currentName, String loadingName)
   {
      VA.WriteToLog("Profile changing to " + loadingName, "orange");
   }
"+" is erroneously highlighted in red (the snippet for plugin usage right below it does highlight the syntax correctly).

Quote from: VoiceAttackHelp.pdf v1.8+/v1.8.3.7 page 204
public void main()
{
   VA.ProfileChanged += MyProfileChangedAction;
}

public void MyProfileChangedAction(Guid? previousID, Guid? currentID
String previosName, String currentName)
{
   VA.WriteToLog("Profile changed to " + currentName, "orange");
}
"+" is erroneously highlighted in red (the snippet for plugin usage right below it does highlight the syntax correctly).

Quote from: VoiceAttackHelp.pdf v1.8+/v1.8.3.7 page 205
Example for inline function usage:

   public void main()
   {
      VA.ApplicationFocusChanged += MyApplicationFocusChangedAction;
   }

   public void MyApplicationFocusChangedAction(Process pFocus, String title)
   {
      VA.WriteToLog(title + " - " + pFocus.ProcessName , "orange");
   }
"+" is erroneously highlighted in red (the snippet for plugin usage right below it does highlight the syntax correctly).


As a general note, though it would affect all your documents edited in Word: It is possible to disable the replacement of standard double quotes with characters that will cause compilation of inline functions and plugins to fail to compile when copy/pasted: https://www.windowscentral.com/change-smart-quotes-straight-quotes-microsoft-office-word-outlook-powerpoint

Existing characters in the document would need be found/replaced even after turning this option off, but from then on it should no longer be an issue.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: v1.8+ plugin/inline function documentation not fully consistent
« Reply #3 on: January 22, 2020, 10:12:06 PM »
All touched up.  Thank you again, Pfeil!