Posted 10 January 2013 - 04:08 AM
Hey there!
I write a startup routine, using basic commands. All runs fine BUT it never detects if a label is already set.
I think i cant use "os.getComputerLabel()" as bool variable, is there anything else i could use to detect it ?
My Code below
I write a startup routine, using basic commands. All runs fine BUT it never detects if a label is already set.
I think i cant use "os.getComputerLabel()" as bool variable, is there anything else i could use to detect it ?
My Code below
print ("This computers ID : "..os.getComputerID())
if os.getComputerLabel() ~= true then
print ("This Computer has no label")
print ("Do you want to label it now ?")
print (" Y / N ")
local a1 = read()
if a1 == "Y" then
shell.run("clear")
print ("Enter label : ")
local a2 = read()
os.setComputerLabel(a2)
print( "Your computer is now known as : " .. os.getComputerLabel() )
else
shell.run("clear")
end
else
print( "Name: " .. os.getComputerLabel() )
print( "welcome!")
sleep(2)
end