This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
schrolock's profile picture

Turtle Factory Program

Started by schrolock, 31 March 2012 - 09:35 AM
schrolock #1
Posted 31 March 2012 - 11:35 AM
hey i made an program for my turtle factory and i have coded for hours. it isn´t nearly completed yet but it have some bugs. i get an error if i start it and don´t know what is wrong.





print("WÄHLE AUS")
print("Rohstoffproduktion [1]")
print("Transport [2]")
print("Aktionen Stoppen [3]")
write("AUSWAHL: ")
a = read()
if a == ("1") then
print("Cobblestone [1]  Sand(benötigt cobble) [2]")
print("Cleanstone [3]  Panes [4]")
print("ALLES (WARNUNG!NUR BEI AUSREICHEND COBBLE) [5]")
print("zurück [6]")
write("AUSWAHL: ")
b = read()
if b == ("1") then
print("Cobblestone wird Produziert")
c = colors.combine( colors.green )
rs.setBundledOutput( "back", c )
sleep(2)
shell.run("disk/startup")
end
if b == ("2") then
c = colors.combine( colors.brown )
rs.setBundledOutput( "back", c )
print("starte macerator (dies dauert eine weile)")
sleep(3.75)
for i = 0, 100,1 do
sleep(3.75)
print(i .. "%")
end
print("100%!!!starte Sandproduktion")
c = colors.combine( cyan )
rs.setBundledOutput( "back", c )
end
if b == ("3") then
print("Heize öfen auf (dies dauert eine weile)")
c = colors.combine( yellow )
rs.setBundledOutput("back", c )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Stoneproduktion")
c = colors.combine( blue )
rs.setBundledOutput( "back", c )
sleep(3)
shell.run("disk/startup")
end
if b == ("4") then
print("Panes werden hergestellt")
c = colors.combine( colors.white )
rs.setBundledOutput( "back", c )
end
if b == ("5") then
print("WARNUNG ALLE SYSTEME WERDEN GESTARTET!")
write(" J/N ?")
c = read()
if c == ("J") then
for z=15,0,-1 do
rs.setOutput("top", true )
sleep(0.5)
rs.setOutput("top", false )
sleep(0.5)
end
print("Bereite Supergau vor (dies dauert eine weile)")
c = colors.combine ( colors.brown, colors.yellow )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Produktion")
c = colors.combine( colors.brown, colors.yellow, colors.green )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if c == ("N") then
print("Dann nicht")
sleep(2)
shell.run("disk/startup")
end
end
if b == ("6") then
print("gehe zurück")
shell.run("disk/startup")
end
end
if a == ("2") then
print("WÄHLE AUS")
print("Cobble->Verarbeiter[1]")
print("Sand->Ofen[2]")
print("Glass->Crafting[3]")
print("Redstone->Puffer[4]")
print("ALLES->Puffer(unsicher)[5]")
print("Puffer->Sortierer[6]")
print("Sortierer->Spender[7]")
print("Spender->Craften[8]")
Print("Crafting->Lager[9]")
write("AUSWAHL: ")
d = read()
if d == ("1") then
print("Transportiere Cobblestone zum Ofen")
c = colors.combine( colors.blue )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if d == ("2") then
print("Transportiere Sand zum Ofen")
c = colors.combine( colors.black )
rs.setBundledOutput("back", c )
shell.run("disk/startup")
end
end



hope for help

PS:it was created with Notepad++


[attachment=134:startup.txt]
xuma202 #2
Posted 31 March 2012 - 12:08 PM
Hello You could optimize the
print("53%")
sleep(5)
print("54%")
sleep(5)
print("55%")
sleep(5)
print("56%")
sleep(5)
print("57%")
sleep(5)

stuff

with a for-loop like so:


for i = 1, 100,1
sleep(5)
print(i"%")
end
schrolock #3
Posted 31 March 2012 - 12:10 PM
Hello You could optimize the
print("53%")
sleep(5)
print("54%")
sleep(5)
print("55%")
sleep(5)
print("56%")
sleep(5)
print("57%")
sleep(5)

with a for loop

loop?

sorry i am not so good. i don´t know what a loop is :o/>/>
gigagames #4
Posted 31 March 2012 - 12:25 PM
german :
hi, da ich sehe das dein skript deutsch is gehe ich davon aus das du deutscher bist ^^ loop = schleife
darunter hat er doch sogar geschrieben wie :

for i = 1, 100,1
sleep(5)
print(i"%")
end
anstadt dein print gedönse ^^
english : hi , im see you skript is german , so i thinkh you too this isen loop :

for i = 1, 100,1
sleep(5)
print(i"%")
end
schrolock #5
Posted 31 March 2012 - 12:46 PM
german :
hi, da ich sehe das dein skript deutsch is gehe ich davon aus das du deutscher bist ^^ loop = schleife
darunter hat er doch sogar geschrieben wie :

for i = 1, 100,1
sleep(5)
print(i"%")
end
anstadt dein print gedönse ^^
english : hi , im see you skript is german , so i thinkh you too this isen loop :

for i = 1, 100,1
sleep(5)
print(i"%")
end

ok danke.

PS: sorry ich kenn mich mit den codes nicht so gut aus deswegen konnte ich damit nichts anfangen

PSPS:aber ich bekomme trotzdem eine fehlermeldung von wegen 'eof'. was hat das zu bedeuten?

ok thank you.

PS: sorry I know my way with the codes are not as good so I could not do anything

PSPS: but I still get an error message because of 'eof'. what does this mean?

(powered by google translator)
schrolock #6
Posted 31 March 2012 - 01:10 PM
Hello You could optimize the
print("53%")
sleep(5)
print("54%")
sleep(5)
print("55%")
sleep(5)
print("56%")
sleep(5)
print("57%")
sleep(5)

stuff

with a for-loop like so:


for i = 1, 100,1
sleep(5)
print(i"%")
end

yes i know but i still have the 'eof' error! What does it mean?
xuma202 #7
Posted 31 March 2012 - 01:23 PM
German: Da war noch ein Fehler in meinem code sorry.

Du musst die Variable i mit dem Text "%" verbinden.


for i = 1, 100,1
  sleep(5)
  print(i .. "%")
end

English: There still was a bug in my code sry.
I forgot to connect the variable witch the string. See fixed code above.
schrolock #8
Posted 31 March 2012 - 01:41 PM
German: Da war noch ein Fehler in meinem code sorry.

Du musst die Variable i mit dem Text "%" verbinden.


for i = 1, 100,1
  sleep(5)
  print(i .. "%")
end

English: There still was a bug in my code sry.
I forgot to connect the variable witch the string. See fixed code above.

jetzt bekomme ich den fehler: bios:206: [string "startup"]:30: 'do' expected

now i get the error bios:206: [string "startup"]:30: 'do' expected
lukeplechaty #9
Posted 31 March 2012 - 02:00 PM
it help if you put end at the end of you file well 3 end if you look at it
schrolock #10
Posted 31 March 2012 - 02:07 PM
it help if you put end at the end of you file well 3 end if you look at it

sorry but i dont understand what you mean
xuma202 #11
Posted 31 March 2012 - 02:12 PM
tyr this

for
i = 1, 100,1 do
sleep(5)
print(i .. "%")
end
lukeplechaty #12
Posted 31 March 2012 - 02:17 PM
Spoiler
print("WÄHLE AUS")
print("Rohstoffproduktion [1]")
print("Transport [2]")
print("Aktionen Stoppen [3]")
write("AUSWAHL: ")
a = read()
if a == ("1") then
print("Cobblestone [1]  Sand(benötigt cobble) [2]")
print("Cleanstone [3]  Panes [4]")
print("ALLES (WARNUNG!NUR BEI AUSREICHEND COBBLE) [5]")
print("zurück [6]")
write("AUSWAHL: ")
b = read()
if b == ("1") then
print("Cobblestone wird Produziert")
c = colors.combine( colors.green )
rs.setBundledOutput( "back", c )
sleep(2)
shell.run("disk/startup")
end
if b == ("2") then
c = colors.combine( colors.brown )
rs.setBundledOutput( "back", c )
print("starte macerator (dies dauert eine weile)")
sleep(3.75)
for i = 0, 100,1 do
sleep(3.75)
print(i .. "%")
end
print("100%!!!starte Sandproduktion")
c = colors.combine( cyan )
rs.setBundledOutput( "back", c )
end
if b == ("3") then
print("Heize öfen auf (dies dauert eine weile)")
c = colors.combine( yellow )
rs.setBundledOutput("back", c )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Stoneproduktion")
c = colors.combine( blue )
rs.setBundledOutput( "back", c )
sleep(3)
shell.run("disk/startup")
end
if b == ("4") then
print("Panes werden hergestellt")
c = colors.combine( colors.white )
rs.setBundledOutput( "back", c )
end
if b == ("5") then
print("WARNUNG ALLE SYSTEME WERDEN GESTARTET!")
write(" J/N ?")
c = read()
if c == ("J") then
for z=15,0,-1 do
rs.setOutput("top", true )
sleep(0.5)
rs.setOutput("top", false )
sleep(0.5)
end
print("Bereite Supergau vor (dies dauert eine weile)")
c = colors.combine ( colors.brown, colors.yellow )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Produktion")
c = colors.combine( colors.brown, colors.yellow, colors.green )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if c == ("N") then
print("Dann nicht")
sleep(2)
shell.run("disk/startup")
end
end
if b == ("6") then
print("gehe zurück")
shell.run("disk/startup")
end
end
if a == ("2") then
print("WÄHLE AUS")
print("Cobble->Verarbeiter[1]")
print("Sand->Ofen[2]")
print("Glass->Crafting[3]")
print("Redstone->Puffer[4]")
print("ALLES->Puffer(unsicher)[5]")
print("Puffer->Sortierer[6]")
print("Sortierer->Spender[7]")
print("Spender->Craften[8]")
Print("Crafting->Lager[9]")
write("AUSWAHL: ")
d = read()
if d == ("1") then
print("Transportiere Cobblestone zum Ofen")
c = colors.combine( colors.blue )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if d == ("2") then
print("Transportiere Sand zum Ofen")
c = colors.combine( colors.black )
rs.setBundledOutput("back", c )
shell.run("disk/startup")
end
end
hear i fix it
and cleaned it up
schrolock #13
Posted 31 March 2012 - 02:18 PM
tyr this

for
i = 1, 100,1 do
sleep(5)
print(i .. "%")
end

then i get

string startup 35 'end' expected
schrolock #14
Posted 31 March 2012 - 02:55 PM
Spoiler
print("WÄHLE AUS")
print("Rohstoffproduktion [1]")
print("Transport [2]")
print("Aktionen Stoppen [3]")
write("AUSWAHL: ")
a = read()
if a == ("1") then
print("Cobblestone [1]  Sand(benötigt cobble) [2]")
print("Cleanstone [3]  Panes [4]")
print("ALLES (WARNUNG!NUR BEI AUSREICHEND COBBLE) [5]")
print("zurück [6]")
write("AUSWAHL: ")
b = read()
if b == ("1") then
print("Cobblestone wird Produziert")
c = colors.combine( colors.green )
rs.setBundledOutput( "back", c )
sleep(2)
shell.run("disk/startup")
end
if b == ("2") then
c = colors.combine( colors.brown )
rs.setBundledOutput( "back", c )
print("starte macerator (dies dauert eine weile)")
sleep(3.75)
for i = 0, 100,1 do
sleep(3.75)
print(i .. "%")
end
print("100%!!!starte Sandproduktion")
c = colors.combine( cyan )
rs.setBundledOutput( "back", c )
end
if b == ("3") then
print("Heize öfen auf (dies dauert eine weile)")
c = colors.combine( yellow )
rs.setBundledOutput("back", c )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Stoneproduktion")
c = colors.combine( blue )
rs.setBundledOutput( "back", c )
sleep(3)
shell.run("disk/startup")
end
if b == ("4") then
print("Panes werden hergestellt")
c = colors.combine( colors.white )
rs.setBundledOutput( "back", c )
end
if b == ("5") then
print("WARNUNG ALLE SYSTEME WERDEN GESTARTET!")
write(" J/N ?")
c = read()
if c == ("J") then
for z=15,0,-1 do
rs.setOutput("top", true )
sleep(0.5)
rs.setOutput("top", false )
sleep(0.5)
end
print("Bereite Supergau vor (dies dauert eine weile)")
c = colors.combine ( colors.brown, colors.yellow )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Produktion")
c = colors.combine( colors.brown, colors.yellow, colors.green )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if c == ("N") then
print("Dann nicht")
sleep(2)
shell.run("disk/startup")
end
end
if b == ("6") then
print("gehe zurück")
shell.run("disk/startup")
end
end
if a == ("2") then
print("WÄHLE AUS")
print("Cobble->Verarbeiter[1]")
print("Sand->Ofen[2]")
print("Glass->Crafting[3]")
print("Redstone->Puffer[4]")
print("ALLES->Puffer(unsicher)[5]")
print("Puffer->Sortierer[6]")
print("Sortierer->Spender[7]")
print("Spender->Craften[8]")
Print("Crafting->Lager[9]")
write("AUSWAHL: ")
d = read()
if d == ("1") then
print("Transportiere Cobblestone zum Ofen")
c = colors.combine( colors.blue )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if d == ("2") then
print("Transportiere Sand zum Ofen")
c = colors.combine( colors.black )
rs.setBundledOutput("back", c )
shell.run("disk/startup")
end
end
hear i fix it
and cleaned it up

