Questions tagged [opencomputers]

OpenComputers is a Minecraft mod that adds computers and robots into the game that can be programmed in Lua 5.2.

Resources:

17 questions
4
votes
2 answers

Simple trilateration algorithm in simulated 3D space

Context: I am working on implementing a navigation system for the mobile computers added by OpenComputers, a Minecraft mod. For those not familiar with the mod, it basically adds a variety of Lua-programmable, upgradable computers, including mobile…
DeFazer
  • 521
  • 3
  • 17
3
votes
2 answers

Lua: run code while waiting for input

I'm currently working on a lua program. I want to use it in Minecraft with a mod called "OpenComputers" which allows the use of lua scripts on emulated systems. The programm I'm working on is relatively simple: you have a console and you enter a…
BDevGW
  • 347
  • 3
  • 15
2
votes
1 answer

Is there to way to run code from a variable in Lua

So, I've got this very interesting position where I have an entire set of code loaded into a variable, and I desperately want to run this code as it defines critical variables and functions for later in the code. Is there a way for me to do so? I…
Missingno50
  • 83
  • 10
2
votes
2 answers

How to fix "attempt to index a nil value"

I am having an error with my code : it keeps telling me "attempt to index a nil value (global 'sides')" I'm trying to learn Lua through Minecraft (OpenComputers) and found myself stuck with a nil value problem. There could be things not actually…
t9dupuy
  • 330
  • 1
  • 2
  • 9
2
votes
0 answers

Code executed using load()() cannot access functions from its caller

So I am writing and testing my new OS kernel and just finished the part where it loads up /bin/init.lua, I tested it, it loads up init.lua, andddd it exit mid-execution. I have a function in init.lua where it prints out test message, but it need to…
1
vote
1 answer

My code gives an "attempt to call a nil value" on the computer controlled seed analyzer in Minecraft

So I have spent a few hours looking for documentation on the item "Computer Controlled Seed Analyzer" with no current information that is useful. My goal is to set up a seed analyzer that will check for a plant next to the analyzer and analyze…
diamondev
  • 11
  • 2
1
vote
1 answer

Lua script wont accept args

I was trying to get an hologram projector working, but in run into these errors: bad arguments #3 (number expected, got no value) My script is: local component = require("component") local hologram = component.hologram function setVoxel(x, y, z,…
F. Linnenberg
  • 42
  • 1
  • 4
0
votes
0 answers

Is there a way to set a timeout for waiting for an event in Lua? (Opencomputer's lua)

I was creating a script which would send something and wait for it to be received back, but it just hang. Here's my script: local component = require("component") local event = require("event") local m = component.modem -- get primary modem…
0
votes
0 answers

server only pulls using linked card

I have a server that forwards messages from a Linked card to another server with a Network card. This works fine, server 1 (with the linked card) pulls a message from pc, and sends it to server 2(using a network card). the following part doesn't…
0
votes
0 answers

Program with linked card in OpenComputers (minecraft)

I am trying to make a system where a server and a computer talk to each other from a great distance. This is not possible with wires as they need to pass trough unloaded chunks. A linked card has unlimited reach, but isn't programmed the same way as…
0
votes
1 answer

Lua program throwing error with stdin after completion

I've written a lua program for OpenComputers in Minecraft which downloads a github repo to the computer, file structure and all. The code: internet = require("internet") io = require("io") filesystem = require("filesystem") handle =…
Vedvart1
  • 302
  • 4
  • 21
0
votes
0 answers

Lua: expected near 'local'

I've put the following code in a file for OpenComputers: local mathLib = require("math") local event = require("event") local data = require("data") local modem = require("modem") local osLib = require("os") local ioLib = require("io") local writer…
daysant
  • 1
  • 2
0
votes
1 answer

how to execute a string as a line of code in lua

I made myself a drone os in the minecraft mod Opencomputers, but I want to be able to make it run any line of code once recieved from the network card. I've tried everything I found here but none of it works, or atleast I haven't done it the right…
0
votes
0 answers

LUA OpenComputers Computronics Minecraft Speech Box Queue

I had a problem with coding in OpenOS system of the OpenComputers mod for Speech Box of the Computronics mod. I can’t say phrases in a certain order. It seems to me that all the phrases that I launch during the work of the speech box are ignored. I…
Cranwell
  • 37
  • 7
0
votes
1 answer

LuaRock Visual Studio Command Prompt Error

I try to run luarocks install luafilesystem command in Visual Studio Command Prompt. But it says "Error: Failed finding Lua library. You may need to configure LUA_LIBDIR". Why am i getting that error?(This time i got it Piglet :))
user10911520
1
2