3
votes

How would a person use the Lua scripting language to do things such as this:

Opening an application such as IE and controlling it, accessing the C drive and the current directory that the .lua file is located to modify, move, create and delete files.

Any links to references for this would be appreciated, I cannot find any clear documentation anywhere.

2
Are you going to be integrating Lua in C# or other language as a way to provide extensibility? - IAbstract
I am planning on doing something like that at some point. - Jack

2 Answers

7
votes

Generally speaking, Lua doesn't have this kind of stuff built-in. Lua is a minimalist programming language, great for embedding. The core language only uses facilities available in C89. If you want bells and whistles, you need to add Lua libraries.

You can find libraries by searching the wiki, at luarocks, luadist, or luaforge

For "controlling IE" you should take a look at LuaCom

For accessing the current directory, try LuaFileSystem

6
votes

I'll add to Doug's correct answer the observation that you might be better off not attempting to control IE if the actual goal is just to fetch web pages at the whim of a script. For that, a library like cURL is a much better choice, and there is a binding to it for Lua known as luacurl.

That binding, along with all of the bindings mentioned by Doug are available as part of the Lua for Windows distribution. Reading between the lines, you are most concerned about the Windows platform, so that distribution should be your starting point.

If you plan to integrate Lua with C# and other .NET languages, then you will want to investigate LuaInterface as well.