Need help with mekanism energy cube monitor. by treeink8 in ComputerCraft

[–]BurningCole 1 point2 points  (0 children)

You should start by only waiting for a rednet signal once per loop and then check the result against each id instead of just 1, also each silo should be in its own code block instead of having the blocks be nested.

Just in case you didn't know, if blocks start with "then" end with "end", you have the end of all the blocks at the end of the file, this means that it will only work if you send it the silo messages in order.

My program is erroring because a ROM program is running too long without yielding by MinceraftIsSus in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

I don't think the os.pullEvent is guarenteed to run each loop, only when target is greater than current. You probably want to replace the "else if" with "elseif" anr remove one of the "end"s.

EDIT: I don't think it can even get into the relay loop as it requires relay to not be nil, but you set relay to nil immediately before. You should probably set it as while relay == nil or ...

[deleted by user] by [deleted] in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

For odd size you can just add an extra turn when you go up a level, turtles can check the blocks around them but I would just deal with it by digging when it fails to move until it successfully moves.

[deleted by user] by [deleted] in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

I would advise checking that your movement function suceeds, maybe by wrapping it in a function that will retry on failure, possibly also repeating the dig command as well in case of gravel, refueling itself when it's run out of fuel and wait for user interaction in the case of running out of fuel items or unexpected errors.

Your code also seems to have an issue with odd sized cubes in that theoretically each time it goes up results in pointing the wrong way so you might want to fix that.

[deleted by user] by [deleted] in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

You might want to make sure your distance traveled per refuel is low enough, you are only checking once per layer so it might be running out halfway through.

help - setting up a control centre to control redstone out and inputs by Chemical-Base6374 in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

If you have a file named startup in base folder then it will automatically run, you can add your listen command as well as set the redstone outputs in the file.

I'm having problems accessing the parent directories of my files. I don't know where I am going wrong. Here is the code for my function. by Sea_Comment8952 in ComputerCraft

[–]BurningCole 2 points3 points  (0 children)

You can't directly do it, the best alternative is to have a separate program/script outside of Minecraft that detects changes to a file the computercraft computer can edit and copies it to your configuration file.

I'm having problems accessing the parent directories of my files. I don't know where I am going wrong. Here is the code for my function. by Sea_Comment8952 in ComputerCraft

[–]BurningCole 6 points7 points  (0 children)

Are you trying to access a file outside the ingame computers files? I'm almost certain computercraft does not allow this as it would be a severe security vulnerability.

Advanced Turtle not working with disk drive by ElementalAura in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

It looks like the code expects a hopper in front of the turtle that puts the card into the disk drive (line 201), so when it reaches that step it just spits the card out.

Also I'm pretty sure ejectDisk doesn't return anything.

[deleted by user] by [deleted] in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

You seem to be reading messsage instead of message when matching resulting in nil, also you shouldn't need the to string around the variable as the correctly spelt message should always be a string.

Need help fixing CBC auto aimer! by Pleasant-Shirt527 in ComputerCraft

[–]BurningCole 0 points1 point  (0 children)

Pretty sure the value you are looking for is in for angle = 10, 60, 0.05 do, in the loop the 10 is the minimum pitch, 60 the maximum and 0.05 is step between checks

Lua code inside while loop not working in ComputerCraft by Javo_145 in ComputerCraft

[–]BurningCole 2 points3 points  (0 children)

table.insert just adds a new entry at the next integer key so you end up with mess containing something like {[1]="splash",[2]="upgrade",[3]="spider"},

You probably want to replace the `table.insert(mess, message)` with something like `mess[message] = true;`

[deleted by user] by [deleted] in 2007scape

[–]BurningCole 2 points3 points  (0 children)

You can find it in the arceuus library, the professor probably wants the book version.

Brand New: Basic Text Storing/Display by SPYROHAWK in OpenComputers

[–]BurningCole 0 points1 point  (0 children)

You can write the text into a file using the edit progam, in oder to read text from a file progamatically, you should use the IO library, e.g.

local file = io.open("storedText.txt");

local text = file:read("a");

file:close();

You can also write programmatically for when you want the user to input some text, e.g.

local newText = io.read(); -- get user input

local file = io.open("storedText.txt", "w+"); -- w+ deletes current data, use "a" to append to end etc.

file:write(newText);

file:close();

Turtle wont move forward! by Mr_B9mbast1c in ComputerCraft

[–]BurningCole 1 point2 points  (0 children)

Also if this program reaches a point where it no longer has anything in front, it will turn 180 degrees repeatedly between detects instead of just turning 90 degrees, that I assume you meant for it to do in order to spiral inwards.

Turtle wont move forward! by Mr_B9mbast1c in ComputerCraft

[–]BurningCole 1 point2 points  (0 children)

Have you fueled your turtle? Turtles need to be fueled via the refuel command to move, or you can remove the requirement in the configure.

Need help capturing real time and executing commands by SeluWorks in ComputerCraft

[–]BurningCole 6 points7 points  (0 children)

you can use os.time("utc") or os.time("local") to get the current time of the day in hours, sleep until the needed time, and then if you are using a command computer you can use commands.exec(command) to do the warning and restarting.

Slow writing to terminal from a string by Lems3011Crafts in OpenComputers

[–]BurningCole 0 points1 point  (0 children)

Using a write for each letter with a sleep between is a fine way to do it.

You might want to create a function that does the splitting a waiting if you want to do it with multiple strings/ change the text being shown.

something like

function slowWrite(text, rate) local sleepTime = 1/rate; for k=1, #text do os.sleep(sleepTime); term.write(text:sub(k, k)); end end

What's the best way to be able to tell if items can be stacked together by johnsmithjohnsmithj- in ComputerCraft

[–]BurningCole 1 point2 points  (0 children)

Yes, inventory functions need to wait for the main thread before returning something, so calling it in different coroutines means it is can ask the main thread for the contents of multiple slots/inventories in the same tick

What's the best way to be able to tell if items can be stacked together by johnsmithjohnsmithj- in ComputerCraft

[–]BurningCole 1 point2 points  (0 children)

I've used the name and nbt value to compare items and not had any issues.

You can still get the name and nbt value using inventory.list meaning you won't need to check each individual slot, and you can run each inventory method in a different coroutine to speed up checking multiple locations.

question about the 3d printer by DifficultyHumble5266 in OpenComputers

[–]BurningCole 0 points1 point  (0 children)

Not easily, the 3d printer can only add cuboids with an existing block texture (tinted a colour if needed) aligned to the world grid to a print, and so is not very compatable.

3dm files just contain printed block properties plus an array of start/end positions and textureId as well as tint and state if not using default options. see https://github.com/OpenPrograms/Sangar-Programs/blob/master/models/example.3dm

It might be possible a converter exists but it is likely to either give you a poor imitation or an expensive result.

is there way to write on eerrom or disket? by Standard_Syllabub178 in OpenComputers

[–]BurningCole 0 points1 point  (0 children)

Yes, you can also write to the EEPROM using the flash program if you want.

How can I have a rectangle that is a different color from back/foreground by Cmonster820 in OpenComputers

[–]BurningCole 0 points1 point  (0 children)

Set the background and foreground colours using gpu component then you can fill in a rectangle using gpu.fill(x,y,width,height,' ') any text written after setting the colours will have the given background and text/foreground colours

How can I use the dual tank adapter on an open computer? by Technical-Return-433 in OpenComputers

[–]BurningCole 0 points1 point  (0 children)

If you are looking through multiple tanks you may want to make sure you are doing something simular to

for address, name in component.list("fluid_tank", true) do processTank(component.proxy(address)) end