Forum

> > CS2D > Scripts > Using kernel32.dll
Forums overviewCS2D overview Scripts overviewLog in to reply

English Using kernel32.dll

4 replies
To the start Previous 1 Next To the start

old Using kernel32.dll

TwTrooper
User Off Offline

Quote
I was making a script for a dedicated server when I had an Idea:

> I wanted the dialogs from commondialog.dll, LUA can't call them though, but accessing kernel32 i can get those dialogs too, I heard it's possible to call them, but how?

Me and a guy were talking about it and we found something like this:

1
2
3
local path = 'c:\\windows\\system32\\kernel32.dll'
    local f = assert(loadlib(path, "luaopen_socket"))
    f()  -- actually open the library

I only don't know what is this "luaopen_socket"

It should be a pre-made function

Does LUA supports kernel32.dll library? If so, how to open it?

Sorry if you guys think it's a bit crazy (very crazy actually)

old Re: Using kernel32.dll

SD
User Off Offline

Quote
You can do this out of the box only with a DLL which is specially written for Lua (see Lua reference). But you can do it with arbitrary libraries with alien.
1
2
local alien = require "alien"
local kernel32 = alien.load "kernel32.dll"
This isn't likely to work with CS2D anyway.

http://alien.luaforge.net/

old Re: Using kernel32.dll

ohaz
User Off Offline

Quote
You shouldn't be using win32 stuff when writing Lua scripts for CS2D. Most servers run on linux.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview