Is it possible to run a .lua file, or a .jar file?

nate890:

.<.
Let's say there is a .Lua file, named open.lua, with the following code:
os.execute([[start "" "C:\Users\User\Documents\Song.mp3"]])
When that code is ran, a .mp3 file, named "Song" will play.

Sure, just write some Lua that talks to the Arduino over a serial port. When it gets a message it likes, it invokes this command. Of course, this is really a round-about way of starting your OS and install specific handler for the .mp3 filetype. You could just as easily have a Perl script do this; or a .bat file; or a C program.

Lua can do this just as easily as any other language.

And this is why I was asking if it was possible to RUN A .LUA FILE from ARDUINO, not make a .Lua file detect when I want code to run (which would be super hacky, and it being Lua, I don't even think this would be possible (what above suggested)) Which is why "Write a Lua app that listens on a connection. When it gets something, it gets that something, parses it in some manner and then acts on the stuff it parses out." is more easily said than done.

Nonsense. Lua is complete language that has all sorts of libraries and OS specific hooks for all sorts of purposes like this. And if it can't do it, it can call a chunk of C code to do it.

However, to reinforce the same answer everyone else has given you: no, you cannot run a Lua app "from" the Arduino. Mostly because the question doesn't really apply. But you /can/ have the Arduino talk to an agent on any computer you like, and that agent can pretty much do anything you can dream up, including running a Lua script. The agent can even be written in Lua.

The Arduino can be coded to transmit over a variety of connections, from the built-in USB serial port to more complicated ethernet, Wi-Fi or other wireless options if you buy the hardware.

But the fundamentals are the same: you write an app that sends (or receives -- the concept is the same) over the connection of your choice. Assuming you want to use the USB port, there are easy libraries and examples showing how to do this on arduino.cc. Just get it working with the built-in serial monitor available in the Arduino IDE first.

Then you can work on writing an app that listens (or alternately listens and talks) on the other end of that connection. Based on the messages it receives on that connection, it plays a song or whatever. A "message" is whatever you want it to be. A string you reconstruct. A byte pattern you apply masks to that encode all sorts of state. The actual steps for doing this is left as an exercise for the reader. My advice is to solve the problem in discrete steps.

Synchronous serial communication is not hard, but the devil is in the details. And there are countless examples out there.