Forum

Results 1 to 6 of 6
  1. #1
    Join Date
    October 2009
    Location
    -
    Posts
    20

    Little Windows Version post script

    As the title says, with this script you can post your Windows Version in the current channel. It uses a Lua Module to get needed information from Windows.

    See readme.txt for more details.

    Download 32 bit:
    http://www.gcs-clan.de/gwv_win32.zip

    Download 64 bit:
    http://www.gcs-clan.de/gwv_win64.zip

  2. #2
    Join Date
    December 2009
    Location
    Germany
    Posts
    9
    when i type the befehl in the chat TS say:
    Ungültiger Befehl: /lua load version.lua

  3. #3
    Join Date
    October 2009
    Location
    -
    Posts
    20
    You need to enable the Lua Plugin.

    German:
    Einstellungen->Plugins

    English:
    Settings->Plugins

  4. #4
    Join Date
    January 2010
    Location
    Australia
    Posts
    7
    Nice module, Sanji. I am trying to use a custom lua module in one of my scripts, but I can't get it to load. It loads fine in the normal lua interpreter, but not under ts3.

    Did you build the .dll yourself, or did you get it from somewhere else? If it's yours, can you post the source code and build command line?

  5. #5
    Join Date
    October 2009
    Location
    -
    Posts
    20
    i build it by myself. i will upload the sources later.

    did you linked the module against lua 5.1.4? you need to compile lua as static library.

    Edit:
    lua build command (lua.lib, inside folder lua-5.1.4/src):
    Code:
    cl /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE *.c
    lib /out:lua.lib lapi.obj lcode.obj ldebug.obj ldo.obj ldump.obj lfunc.obj lgc.obj llex.obj lmem.obj lobject.obj lopcodes.obj lparser.obj lstate.obj lstring.obj ltable.obj ltm.obj lundump.obj lvm.obj lzio.obj lauxlib.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj loslib.obj ltablib.obj lstrlib.obj loadlib.obj linit.obj
    getosversion.c
    Code:
    #ifdef _WINDOWS
    #include <windows.h>
    #include "getwindowsversion.h"
    #define LUA_BUILD_AS_DLL
    #else
    
    #endif
    
    #define LUA_LIB
    
    #include "lua.h"
    
    #include "lauxlib.h"
    #include "lualib.h"
    
    static int os_getosversion(lua_State *L) {
    #ifdef _WINDOWS
    	char szOS[256];
    
    	GetOSDisplayString(szOS,sizeof(szOS));
    
    	lua_pushstring(L,szOS);
    #else
    	//not supportet in this version
    #endif
    
    	return 1;
    }
    
    static const luaL_Reg getosversion[] = {
    	{"getosversion",os_getosversion},
    	{NULL,NULL}
    };
    
    LUALIB_API int luaopen_getosversion(lua_State *L) {
    	luaL_register(L,"_G",getosversion);
    
    	return 1;
    }
    module build command (getosversion.dll):
    Code:
    cl /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE getosversion.c
    link /out:getosversion.dll /DLL getosversion.obj lua.lib GetWindowsVersion_win32s.lib
    GetOSDisplayString_win32s.lib and GetOSDisplayString_win64s.lib:
    http://www.gcs-clan.de/GetOSDisplayString.zip
    Last edited by Sanji008; January 2nd, 2010 at 11:32 PM.

  6. #6
    Join Date
    January 2010
    Location
    Australia
    Posts
    7
    Quote Originally Posted by Sanji008 View Post
    i build it by myself. i will upload the sources later.

    did you linked the module against lua 5.1.4? you need to compile lua as static library.
    Thanks so much for this I wasn't even close hehe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •