- ComputerCraft | Programmable Computers for Minecraft
- → Ditto8353's Content
Ditto8353's Content
There have been 136 items by Ditto8353 (Search limited from 10-February 22)
#44710 [LUA][ERROR]
Posted by
Ditto8353
on 26 October 2012 - 08:22 PM
in
Ask a Pro
It's just usually best to avoid 'break' when you can. It helps with debugging and just makes code easier to read.
Imagine chasing someone through a building. It's harder to find them if the room has two exits instead of one.
#44708 [LUA][ERROR]
Posted by
Ditto8353
on 26 October 2012 - 08:16 PM
in
Ask a Pro
change
command = io.read()
to
local command = io.read()
That could possibly be effecting it. However, only do this if you do not need to use that input outside of the loop.
local variables declared inside of loops are destroyed at the end of the loop.
#44704 [LUA][ERROR]
Posted by
Ditto8353
on 26 October 2012 - 08:03 PM
in
Ask a Pro
However, I would like to offer an alternative approach.
repeat
clearscreen()
print("TreeFarm Control Program")
print("Please enter engage/disengage command:")
term.setCursorPos(1,4)
command = io.read()
if command == Controlon then
write("Turning Treefarm on")
rednet.send(15, "engage")
sleep(10)
clearscreen()
elseif
command == Controloff then
write("Turning Treefarm off")
clearscreen()
print("Turning Treefarm off")
rednet.send(TreefarmPC, "disengage")
sleep(2)
end
until command == Controlon
#44688 A Few Words
Posted by
Ditto8353
on 26 October 2012 - 07:27 PM
in
Ask a Pro
It comes down to being ignorant (the Users looking for help) or irresponsible (posting misinformation in a place where solutions are assumed to come from experienced programmers).
The ignorant should not be stomped, and I have never actually seen that happen here.
The irresponsible should.
#44681 The Dwarfy Dwarf Challenge: Make Dwarf Fortress!
Posted by
Ditto8353
on 26 October 2012 - 07:19 PM
in
General
Then I may consider shaving off the corners.
I don't actually have any intentions of creating this though. I lack the motivation and free time. I just enjoy throwing out ideas.
#44676 A Few Words
Posted by
Ditto8353
on 26 October 2012 - 07:12 PM
in
Ask a Pro
ChunLing, on 26 October 2012 - 07:09 PM, said:
It sucks if you have a fragile pride, but you have to learn to deal with it eventually.
#44663 The Dwarfy Dwarf Challenge: Make Dwarf Fortress!
Posted by
Ditto8353
on 26 October 2012 - 06:57 PM
in
General
billysback, on 26 October 2012 - 06:55 PM, said:
#44617 how do you a turtle to take items from a chest
Posted by
Ditto8353
on 26 October 2012 - 05:59 PM
in
Ask a Pro
In addition, if you type in simply
print("Hello")
Do you get any output?
If not, then I would lean towards checking your versions and doing a re-installation of the mod(s), but I do not have a full understanding of what could cause this.
#44607 how do you a turtle to take items from a chest
#44599 [Question][Solved] Working with Red power bundled cable and Item Detectors. A...
Posted by
Ditto8353
on 26 October 2012 - 04:50 PM
in
Ask a Pro
You could store the previous state of each wire in your Items table.
initialize all to 0
On redstone event newWireStates = wire states as measured
If newWireState > oldWireState then count it
oldWireStates = newWireStates
#44595 [Question][Solved] Working with Red power bundled cable and Item Detectors. A...
Posted by
Ditto8353
on 26 October 2012 - 04:44 PM
in
Ask a Pro
A Dirt block is counted, causing white to go high.
The program counts the dirt.
Directly afterwards a Coal is counted, causing black to high.
The program goes to count the coal BEFORE white goes low again.
The program double-counts the previous Dirt block.
White goes low, raising a redstone event BEFORE black goes low.
The program double-counts the previous Coal.
#44591 [Lua][Error]Odd error when I try to run program.
Posted by
Ditto8353
on 26 October 2012 - 04:37 PM
in
Ask a Pro
Beardmoresam, on 26 October 2012 - 04:34 PM, said:
- ComputerCraft | Programmable Computers for Minecraft
- → Ditto8353's Content


