Embedding LUA in PureBasic!?

Everything else that doesn't fall into one of the other PB categories.
FloHimself
Enthusiast
Enthusiast
Posts: 229
Joined: Wed May 14, 2003 3:38 pm
Location: Lüneburg - Germany

Post by FloHimself »

@JC
see the post above. The include file will be used for further versions.
My favorite numbers: 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

damnnnn.. 5.1 wrapper doesn't work and 5.0 confilcts with Irrlicht wrapper..
I love this world :evil:
POiNT.OF.PRESENCE group
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

SofT MANiAC wrote:damnnnn.. 5.1 wrapper doesn't work and 5.0 confilcts with Irrlicht wrapper..
I love this world :evil:
have a look on my website :wink:
http://www.realsource.de/downloads/doc_ ... pb-include

greetings
Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
ker2x
User
User
Posts: 38
Joined: Sat May 10, 2008 7:52 am
Location: SecondLife

Post by ker2x »

Haaa YES !!

A LUA Wrapper, it's an awesome idea !!!
Thx :)
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

The LUA-Include was updated to work with PB 4.20 Beta 5 and 6

If you use this version, please download again.

greetings
Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

@ts-soft
thanks! all works (maybe)
Last edited by SofT MANiAC on Thu May 15, 2008 9:04 am, edited 1 time in total.
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

nevermind, in anyway it also conflicts with Irrlicht wrapper:

Code: Select all

IncludeFile ("lua.pbi")
XIncludeFile "IrrlichtWrapper_Include.pbi"

ProcedureC CheckFail(L)
PrintN("Fehler")
ProcedureReturn 0 ; Funktion gibt 0 argumente zurueck
EndProcedure

ProcedureC CheckTest(L)
lua_pushnumber(L, 1 )
ProcedureReturn 1 ; <==== Invalid memory access. Read error...
EndProcedure

Procedure load()
  script.s = "if CheckTest() == 0 then"
  script.s + "	CheckFail()"
  script.s + "else"
  script.s + "	print('OK')"
  script.s + "end"
  
  If OpenConsole()
    
    L = lua_open()
    luaopen_base(L)
    lua_register(L,"CheckTest", @CheckTest())
    lua_register(L,"CheckFail", @CheckFail())
    
    luaL_dostring(L, script)
    
    Input()
    CloseConsole()
    
  EndIf
EndProcedure

load()
POiNT.OF.PRESENCE group
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Post by hallodri »

I can not reproduce this error.
PB version and settings ?
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

PureBasic 4.10 + Irrlicht Wrapper by neotoma/Thalius...
POiNT.OF.PRESENCE group
LuaDev
User
User
Posts: 33
Joined: Tue Feb 16, 2010 2:41 pm

Re: Embedding LUA in PureBasic!?

Post by LuaDev »

Hi, sorry for bringing up such an old post ... but i have a request for ts-soft

I have been working with PB and lua for some time making internal tools for the company I work for, my boss has asked me to update the lua engine in our main database engine (custom engine written in PB and lua) from 5.1.2 to 5.1.4

I have added the 5.1.4 lib and dll to the engine and it works very well but I would like a static lib for the sake of portability, like the 5.1.2 lib at the RealSource website

is there any chance of getting the lib recompiled with the current stable version of lua (5.1.4), this would save me a huge headache as the task has fallen on my shoulders and I am no C++ dev, im strictly PB+lua

if you are to busy or just don't want to, then I understand, we all have busy lives, i will just carry on with the external dll, but if you could then I would be eternally grateful
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Embedding LUA in PureBasic!?

Post by DoubleDutch »

V5.1.4 would be useful.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
hallodri
Enthusiast
Enthusiast
Posts: 208
Joined: Tue Nov 08, 2005 7:59 am
Location: Germany
Contact:

Re: Embedding LUA in PureBasic!?

Post by hallodri »

http://luaforge.net/frs/download.php/37 ... w4_lib.zip

Extract to your lib directory and change the import to "liblua5.1.a".
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Embedding LUA in PureBasic!?

Post by DoubleDutch »

thanks. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
LuaDev
User
User
Posts: 33
Joined: Tue Feb 16, 2010 2:41 pm

Re: Embedding LUA in PureBasic!?

Post by LuaDev »

many thanks, i had given up on the idea and resided myself to using the dll, you just made my day, thanks again :D
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: Embedding LUA in PureBasic!?

Post by DoubleDutch »

Here is the latest include file built and tested for the new PureBasic 5.50b3

https://dl.dropboxusercontent.com/u/171 ... lua514.zip

I have no Lua 5.1.4 osx lib though that will work - can anyone help?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply