Posted 23 January 2014 - 02:15 PM
i Need helpi will integrate my config file in my os
the Problem is the config is integrated, but the text in the config is not written in the Programm here the code:
the Problem is the config is integrated, but the text in the config is not written in the Programm here the code:
--Function to load APIs + Language Package
os.loadAPI("/Volumes/M_System/System/Components/fLib")
slc = 0
lang = fs.open("/Volumes/M_System/System/Packages/language/de_de.lang", "r")
Rlang = lang.readAll()
lang.close()
term.clear()
function load()
background()
loginui()
end
function background()
term.setBackgroundColor(512)
term.clear()
term.setCursorPos(51,19)
write("M")
end
function shutdownmenu()
term.setBackgroundColor(1)
term.setTextColor(colors.black)
term.setCursorPos(38,17)
print(Rlang.loginshutdownbutton)
term.setCursorPos(38,18)
print("Neustarten ")
term.setCursorPos(38,19)
write(" M")
slc = 1
end
function loginui()
term.setCursorPos(15,7)
term.setBackgroundColor(colors.gray)
term.setTextColor(colors.white)
print("X | Login Interface")
term.setCursorPos(15,8)
term.setBackgroundColor(1)
term.setTextColor(colors.black)
print(" ")
term.setCursorPos(15,9)
print(" Benutzername: ")
term.setCursorPos(15,10)
print(" ")
term.setCursorPos(15,11)
print(" Passwort: ")
term.setCursorPos(15,12)
print(" ")
term.setCursorPos(15,13)
print(" ")
term.setCursorPos(16,10)
term.setBackgroundColor(128)
print(" ")
term.setCursorPos(16,12)
print(" ")
term.setCursorPos(1,1)
term.setBackgroundColor(512)
term.setTextColor(1)
print("OS Created by MailoStudios | Version 1.0 Pre-Release")
end
load()
while true do
local event, button, X, Y = os.pullEventRaw()
if event == "mouse_click" then
if slc == 0 then
if X>=16 and X<=31 and Y==10 and button ==1 then
term.setBackgroundColor(256)
term.setCursorPos(16,10)
print(" ")
term.setCursorPos(16,10)
input1 = read()
if input1 == "" then
term.setCursorPos(16,10)
print("Falsch!")
sleep(2)
load()
end
if fs.exists(dont see that) then
else
term.setCursorPos(16,10)
print("Falsch!")
sleep(2)
load()
end
elseif X>=16 and X<=31 and Y==12 and button ==1 then slc = 0
term.setBackgroundColor(256)
term.setCursorPos(16,12)
print(" ")
term.setCursorPos(16,12)
input2 = read("*")
if input2 == "" then
term.setCursorPos(16,12)
print("Falsch!")
sleep(2)
load()
end
if fs.exists(dont see that) then
fLib.replaceLine("/Volumes/M_System/System/Desktop.lua",1,'loggeduser = "'..input1..'"')
shell.run("/Volumes/M_System/System/Desktop.lua")
else
term.setCursorPos(16,12)
print("Falsch!")
sleep(2)
load()
end
elseif X>=51 and X<=51 and Y==19 and button ==1 then
shutdownmenu()
slc = 1
end
elseif slc == 1 then
if X==51 and Y==19 and button==1 then
load()
slc = 0
elseif X>=38 and X<=51 and Y==17 and button==1 then
term.setBackgroundColor(colors.gray)
term.setTextColor(1)
term.setCursorPos(38,17)
write("Herunterfahren")
sleep(0.3)
shell.run("/Volumes/M_System/System/.shutdown")
elseif X>=38 and X<=51 and Y==18 and button==1 then
term.setBackgroundColor(colors.gray)
term.setTextColor(1)
term.setCursorPos(38,18)
write("Neustarten ")
sleep(0.3)
shell.run("/Volumes/M_System/System/.reboot")
end
end
end
end
Edited on 23 January 2014 - 01:17 PM