Author Topic: sqlite 3 for pxlua 5.1  (Read 5610 times)

0 Members and 1 Guest are viewing this topic.

Offline bluebear

  • Double Ace
  • *
  • Posts: 116
  • Karma: +12/-0
  • Life is a bitch - And then you marry one!
sqlite 3 for pxlua 5.1
« on: 30 May, 2006, 11:51:45 »
A un-tested build of liblua-sqlite3 for PXLua 5.1 is attached to this message.
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

PtokaX forum

sqlite 3 for pxlua 5.1
« on: 30 May, 2006, 11:51:45 »

Offline GeceBekcisi

  • Scripter
  • Lord
  • ******
  • Posts: 311
  • Karma: +10/-1
  • You don't need eyes to see, you need vision..
Re: sqlite 3 for pxlua 5.1
« Reply #1 on: 30 May, 2006, 12:06:40 »
Is there any change between LUA 5.02 build and this except LUA versions?
Do you need an advanced user handling script? Download UserBekcisi today (Latest Edit)
Features: User + ISP + GeoIP database, user info + share checking and many more...

Offline bluebear

  • Double Ace
  • *
  • Posts: 116
  • Karma: +12/-0
  • Life is a bitch - And then you marry one!
Re: sqlite 3 for pxlua 5.1
« Reply #2 on: 30 May, 2006, 12:18:20 »
Is there any change between LUA 5.02 build and this except LUA versions?

The build for Lua 5.0.2 is based on lua-sqlite3-0.3
The build for Lua 5.1 is based on lua-sqlite3-0.4.1

For further differences please see the readme.txt,
and consult the documentation provided on
Luaforge.net and in the zipped archive.

There is also probably the need for the borland dependency
wich can be downloaded from one of the mirrored sites.
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

Offline Psycho_Chihuahua

  • Systemspecialist IT
  • Emperor
  • **
  • Posts: 1 054
  • Karma: +112/-1
  • I am wherever i want to be
    • PtokaX Luaboard
Re: sqlite 3 for pxlua 5.1
« Reply #3 on: 31 May, 2006, 00:12:24 »
Mirror site updated with File and Borland dependencies (incase needed)

http://bluebear.psycho-chihuahua.net/#pxsqll3
PtokaxWiki ?PtokaX Mirror + latest Libs

01100001011011000111001101101111001000000110101101101110011011110111011101101110001000000110000101110011001000000101010001101111011010110110111101101100011011110111001101101000

Offline bluebear

  • Double Ace
  • *
  • Posts: 116
  • Karma: +12/-0
  • Life is a bitch - And then you marry one!
Re: sqlite 3 for pxlua 5.1
« Reply #4 on: 01 June, 2006, 08:56:26 »
Thanks for the up, bluebear.
You're still my hero.? ? ;D

Humming Stephen Lynch - "If I could be a superhero, I would be programmer-man"...


Btw. has anyone confirmed that this library actually works?
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

Offline plop

  • Forum God
  • ****
  • Posts: 2 464
  • Karma: +37/-0
Re: sqlite 3 for pxlua 5.1
« Reply #5 on: 06 June, 2006, 00:42:48 »
Btw. has anyone confirmed that this library actually works?
Code: [Select]
Syntax ../PxSQLite3.lua:81: attempt to index global 'sqlite3' (a nil value)with
Code: [Select]
local _luaopen_sqlite3 = package.loadlib("pxsqlite3L51.dll", "_luaopen_sqlite3")
_luaopen_sqlite3()

sqlite3.version()

snif snif, more fighting tomorrow.

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

Offline [ZD][Psycho]

  • Junior Member
  • **
  • Posts: 24
  • Karma: +1/-0
Re: sqlite 3 for pxlua 5.1
« Reply #6 on: 11 June, 2006, 07:33:34 »
Code: [Select]
Syntax ../PxSQLite3.lua:81: attempt to index global 'sqlite3' (a nil value)Same problem here. Anybody figure out what's wrong?
"Religion is regarded by the common people as true, by the wise as false, and by rulers as useful." -Seneca

Offline bluebear

  • Double Ace
  • *
  • Posts: 116
  • Karma: +12/-0
  • Life is a bitch - And then you marry one!
Re: sqlite 3 for pxlua 5.1
« Reply #7 on: 07 July, 2006, 14:12:36 »
I guess none of you got it to work.

I'll fix the problems in the near future.
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

Offline Pothead

  • Lord
  • ***
  • Posts: 455
  • Karma: +25/-4
Re: sqlite 3 for pxlua 5.1
« Reply #8 on: 07 July, 2006, 14:21:21 »
Fancy writing a dummies guide for how to do it, so i can have a go in the future. :)

Offline bluebear

  • Double Ace
  • *
  • Posts: 116
  • Karma: +12/-0
  • Life is a bitch - And then you marry one!
Re: sqlite 3 for pxlua 5.1
« Reply #9 on: 07 July, 2006, 14:44:55 »
A guide on howto create a extension for PXLua ?

Actually its rather easy :)

C++ lib for Lua 5.1:

#pragma comment(lib, "PXLua.lib")

extern "C" { // we dont need all of them in this sample, but does not hurt to include all
#  include "lua.h"
#  include "lualib.h"
#  include "lauxlib.h"
};

// The HelloWorld lua function
int lua_helloworld (lua_State *L) {
  if (lua_gettop(L) != 0) { // check no of arguments - we expect none (we dont need to do this in this case, but its just to show how)
    luaL_where(L,1); // at witch line did the error happen in the script
    lua_pushliteral(L, "Function should be called without arguments!"); // push the message
    lua_concat(L, 2); // concat; merge the where-message and the error-message
    lua_error(L); // halt the script and display the message
  }

  lua_pushstring(L, "Hello World!");
  return 1; // the number of objects we pushed onto the stack
}

// table of methods to register
static const luaL_reg our_methods[] = {
  {"FunctionName", lua_helloworld},
  {0,0}
};

// Lua entry point when loading
int __declspec(dllexport) libinit (lua_State* L) {
  luaL_register(L, "TableName", our_methods);
  return 0;
}

-- EOF --

The script:

libinit = package.loadlib("px_helloworld.dll", "_libinit") // the existance of "_" in the entrypoint depends on you compiler options.
libinit()

retval = TableName.FunctionName()
SendToAll(retval)

-- EOF --
Sincerely,
bluebear
--
http://www.thewildplace.dk/ is is closed - Use the following mirrors instead
http://bluebear.psycho-chihuahua.net
http://pxextension.piratez.dk/
[Lua extensions - Chat stats - YnHub PMSpy - DC Source code - and more]

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: sqlite 3 for pxlua 5.1
« Reply #10 on: 19 September, 2006, 18:35:21 »
Updated (0.3.5.1c) PXLua-Sqlite3-0.4.1...
For Lua 5.1.1

Source

Initializing like
Code: [Select]
require "sqlite3"

This will register global sqlite3 8)
« Last Edit: 14 October, 2006, 13:55:30 by PPK »
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: sqlite 3 for pxlua 5.1
« Reply #11 on: 14 October, 2006, 13:56:36 »
Well, is very hard to use this lib because missing documentation and script needed to use it. Get documentation and script here.
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

PtokaX forum

Re: sqlite 3 for pxlua 5.1
« Reply #11 on: 14 October, 2006, 13:56:36 »