the first workd but if i want to set the second i get the error startup:98: attempt to call nil
FuzzyPurp #15
Posted 31 March 2012 - 04:04 PM
Topic moved to the appropriate section.
lukeplechaty #16
Posted 31 March 2012 - 08:01 PM
Spoiler
print("WÄHLE AUS")
print("Rohstoffproduktion [1]")
print("Transport [2]")
print("Aktionen Stoppen [3]")
write("AUSWAHL: ")
a = read()
if a == ("1") then
print("Cobblestone [1]  Sand(benötigt cobble) [2]")
print("Cleanstone [3]  Panes [4]")
print("ALLES (WARNUNG!NUR BEI AUSREICHEND COBBLE) [5]")
print("zurück [6]")
write("AUSWAHL: ")
b = read()
if b == ("1") then
print("Cobblestone wird Produziert")
c = colors.combine( colors.green )
rs.setBundledOutput( "back", c )
sleep(2)
shell.run("disk/startup")
end
if b == ("2") then
c = colors.combine( colors.brown )
rs.setBundledOutput( "back", c )
print("starte macerator (dies dauert eine weile)")
sleep(3.75)
for i = 0, 100,1 do
sleep(3.75)
print(i .. "%")
end
print("100%!!!starte Sandproduktion")
c = colors.combine( cyan )
rs.setBundledOutput( "back", c )
end
if b == ("3") then
print("Heize öfen auf (dies dauert eine weile)")
c = colors.combine( yellow )
rs.setBundledOutput("back", c )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Stoneproduktion")
c = colors.combine( blue )
rs.setBundledOutput( "back", c )
sleep(3)
shell.run("disk/startup")
end
if b == ("4") then
print("Panes werden hergestellt")
c = colors.combine( colors.white )
rs.setBundledOutput( "back", c )
end
if b == ("5") then
print("WARNUNG ALLE SYSTEME WERDEN GESTARTET!")
write(" J/N ?")
c = read()
if c == ("J") then
for z=15,0,-1 do
rs.setOutput("top", true )
sleep(0.5)
rs.setOutput("top", false )
sleep(0.5)
end
print("Bereite Supergau vor (dies dauert eine weile)")
c = colors.combine ( colors.brown, colors.yellow )
sleep(5)
for i = 0, 100,1 do
sleep(5)
print(i .. "%")
end
print("100%!!!starte Produktion")
c = colors.combine( colors.brown, colors.yellow, colors.green )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if c == ("N") then
print("Dann nicht")
sleep(2)
shell.run("disk/startup")
end
end
if b == ("6") then
print("gehe zurück")
shell.run("disk/startup")
end
end
if a == ("2") then
print("WÄHLE AUS")
print("Cobble->Verarbeiter[1]")
print("Sand->Ofen[2]")
print("Glass->Crafting[3]")
print("Redstone->Puffer[4]")
print("ALLES->Puffer(unsicher)[5]")
print("Puffer->Sortierer[6]")
print("Sortierer->Spender[7]")
print("Spender->Craften[8]")
print("Crafting->Lager[9]")
write("AUSWAHL: ")
d = read()
if d == ("1") then
print("Transportiere Cobblestone zum Ofen")
c = colors.combine( colors.blue )
rs.setBundledOutput( "back", c )
shell.run("disk/startup")
end
if d == ("2") then
print("Transportiere Sand zum Ofen")
c = colors.combine( colors.black )
rs.setBundledOutput("back", c )
shell.run("disk/startup")
end
end
ok now it works
madmatthew14 #17
Posted 11 September 2012 - 06:39 PM
Any english translation of what the program does, from what i see its looking good but can anyone say exactly what it does
naxyr #18
Posted 31 December 2012 - 12:24 AM
google translate makes it look like they are using it to automate your production and retrieval as stone and sand. Rohstoffproduktion is commodity production
schrolock #19
Posted 05 November 2016 - 07:26 PM
Any english translation of what the program does, from what i see its looking good but can anyone say exactly what it does
google translate makes it look like they are using it to automate your production and retrieval as stone and sand. Rohstoffproduktion is commodity production

just startet looking back at my old times :P/>

Sorry to revive this post after nearly 4 years, but yes, it actually was made, to automate a Factory for mining Turtles and Raw Computers. it even got extensions later to gather the items together itself (redstone was cheated in this version, later i used multiple quarrys instead of cheating and cobblestone producers

Sadly, i haven't been coding for years now, so even though i want to do it again, it would take a lot more time since i don't have as much freetime as i had with 15