lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi Jeremy,

Thanks for your answer. Yes that is exactly the product. 
I already contacted their customer support and they helped me to connect to
C#.NET from EyeonScript via LuaInterface.

But I would like to connect to EyeonScript from C#.NET.
This is basically what I did:
- I made a sample project for LuaInterface in Visual Studio (see attachment)
- I renamed eyeonscript.dll to lua50.dll (so that LuaInterface would load
the renamed eyeonscript.dll which seemed to work).
- I tried to type some EyeonScript specific commands and got the error
messages attempt to call global `Fusion' (a nil value) (see below).
- When it didn't work I tried to find answers in many forums etc. which
didn't work either. You are the first one to answer :).

Could you maybe explain your steps below in more detail? Or even point out
what I would need to change in the attached program?
It makes sense to try to load the Eyeon Script enviroment (which is what I
tried by renaming the files) but I don't know how to do it :).

Thank you very much for your help
Patrick

-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of
jdarling@eonclash.com
Sent: Mittwoch, 17. Mai 2006 11:32
To: Lua list
Subject: RE: LuaInterface, C# and EyeonScript

If this is the same thing as Eyeon Script that ships with Fusion 5
(http://www.eyeonline.com/Web/EyeonWeb/Products/fusion5/fusion5.aspx)
then here is what I would say:

1) Make sure that your loading the proper lua environment.
2) Make sure that your either requiring the Eyeon Script environment, or
loading it after you load Lua.
3) In the case of 2 make sure that you have linked the Eyeon Script
environment with your script instances.
4) Since you paid for the product, contact their customer support and ask
them whats wrong :)

 - Jeremy

"Help I suffer from the oxymoron Corporate Security."


> -------- Original Message --------
> Subject: LuaInterface, C# and EyeonScript
> From: "Patrick Wolf" <mail@patrickwolf.net>
> Date: Tue, May 16, 2006 5:42 pm
> To: <lua@bazar2.conectiva.com.br>
> 
>      
>   
> Hi,
> 
> my question is regarding C# and LuaInterface.
> 
> The program I work with Digital Fusion 5 has Lua as an embedded scripting
language called EyeonScript. This language extends Lua.
> For example it is possible to use the statement fusion = 
> Fusion("localhost") to connect to an instance of Digital Fusion from 
> EyeonScript.
> 
> Now I would like to use LuaInterface to access this version of Lua
(EyeonScript) from C#.
> But as a result I get:
> 
> > fusion = Fusion("localhost")
> > stdin:1: attempt to call global `Fusion' (a nil value) stack
> > traceback:
> > stdin:1: in main chunk
> > [C]: ?
> > dump(fusion)
> > stdin:1: attempt to call global `dump' (a nil value) stack traceback:
> > stdin:1: in main chunk
> > [C]: ?
> 
> It seems like the additional functions from the EyeonScript version of Lua
would need to be registered somewhere to be accessible?
> 
> I would also think that this might be a common problem as other companies
would also include extended versions of Lua with their programs? How has
anybody else solved this challenge?
> 
> Thanks very much for your help
> Patrick

using System;
using LuaInterface;

namespace LuaCon
{
   class Program
   {
      private bool bRunning = true;
      public static Lua pLuaVM = null;

      public Program()
      {
         pLuaVM = new Lua();
         pLuaVM.OpenBaseLib();
         pLuaVM.OpenIOLib();
         pLuaVM.OpenStringLib();
         pLuaVM.OpenMathLib();
         pLuaVM.OpenTableLib();
         pLuaVM.OpenDebugLib();
         pLuaVM.OpenLoadLib();
      }

      static void Main(string[] args)
      {
         Program pPrg = new Program();
         pPrg.Run();
      }

      public void Run()
      {
         String strInput;

         while (bRunning)
         {
           Console.Write("> ");

            strInput = Console.ReadLine();
            if (strInput == "quit")
               bRunning = false;
            else
            {
               Console.WriteLine();
               try
               {
                   object o = new object();

                  o=pLuaVM.DoString(strInput);
                 // Console.WriteLine(o);
               
               }
               
               catch (Exception ex)
               {
                  Console.WriteLine(ex.Message);
               }

               finally
               {
                 // Console.WriteLine();
               }
            }
         }
      }
   }
}