0

Can someone point me the steps to include a multiline texbot, where i can use lua in my application as a scripting feature, what do i need to import and how to do it, theres a few tutorials about c#, theres almost nothing about vb.net i tried to include it but i cant import lua into the vb.net or well im not doing it properly, if any one could help me. thanks in advance

question : how can i embed lua in my program to make it able to run lua scripts with vb.net

Wesker Power
  • 9
  • 1
  • 5

1 Answers1

1

You can use a library called "LuaInterface" http://luaforge.net/projects/luainterface/

Heres the LuaInterface Manual (PDF): https://warcraftaddonstudio.svn.codeplex.com/svn/trunk/src/References/LuaInterface/src/luainterface/doc/guide.pdf

"LuaInterface is a library for integration between the Lua language and Microsoft .NET platform's Common Language Runtime (CLR). Lua scripts can use it to instantiate CLR objects, access properties, call methods, and even handle events with Lua functions."

With this library in mind, we can then take a look at a question that is very similar to yours, asked by another individual. Lua in Visual Basic.net

You can refer to this link for a LuaInterface Tutorial: http://penlight.luaforge.net/project-pages/penlight/packages/LuaInterface/

With this said, the previous user that asked the question similar to yours posted some code that can come in handy in understanding the process you must follow to execute LUA within a VB.NET Form. It appears to be straight forward and will more than likely be sufficient for what you wish to accomplish.

Heres the code provided by user: bubby4j in his original question.

Imports LuaInterface
Public Class Form1 

Public luascripting As New Lua()

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 

luascripting.RegisterFunction("DisplayText", Me,Me.GetType().GetMethod("DisplayText"))

luascripting.DoFile("script.lua") 

End Sub 

End Class 

I hope this helps you accomplish what you have in mind! Good luck. Dayan D.

Community
  • 1
  • 1
Dayan
  • 7,634
  • 11
  • 49
  • 76
  • Your welcome, hopefully it works! Do a bit of searching around in Google, i found some good stuff there. GL – Dayan Jul 26 '12 at 22:45
  • i know problem is google algorithym its messing my search and i cant never get what i want, i miss the old google... but anyways thank you – Wesker Power Jul 27 '12 at 16:37