Questions tagged [computercraft]

ComputerCraft is a Minecraft mod which adds Lua-based scripting.

ComputerCraft (often also called CC) is a modification for the game . It adds new blocks (known as Turtles and Computers) and Items (known as Pocket Computers) to the game. They can be programmed using -based scripting.

141 questions
0
votes
2 answers

Lua: shell.run('asdf','arg1','arg2') Arguments? Tagging?

What do the arguments do? How do I code a tag for shell.run('asdf') somewhere and link it to the shell.run('asdf') line? The Code: turtle.dig() turtle.forward() -what api works with shell.run() here?- <---------- Where I want tag. …
0
votes
2 answers

Open Peripherals getAllStacks() issue

This is an example of my code inv = peripheral.wrap("right") var1 = inv.getAllStacks() var2 = var1[1] --This should set var2 to another table print(var2[1]) When I execute this program on an advanced computer with a diamond chest next to it, with…
Domi
  • 51
  • 2
  • 5
0
votes
1 answer

Lua - Saving data to array in for loop

in my lua program, I want to check the sides for a redstone input (using a for loop to check). the last few lines are ment to print out ther result of the array, as a debug tool. the output is the side name followed by 0 (a true/false is expected).…
0
votes
1 answer

ComputerCraft: custom printer software

I'm trying to make a custom printing program for ComputerCraft, that can make more copies by one command and I have a problem. Every time a put a file into it, it doesn't break lines and puts ? where the line break is (\n). How do I do it…
Jake S.
  • 568
  • 6
  • 25
0
votes
2 answers

How to call a table using a command line argument in lua

I am trying to make a program that can run a program with certain conditions. Basically, I am using ComputerCraft with Minecraft and a turtle to retrieve items then go back to where it started. I stored all the coordinates inside tables individually…
dyl421421
  • 11
  • 3
0
votes
3 answers

Lua/Computercraft listen but also function?

I am trying to make a computer system/network on Tekkit using computercraft. Computecraft is a Lua based modification which runs within Minecraft/Tekkit and other modification packages. Basically, I am currently using a wireless router to perform…
user2146021
  • 47
  • 3
  • 9
0
votes
1 answer

Computercraft program in lua

So here's the thing, i'm trying to make a fully customizable UI in computercraft, using lua arrays, and when I use this, ui seems to always be empty function dupChar(char, num) ret = '' for ii=1,num do ret = ret..char end return…
LazyShpee
  • 82
  • 12
-1
votes
1 answer

How do i set variable after repeat until loop?

i've got a query about my code. I currently cant test it so i thought i'd ask. (for context i'm very new to lua) Hopefully i'm not asking a duplicate question, or anything similar. here's my code currently write("Column: ") local column = tonumber(…
xXMAZEEXx
  • 13
  • 5
-1
votes
1 answer

"bios.lua:26: [string "turbinecontrol"]:15: 'then' expected" I have no idea why this is happening

Trying to control my extremereactor turbines with a computer so i dont have to keep managing them, im quite new to lua in general so i would really like some help with this and maybe some extra advice on other things that could go wrong/im doing…
Pixel
  • 5
  • 2
-1
votes
1 answer

I got a bios 367 error on Computercraft

On my program for Computer craft that will be used in a control tower in my airport map, I got a message that looked like this: bios:367:[string "AirportCommand"]:15: syntax error Here is all my code please tell me if you see any errors: local…
-1
votes
2 answers

Lua code runs properly on my advanced computer but doesn't run on the monitor

I run a successful Minecraft Tekkit modded server with computer craft on it. I'm fairly new to lua and only know the basics, I'm trying to make a menu with pages to display the banned items list and rules list on. I've made a program with arrows…
Ibrahim
  • 11
  • 3
-1
votes
1 answer

ComputerCraft/BigReactors Energy Security System

I'm making a ComputerCraft program for the Big Reactors mod to make sure that I never run out of power. When I execute my program, I get an error: startup:7: attempt to compare __lt on nil and number. Here is my code: reactor =…
-1
votes
1 answer

ComputerCraft cant access data in tables

I want to try and compare the two variables capacity and amount but I have no clue as to how to access the data. I will include screenshots from in-game. Here is the code: t=peripheral.wrap("left") local infoTable =…
-1
votes
2 answers

Computercraft lua change value later

ok, Im almost completely new to lua and computercraft but I have alot of creativity. I'm trying to write code that will reprint a variable every second. here is what I have so far: display = "Loading..." While true do sleep(1) term.clear() …
ryze halberd
  • 137
  • 7
-1
votes
2 answers

Multi-threading functions in Computer Craft

I'm working on a project where I want to update the clock on screen say every 5 seconds unless the user inputs something. This is the code I have so far, function thread1() term.clear() term.setCursorPos(1,1) write (" SteveCell ") …
emufossum13
  • 377
  • 1
  • 10
  • 21
1 2 3
9
10