Questions tagged [lua-5.1]

The v5.1 of the Lua scripting language.

Lua is a powerful, fast, lightweight, embeddable scripting language.

Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

Lua is an extension programming language designed to support general procedural programming with data description facilities. It also offers good support for object-oriented programming, functional programming, and data-driven programming. Lua is intended to be used as a powerful, light-weight scripting language for any program that needs one. Lua is implemented as a library, written in clean C (that is, in the common subset of ANSI C and C++).

Being an extension language, Lua has no notion of a "main" program: it only works embedded in a host client, called the embedding program or simply the host. This host program can invoke functions to execute a piece of Lua code, can write and read Lua variables, and can register C functions to be called by Lua code. Through the use of C functions, Lua can be augmented to cope with a wide range of different domains, thus creating customized programming languages sharing a syntactical framework. The Lua distribution includes a sample host program called lua, which uses the Lua library to offer a complete, stand-alone Lua interpreter.

Lua is free software, and is provided as usual with no guarantees, as stated in its license. The implementation described in this manual is available at Lua's official web site.

70 questions
0
votes
1 answer

lua 5.1 translate utf8 russian characters to unicode?

Hello I am wondering if it is possible to translate Привет into \u041f\u0440\u0438\u0432\u0435\u0442 in lua 5.1. There is no utf8 library, nor no unicode library inside this game. I've looked for a library on github that does this for me, but I…
noobyy
  • 123
  • 9
0
votes
1 answer

Why ChunkSpy .function part has four parameters?

When using ChunkSpy, I find one thing makes me coufused. Let's see the following example >a = 1 ; source chunk: (interactive mode) ; x86 standard (32-bit, little endian, doubles) ; function [0] definition (level 1) ; 0 upvalues, 0 params, 2…
tyChen
  • 1,404
  • 8
  • 27
0
votes
2 answers

How to create table entries with unique id and access them using that id..?

Hi I need to create a table in lua with each entry(record) can be represented by unique id table[p1d2].seq={0,1,2,3} table[p1d2].days={'sun','mon','wed'} table[p2d2].seq={0,1,2,3,4}…
Abhi
  • 73
  • 8
0
votes
1 answer

How do you "sandbox" functions?

Currently, I am writing a sandbox in Lua. It's working so far, but I could use getfenv for that function to get the scope outside the sandbox. For my sandbox, I filled an empty table with trusted functions and libraries. However, with functions such…
seniwo
  • 21
  • 5
0
votes
0 answers

Load non-standard lua library in sandbox (Lua 5.1/Luajit)

I'm trying to familiarize myself with lua and I'm playing around with the coding game berrybots (http://berrybots.com/) for that end. It uses a C++ engine and the users/players can provide lua scripts to program their own "bot AI" to battle against…
oli
  • 659
  • 1
  • 6
  • 18
0
votes
1 answer

How to separate emojies in string without spaces in LUA 5.1

I want to use split function of LUA 5.1 to split string of emoji characters without spaces and add space between ones, but I can't do it rightly. So I do it by this way, but it's wrong: #!/usr/bin/env lua local text = "‍‍‍‍‍⌚↔" for emoji in…
Dzmitry
  • 87
  • 1
  • 1
  • 7
0
votes
0 answers

Include Lua project in Python

I have two projects on hand, (A) written in Lua-5.1, (B) written in python3.6. Currently I am using Websocket for data exchange bewteen A and B program. However, I cannot ensure the performance of using websocket since there are some network latency…
appletabo
  • 239
  • 2
  • 12
0
votes
1 answer

Module 'socket" not found

Error when run I created a program in ZeroBrane, and I compiled it using srlua. However, since it has some usage of socket get requests, it seems like it is looking for files such as socket.dll to be in the same folder I am aware that there are…
-1
votes
1 answer

LUA 5.1 how do i get the calling variable from a function?

function newpos(xScale, xOffset, yScale, yOFfset) print(f.Position) end local f = {} f.Position = 1 f.Size = newpos(1, 0, 1, 0) f.Filled = true f.Visible = true how do i get the f table from newpos?
vozoid
  • 1
-1
votes
1 answer

FiveM 'then' expected near '='

Hello when i start the server and want to start doing illegal jobs this shows up brx-drugs/client/client.lua:50: 'then' expected near '=' and here is also a piece of the code Citizen.CreateThread(function() while true do …
bro xoty
  • 1
  • 2
1 2 3 4
5