Not fixable Bug!
#1
Posted 30 July 2013 - 07:27 AM
(sorry at the beginnig, because my english is not so good)
Im programming on my own Computer Craft OS and i found a not fixable bug! If i want to open a command line, after the system is booted, the system crashes and it dosn't start the startup file after reboot! Only a command line and there is nothing, only the command line. Please help!
#2
Posted 30 July 2013 - 10:06 AM
#3
Posted 06 August 2013 - 05:29 PM
#4
Posted 06 August 2013 - 05:38 PM
Chickenbreadlp, on 06 August 2013 - 05:29 PM, said:
#5
Posted 15 August 2013 - 08:08 AM
Nobody likes downloads! Codes are down there!
How the Bug shows up:
1. Login
2. Click on the red X
3. Now you see!
But ist not happening, when i start the Programm from a command line!
Edited by Chickenbreadlp, 15 August 2013 - 08:48 AM.
removed automatic download
#6
Posted 15 August 2013 - 08:11 AM
#7
Posted 15 August 2013 - 08:46 AM
Starup:
function menue(m)
n=1
k=#m
while true do
term.clear()
term.setCursorPos(1,1)
term.setTextColor(16)
print("ApfelBoot - Pro Bootloader")
term.setCursorPos(1,3)
for i=1, k, 1 do
if i==n then print(i, " ["..m[i].."]") else print(i, " "..m[i].." ") end
end
print("")
print("<Bitte Betribsystem Auswählen!>")
a, b= os.pullEvent()
if a == "key" then
if b==200 and n>1 then n=n-1 end
if b==208 and n<=k then n=n+1 end
if b==28 then break end
end
end
term.clear() term.setCursorPos(1,1)
return n
end
local options={
"ApfelOS",
"CraftOS"
}
local n=menue(options)
print(n)
if n == 1 then
term.clear()
term.setCursorPos(1,2)
term.setTextColor(16)
print(" ApfelOS wird Geladen ")
print(" Bitte warten ")
sleep(1)
term.setCursorPos(1,3)
print(" Bitte warten.")
sleep(1)
term.setCursorPos(1,3)
print(" Bitte warten..")
sleep(1)
term.setCursorPos(1,3)
print(" Bitte warten...")
sleep(1)
term.clear()
term.setCursorPos(1,2)
print(" ApfelOS wird Geladen ")
print(" Bitte warten ")
sleep(1)
term.setCursorPos(1,3)
print(" Bitte warten.")
sleep(1,1)
term.clear()
term.setCursorPos(1,2)
print(" Willkommen! ")
sleep(2,5)
shell.run("ApfelOS/aLogin")
elseif n == 2 then
term.clear()
shell.run("CraftOS/OS")
else
term.clear()
term.setCursorPos(1,1)
term.setTextColor(16)
print("Dies ist ein Fehler im Coding!")
print("Gib bitte Chickenbreadlp von AppleMedia bescheid!")
sleep(5)
os.reboot()
end
Create Folder: ApfelOS
Programms in ApfelOS:
aLogin:
term.setBackgroundColor(8)
term.clear()
term.setCursorPos(1,1)
term.setTextColor(1)
term.setBackgroundColor(2048)
write("ApfelOS 1.0 Pro Alpha 0.57 Login ")
term.setBackgroundColor(512)
print("<Name: klaus Passwort: 12345> ")
term.setBackgroundColor(8)
term.setTextColor(32768)
term.setCursorPos(15,5)
term.setBackgroundColor(16)
print(" Anmelden ")
term.setBackgroundColor(1)
term.setCursorPos(15,6)
print(" ")
term.setCursorPos(15,7)
print(" ")
term.setCursorPos(15,8)
print(" ")
term.setCursorPos(15,9)
print(" ")
term.setCursorPos(15,10)
print(" ")
term.setCursorPos(15,11)
print(" ")
term.setCursorPos(20,7)
write(" User : ")
term.setCursorPos(20,9)
print("Passwort: ")
term.setCursorPos(30,7)
UserName = read()
if UserName == "" then
term.setCursorPos(20,10)
shell.run("ApfelOS/aLogin")
else
end
if fs.exists("ApfelOS/..Benutzer/"..UserName.."") then
term.setCursorPos(30,9)
UserPass = read("*")
if UserPass == "" then
term.setCursorPos(20,10)
shell.run("ApfelOS/aLogin")
else
end
if fs.exists("ApfelOS/..Benutzer/"..UserName.."/"..UserPass.."") then
shell.run("ApfelOS/..Welcome")
else
term.setCursorPos(20,10)
term.setTextColor(16384)
print("Falsches Passwort")
term.setTextColor(1)
sleep(1)
term.setBackgroundColor(8)
term.clear()
term.setCursorPos(1,1)
shell.run("ApfelOS/aLogin")
end
else
term.setCursorPos(20,10)
term.setTextColor(16384)
print("Falscher Benutzername")
term.setTextColor(1)
sleep(1)
term.setBackgroundColor(8)
term.clear()
term.setCursorPos(1,1)
shell.run("ApfelOS/aLogin")
end
term.clear()
term.setCursorPos(1,1)
..Welcome:
term.setBackgroundColor(8)
term.clear()
term.setTextColor(1)
term.setCursorPos(1,1)
term.setBackgroundColor(2048)
print("ApfelOS 1.0 Pro Alpha 0.57 ")
term.setBackgroundColor(512)
print("<Bitte warten!> ")
term.setBackgroundColor(8)
term.setTextColor(1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen /")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen -")
sleep(0.1)
term.setCursorPos(20,7)
print("Wilkommen |")
sleep(0.1)
shell.run("ApfelOS/..Desk")
..Desk:
term.clear()
term.setCursorPos (1,1)
term.setBackgroundColor(2048)
term.setTextColor(1)
print("ApfelOS 1.0 Pro Alpha 0.57 ")
term.setCursorPos(51,1)
term.setBackgroundColor(16384)
print("X")
term.setBackgroundColor(512)
print("<Keine Meldungen verfügbar!> ")
term.setBackgroundColor(8)
print(" X 1.Computer und Disk Speicher öffnen ")
print(" X 2.Aktuelle Zeit ")
print(" X 3.Snake spielen ")
print(" X 4.Random Meldung ")
print(" X 5.Paint ")
print(" X 6.Weitere Informationen ")
print(" X 7.Graustufen Aktivieren ")
print(" X 8.Neuen Benutzer Registrieren ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
term.setBackgroundColor(512)
print("<Weitere Ideen? Bitte über PN an Apple Media> ")
term.setBackgroundColor(2048)
print("(C)Apple Media 2012 - 2013 ")
while true do
local event, button, X, Y = os.pullEvent("mouse_click")
XY = X..","..Y
-- Schliessen
if XY == "51,1" and button == 1 then
shell.run("ApfelOS/aTerm")
break
end
-- Random Meldung
if XY == "5,6" and button == 1 then
shell.run("ApfelOS/aMeldung")
break
end
-- Informationen
if XY == "5,8" and button == 1 then
shell.run("ApfelOS/aInfo")
break
end
-- Zur N Version wechseln
if XY == "5,9" and button == 1 then
shell.run("ApfelOS/aEmu")
break
end
-- Speicher
if XY == "5,3" and button == 1 then
shell.run("ApfelOS/aProg")
break
end
-- Zeit
if XY == "5,4" and button == 1 then
shell.run("ApfelOS/aTime")
break
end
-- Snake
if XY == "5,5" and button == 1 then
term.setBackgroundColor(32768)
term.clear()
shell.run("worm")
break
end
-- Paint
if XY == "5,7" and button == 1 then
shell.run("ApfelOS/aPaint")
break
end
-- Regestrieren
if XY == "5,10" and button == 1 then
shell.run("ApfelOS/..Regist")
break
end end
aTerm:
term.clear()
term.setCursorPos(1,1)
term.setBackgroundColor(2048)
term.setTextColor(1)
print("ApfelOS 1.0 <Pro> !NOT FINAL! Beta 5.5 ")
term.setCursorPos(51,1)
term.setBackgroundColor(16384)
print("X")
term.setBackgroundColor(512)
print("<ApfelOS geht in den Terminal Modus!> ")
term.setBackgroundColor(8)
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
term.setBackgroundColor(512)
print(" ")
term.setBackgroundColor(2048)
print(" ")
sleep(3)
term.clear()
term.setCursorPos(1,1)
term.setBackgroundColor(32768)
term.setTextColor(16)
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
print(" ")
term.clear()
term.setCursorPos(1,1)
print("ApfelOS 1.0 Pro Terminal ")
print("<Um den Computer Auszuschalten, shut-off eingeben!>")
Create Folder: ..Benutzer
in this Folder create Folder: klaus
in this Folder create Folder: 12345
ready to go! use my instuctions in an older reply!
#8
Posted 15 August 2013 - 08:53 AM
Why do you have so many prints? You just have to set a bgcolour and do term.clear() to colour the whole background.
#9
Posted 15 August 2013 - 09:17 AM
svdragster, on 15 August 2013 - 08:53 AM, said:
Why do you have so many prints? You just have to set a bgcolour and do term.clear() to colour the whole background.
I deleted the Programm named aTerm and i used an older Version of this programm. This Version was creaded, when i dosn't know many things about Lua. And as you can see, in aLogin are not as many prints like in aTerm.
#10
Posted 15 August 2013 - 09:23 AM
-- Schliessen
if XY == "51,1" and button == 1 then
shell.run("ApfelOS/aTerm")
break
end
einfach das break wegmachen
-- Schliessen
if XY == "51,1" and button == 1 then
shell.run("ApfelOS/aTerm")
break -- dieses break weg und es geht. ausserdem macht dein terminal programm nichts ausser sagen das man shut-off eingeben soll.
end
#11
Posted 15 August 2013 - 09:30 AM
LordIkol, on 15 August 2013 - 09:23 AM, said:
-- Schliessen
if XY == "51,1" and button == 1 then
shell.run("ApfelOS/aTerm")
break
end
einfach das break wegmachen
-- Schliessen
if XY == "51,1" and button == 1 then
shell.run("ApfelOS/aTerm")
break -- dieses break weg und es geht. ausserdem macht dein terminal programm nichts ausser sagen das man shut-off eingeben soll.
end
Ich weiß das, aber zu der zeit, als ich mich hier an das Forum wendete, hatte ich noch die Idee, ein Terminal ein zu bauen. Mittlerweil, ist es in einem Anderen Programm, doch das Problem bleibt! Außerdem sollte man doch in einem Terminal doch was eingeben können, das kann man aber nicht ohne dem break!
Hier ist der Code zu dem neuen Programm:
term.setBackgroundColor(32768)
term.setTextColor(1)
term.clear()
term.setCursorPos (1,1)
term.setBackgroundColor(2048)
print("ApfelOS 1.0 Pro Alpha 0.57 ")
term.setBackgroundColor(512)
print("<Gelb heisst Info,Grün heisst Ordner!> ")
term.setBackgroundColor(8)
term.setTextColor(16)
print("PC Speicher")
term.setTextColor(1)
shell.run("ls")
term.setTextColor(16)
print("Disk speicher")
print("(Wenn keine Disk da ist, kommt eine Fehlermeldung!)")
term.setTextColor(16384)
shell.run("cd", "disk")
term.setTextColor(1)
shell.run("ls")
term.setTextColor(16384)
shell.run("cd", "..")
term.setTextColor(16)
print("Bitte für Disk Programme vorher disk/ eingeben!")
write("Dateiname: ")
term.setTextColor(1)
file1 = read()
term.setBackgroundColor(32768)
term.clear()
term.setCursorPos(1,1)
term.setTextColor(16)
print("ApfelOS 1.0 Pro Terminal ") -- Falls man was eingibt, was nicht auf dem Computer ist oder ein Command ist!
term.setTextColor(1)
shell.run(file1)
#12
Posted 15 August 2013 - 09:41 AM

Wenn man hier auf das rote X klickt, dann kommt der bug?
Is the bug here when clicking on the red X?
#14
Posted 15 August 2013 - 09:45 AM
What should happen when clicking on it? I just return to CraftOS.
#15
Posted 15 August 2013 - 09:52 AM
ApfelOS 1.0 Pro Terminal
<Um den Computer Auszuschalten, shut-off eingeben!>
Hier (Wie es sein sollte) (English: Here (How it used to be)) :

Und Hier wie es ist (English: And here how it is):
#16
Posted 15 August 2013 - 09:57 AM
term.clear() term.setCursorPos(1,1)stehen. Wenn du es wegmachst, gehts.
Wenn du ein Programm startest, und es beendet ist, dann wird mit dem Programm fortgefahren, in dem du das Programm gestartet hast, in dem Fall aLogin.
too lazy to translate.
#17
Posted 15 August 2013 - 09:58 AM
The break in the Loop is ok just do sth in the new programm
Greets
Loki
Edited by LordIkol, 16 August 2013 - 12:49 AM.
#18
Posted 15 August 2013 - 10:04 AM
LordIkol, on 15 August 2013 - 09:58 AM, said:
Break beendet nicht das Programm, er beendet den Loop. Hier wird das Programm beendet weil nach dem Loop nichts mehr kommt.
#19
Posted 15 August 2013 - 10:46 AM
ist einfach die aterm struktur die nicht aufgeht.
hab nicht dran gedacht das die Loop auch nach shell.run() noch weiterläuft.
dennoch ist das Problem das Terminal Programm an sich.
Wenn die While schleife im Desk durch break beendet wird muss er eine neue schleife im Terminal haben die das Programm am laufen hält und die gewünschten Terminal Befehle abfängt.
Am besten alle möglichen befehle in ne table packen. nen read() machen und dann ne if abfrage die die Commands table checkt und dann die gewünschte Aktion ausführt.
so wie es jetzt ist wird es mit oder ohne break nicht laufen.
------
Sorry my fault.
i did not think about the fact that shell.run() is not breaking the loop.
but in the end its the structure of his aTerm that is not well made.
If you close the Loop in the ..Desk Programm and you want user defined commands in your Shell you need to start a new loop that caches what the user types in. for Example:
You could put all your Commands in a table. open a while loop thats asking for a command. than reads the input and checks it with the Table.
#20
Posted 15 August 2013 - 11:42 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











