Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Lua
➜ Download for standalone version of Lua
Download for standalone version of Lua
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Wed 24 Nov 2004 06:20 PM (UTC) Amended on Wed 24 Nov 2004 07:09 PM (UTC) by Nick Gammon
|
Message
| In case you want to play with Lua 'stand-alone' - that is, from a command-line, you can download the precompiled binary from http://www.gammon.com.au/files/mushclient/lua.zip (181 Kb). This archive contains the following files:
122,880 lua.dll
53,248 lua.exe
16,492 lua.lib
57,344 luac.exe
143,360 lualib.dll
9,562 lualib.lib
1,877 Readme.txt
The two DLLs implement the Lua 'core' and libraries (they are the same files that ship with MUSHclient). The program 'lua.exe' is stand-alone Lua, and the program 'luac.exe' is the Lua compiler which can be used to make Lua 'binary files'. Just unzip them into a single directory which you can use for testing Lua. The .lib files are needed if you want to write your own DLLs - the export the functions needed for use in Visual C++.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Poromenos
Greece (1,037 posts) Bio
|
Date
| Reply #1 on Wed 24 Nov 2004 06:23 PM (UTC) |
Message
| You can make native applications with it, or some kind of bytecode or something? |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #2 on Wed 24 Nov 2004 07:09 PM (UTC) |
Message
| See other recent post - bytecode. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Eldeon
(9 posts) Bio
|
Date
| Reply #4 on Tue 22 Jun 2010 06:57 PM (UTC) |
Message
| I can't run a .lua from the exe. Is there something i'm doing wrong? I'm trying to learn the language and I started with the
Print("Hello World")
in a .lua file. But I don't know how to run it from the lua interpreter. Or can't you?
| Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #5 on Tue 22 Jun 2010 07:17 PM (UTC) |
Message
| Just use "lua <filename>". If the file is named test.lua, use "lua test.lua".
Also, it's print, not Print. Lua is case-sensitive. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Eldeon
(9 posts) Bio
|
Date
| Reply #6 on Tue 22 Jun 2010 07:46 PM (UTC) Amended on Tue 22 Jun 2010 10:33 PM (UTC) by Eldeon
|
Message
| Thats what I do. and it says
stdin:1 `=' expected near `hello'
I have no clue what this means.
oh and I do have it as print not Print I just mistyped. | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #7 on Tue 22 Jun 2010 07:54 PM (UTC) |
Message
| You must've mistyped elsewhere too, because what you posted is syntactically correct. Please copy and paste -exactly- what you have in the file. You can put it in [code] [/code] tags to format it nicely. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Eldeon
(9 posts) Bio
|
Date
| Reply #8 on Tue 22 Jun 2010 10:34 PM (UTC) Amended on Tue 22 Jun 2010 10:52 PM (UTC) by Eldeon
|
Message
| print("Hello World")
That's all that's in the file. Or do I need more?
and i'm putting in exactly
lua hello.lua
and I get the error message. | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #9 on Tue 22 Jun 2010 10:36 PM (UTC) Amended on Tue 22 Jun 2010 10:41 PM (UTC) by Twisol
|
Message
| I notice that you're using "Hello", whereas the error shows "hello". I think maybe you're editing one file and running a different one by mistake, because there's no way you can get that error from this script.
EDIT: Oh, heh. I think I realized what's going on. Don't type "lua hello.lua" from inside the interpreter! Run it from the shell (command prompt in Windows).
This is what I think you're doing (and which you shouldn't do):
$ lua
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
> lua hello.lua
stdin:1: '=' expected near 'hello'
>
This is what you should be doing:
$ lua hello.lua
Hello World
$
EDIT 2: To execute it from within the interpreter, you can use dofile("hello.lua"). I think this was my fault, for misinterpreting what you asked for.
$ lua
Lua 5.1.2 Copyright (C) 1994-2007 Lua.org, PUC-Rio
> dofile("hello.lua")
Hello World
>
|
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Eldeon
(9 posts) Bio
|
Date
| Reply #10 on Tue 22 Jun 2010 10:53 PM (UTC) |
Message
| WOW thanks for clearing that up. I hadn't realized that. thanks.
| Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #11 on Tue 22 Jun 2010 10:54 PM (UTC) |
Message
| You're welcome. Sorry that took so long for such a simple question! |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
35,292 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top