Custom commands

MstrGareth

Active Member
I was looking thru K's sample on how to implement custom commands using IS/Dotnet and see she commented that the functionality is broken. After trying it myself to see if it was ever fixed, it appears it is still broken.

On an alternate route, is there a way to parse VG text input before VG tries to handle it? Something so we can perform custom replacements/commands and then decide to pass it on for VG to work with it, or stop it at that point?

Gracias
 

spudman

Active Member
where did you find the sample that 'tried' to do this?

I got it working using lavishscript using globalkeep atoms, but couldn't find a sample of how to do it in .net. The documentation on IS's page says an example is coming soon or something like that.
 

rootkit

Active Member
Yeah, .Net Command implementation seems to be a bit bugged. Back in June i tried to implement commands like this:
Code:
namespace Test
{
     static class Program
     {
// callback method matching LavishScript.Delegates.CommandTarget signature
        static int CommandTargetImpl(string[] args)
        {
              if (args[0]=="MyCommand") dosomeWork;
              return 1;
          
        }        
        static void Main()
        {
//register command and corresponding callback method
              LavishScript.Commands.AddCommand("MyCommand", CommandTargetImpl);
//remove command before exit
              LavishScript.Commands.RemoveCommand("MyCommand");
        }
    }
}
Using the command worked 2 or 3 times each run, then it crashed/freezed the whole shit.
 

Karye

Active Member
Told lax about it back when I wrote vgtrack. Keep bugging him about it to get it fixed. The implementation is similar to events and thats working. well, last I checked. Perhaps given enough friendly reminders he will get commands working.
 
Top Bottom