Forum

> > CS2D > Scripts > Open File Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English Open File Lua

8 replies
To the start Previous 1 Next To the start

old Open File Lua

Marcell
Super User Off Offline

Quote
Welcome!

I just want to get some help in this..
Possible to open file from http website with lua?

or connect to mysql server and query some tables..?

old Re: Open File Lua

useigor
User Off Offline

Quote
Look:
> Server transfer has written
// New since 0.1.1.8: HTTP Downloads
// You can also host your files on HTTP webservers instead of your game server.
// Use the following scheme to add HTTP file transfers:
// scheme: http://www.url.tld/myfile (web URL) > folder/file (local relative path)
// example: http://www.unrealsoftware.de/img/icons/cs2d.png > gfx/cs2dicon.png
//
// Warning: HTTP downloads might freeze the client for a few seconds if the webserver is slow!

But:
> Server transfer has written
// Only images (bmp,jpg,jpeg,png) and sounds (wav,ogg) are allowed! Other files will be ignored!

old Re: Open File Lua

Marcell
Super User Off Offline

Quote
user useigor has written
Look:
> Server transfer has written
// New since 0.1.1.8: HTTP Downloads
// You can also host your files on HTTP webservers instead of your game server.
// Use the following scheme to add HTTP file transfers:
// scheme: http://www.url.tld/myfile (web URL) > folder/file (local relative path)
// example: http://www.unrealsoftware.de/img/icons/cs2d.png > gfx/cs2dicon.png
//
// Warning: HTTP downloads might freeze the client for a few seconds if the webserver is slow!

But:
> Server transfer has written
// Only images (bmp,jpg,jpeg,png) and sounds (wav,ogg) are allowed! Other files will be ignored!



i found something, but i don't know it's usable... anyway it's a lua-mysql connection if everythings right:
Connection:
1
2
3
local db, err = mysql.connect('host', 'user', 'passwd')

local res = db:query('select * from `table`')

is this only works with local server?

old Re: Open File Lua

mafia_man
User Off Offline

Quote
user Marcell has written
user useigor has written
Look:
> Server transfer has written
// New since 0.1.1.8: HTTP Downloads
// You can also host your files on HTTP webservers instead of your game server.
// Use the following scheme to add HTTP file transfers:
// scheme: http://www.url.tld/myfile (web URL) > folder/file (local relative path)
// example: http://www.unrealsoftware.de/img/icons/cs2d.png > gfx/cs2dicon.png
//
// Warning: HTTP downloads might freeze the client for a few seconds if the webserver is slow!

But:
> Server transfer has written
// Only images (bmp,jpg,jpeg,png) and sounds (wav,ogg) are allowed! Other files will be ignored!



i found something, but i don't know it's usable... anyway it's a lua-mysql connection if everythings right:
Connection:
1
2
3
local db, err = mysql.connect('host', 'user', 'passwd')

local res = db:query('select * from `table`')

is this only works with local server?

1
local db, err = mysql.connect('host', 'user', 'passwd')
Code has written
host

Blind?

old Re: Open File Lua

Marcell
Super User Off Offline

Quote
i don't know a lot about lua yet...
so i think'd "local" mean local connection.. but i also think'd on "host" too...

so thanks..

old Re: Open File Lua

Starkkz
Moderator Off Offline

Quote
local is a keyword that you can use in lua to define local variables, they different from the global variables that can be accessed from any part of the Lua script.

If you want to research on socket stuff, I'll share with you my socket library (file cs2d Lua BNet library (Windows only) ). You can also use LuaSocket for this stuff.

old Re: Open File Lua

Marcell
Super User Off Offline

Quote
user Starkkz has written
local is a keyword that you can use in lua to define local variables, they different from the global variables that can be accessed from any part of the Lua script.

If you want to research on socket stuff, I'll share with you my socket library (file cs2d Lua BNet library (Windows only) ). You can also use LuaSocket for this stuff.



Anyway an another question..
BlitzPlus can be make same scripts as BlitzMax?

old Re: Open File Lua

Marcell
Super User Off Offline

Quote
I just wanna make a user system, which not read informations from local file.
I wanna read it from remote..at serverside..
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview