LUA scripting for BMX

BlitzMax Forums/BlitzMax Programming/LUA scripting for BMX

Nearly there. The script engine can now run from a string, from a file, call a function in LUA (pass in parameters, get the result). All that's left to do is the callback stuff for when LUA call you and I'll release it to everyone. Here is a taste of the required code to run from a scriptfile:

Function main()

	Local SEObject:ScriptEngine = New ScriptEngine

	' Run the script
	If (Not SEObject.RunScriptFile("testscript.txt")) Then
		Print "Error: " + SEObject.GetLastErrorString()
	Else
		Print "Script finised."
	End If

	' Shut it down
	SEObject.ShutDown()	
End Function