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
0 answers

Lua Error: '' expected

There is an error that I can not get away from. When I run the script, the following error occurs every time: bios:14: [string "Digger"]:35: '' expected write("X:") x = read() write("Y:") y = read() write("Z:") z = read() for zi=0, z, 1 do …
Timer
  • 13
  • 1
  • 7
0
votes
1 answer

Basic LUA problems

I'm using ComputerCraft, a Minecraft mod that adds computers, monitors, modems and so on, which can be programmed using Lua scripts. http://www.computercraft.info/wiki/Main_Page While running my script I get this error: "bios:171: bad argument:…
Ynk
  • 27
  • 6
0
votes
1 answer

lua atempt to index ? a nil ? - computercraft

I'm playing project ozone 2 and I have a pain with automating the reactor but this is the only bit I cant solve can anyone tell me why this part is having an error when the rest aren't problem its at the bottom of the list term.setCursorPos(11,…
0
votes
2 answers

Using lua to program a turtle in Computercraft minecraft to farm using coordinates

I have a square 7x7 square field. I am trying to have as less movement as possible to reduce fuel consumption. Like a graph, I am trying to assign coordinates to certain points. I could use the blue thing in the middle (water) as the origin, but…
m_cht
  • 399
  • 1
  • 3
  • 11
0
votes
0 answers

Make rednet.receive() passive on Computercraft

Computer 0 is a central computer that is meant to receive info from terminals elsewhere, interpret the info, and send it to a monitor. I will have the outside terminals sending info at different rates. Some several times per second, others maybe one…
MiuKujo
  • 233
  • 1
  • 2
  • 8
0
votes
1 answer

Debug function simply won't print to console

I made a debug function that only outputs if the program is running in debug mode, but for some reason it simply won't work. function debug{...} if bDebug then --bDebug is whether the program is in debug mode. It's set to true. for i,v in…
0
votes
1 answer

I keep getting a expected then error when I have the the in the string

I keep getting the then expected error on line 61 and I cant find the problem any ideas? I tried working it out and rearranging it im using computer craft periherals mag card reader and trying to mag a card door os.loadAPI("SHA") os.pullEvent =…
0
votes
1 answer

Computercraft Lua code not working as expected

I am quite new to Lua but I feel I have a decent grasp on the basics. Recently in computercraft, I tried to design my own monitor to display whether or not my reactors were on or not. This is what I came up with: function screen() monitor =…
JG39
  • 1
  • 1
0
votes
1 answer

CC 1.75 MC 1.7.10: Creating a program which has an exception "program run something"

So I have not tried anything yet, but I know those code scripts wont work.. So my though was creating a program wich had some functions ex. rm, delete, mkdir and edit. So all of these programs have something in common, they all have an "exception",…
user6179028
0
votes
0 answers

Variable scope or race condition in Minecraft Lua Computercraft Turtle Script

I created the following Script for a Mining Turtle: --Strip mining turtle program test --Based on stripmining program by Gabriel *******(Spirr0u) function excarvateRectangle(size,looptimes) print("Excavating "..size .. " with looptimes…
0
votes
2 answers

Computercraft POST request "could not connect"

I'm trying to implement OAuth 2.0 into computercraft, and to do so, I have to make the following request: http.post("https://accounts.google.com/o/oauth2/device/code", "client_id={my id here}&scope=email") and I'm just getting a Could not connect…
Potassium Ion
  • 2,075
  • 1
  • 22
  • 39
0
votes
1 answer

Manually typing commands into console works but not in the program

I'm having a problem where I can do every single function in a command line version of lua however, when I run the program it won't throw any errors it just ends.I'm not sure how to diagnose this but I have tried getting an error to be thrown a…
0
votes
1 answer

Lua indexing nil value when posting data to Particle (formerly Spark) Photon

My cousin and I have been experimenting with his new Photon chip, and we decided to be creative and use ComputerCraft (the Minecraft mod) and some Lua code to drive the car he made. Unfortunately, every time we give an input, it indexes a nil value;…
0
votes
2 answers

lua if else while statements limits?

im trying to make a program for a lua based computer in a game. Although when its run it acts weird --Tablet oldpullEvent = os.pullEvent os.pullEvent = os.pullEventRaw while true do term.clear() term.setTextColor(…
tecksup
  • 51
  • 1
  • 13
0
votes
2 answers

How to make io.read() return a string?

I am trying to learn how to program Computercraft Mining Turtles and I want to write a program that prompts the user for the side length dimensions for a cube which is then built. I use io.read() to get the user to input the side lengths and if he…
Tobias Mielke
  • 67
  • 2
  • 7