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

bios:338: [string "asetup"]:44: 'end' expected (to close 'function' at line 31

Started by NeptunasLT, 11 March 2013 - 05:50 AM
NeptunasLT #1
Posted 11 March 2013 - 06:50 AM
I'm getting this error
My code:

--ArchilyOS Setup Coded by NeptunasLT
function complete()
 print("Setup Is Completed!")
 print("System Reboot in:")
 print("3")
 sleep(1)
 print("2")
 sleep(1)
 print("1")
 sleep(1)
 os.reboot()
end
function install()
 if fs.exists("/archily") then fs.remove ("/archily")
 fs.makeDir("archily")
 fs.makeDir("/archily/system")
 shell.run("pastebin", "get", "wk0Siumq", "archily/system/gui")
 shell.run("pastebin", "get", "UhbCLCVE", "boot")
 shell.run("pastebin", "get", "320wmmdy", "archily/system/fLib")
 shell.run("pastebin", "get", "HxYuSMHP", "archily/system/file")
 shell.run("pastebin", "get", "HaSRpSLH", "archily/system/.background")
 shell.run("pastebin", "get", "3ykgdF0g", "archily/system/icon.nfp")
 shell.run("pastebin", "get", "m3X2bYjQ", "archily/system/taco")
 fs.makeDir("/archily/system/programs")
 shell.run("pastebin", "get", "BDSMjPDQ", "archily/system/programs/firewolf")
 shell.run("pastebin", "get", "LEWpvT2Z", "archily/system/programs/npaintpro")
 shell.run("pastebin", "get", "CRd9f1Ac", "archily/system/update")
 shell.run("pastebin", "get", "Mh9LTq2a", "startup")
 complete()
end
function license()
 lic = "Archily"

 print("PLs input license key")
 write" "
 input = read()
 if input == lic then
 print("starting installer...")
 install()
  else
 print("Something Bad!")
 os.reboot()
end
license()
Engineer #2
Posted 11 March 2013 - 07:08 AM
I have properly indented the code on pastebin: (it is easier to copy and paste there, I took the code in notpad and indented it)
http://pastebin.com/AbBF9326

I suggest you also read good coding habits

You can also read the errors in the pastebin
Edited on 11 March 2013 - 06:42 AM
LBPHacker #3
Posted 11 March 2013 - 07:13 AM
License key? You know that everybody can just type "edit asetup", right?
remiX #4
Posted 11 March 2013 - 07:35 AM
if fs.exists("/archily") then fs.remove ("/archily")

You didn't end the if statement
CCJJSax #5
Posted 11 March 2013 - 08:06 AM
within function install() you need to put an end to end the "if fs.exists("/archily") then fs.remove ("/archily")" part
Spongy141 #6
Posted 11 March 2013 - 08:11 AM
I'm getting this error
My code:

--ArchilyOS Setup Coded by NeptunasLT
function complete()
print("Setup Is Completed!")
print("System Reboot in:")
print("3")
sleep(1)
print("2")
sleep(1)
print("1")
sleep(1)
os.reboot()
end
function install()
  if fs.exists("/archily") then fs.remove ("/archily")  -- you forgot to end this
	fs.makeDir("archily")
	fs.makeDir("/archily/system")
	shell.run("pastebin", "get", "wk0Siumq", "archily/system/gui")
	shell.run("pastebin", "get", "UhbCLCVE", "boot")
	shell.run("pastebin", "get", "320wmmdy", "archily/system/fLib")
	shell.run("pastebin", "get", "HxYuSMHP", "archily/system/file")
	shell.run("pastebin", "get", "HaSRpSLH", "archily/system/.background")
	shell.run("pastebin", "get", "3ykgdF0g", "archily/system/icon.nfp")
	shell.run("pastebin", "get", "m3X2bYjQ", "archily/system/taco")
	fs.makeDir("/archily/system/programs")
	shell.run("pastebin", "get", "BDSMjPDQ", "archily/system/programs/firewolf")
	shell.run("pastebin", "get", "LEWpvT2Z", "archily/system/programs/npaintpro")
	shell.run("pastebin", "get", "CRd9f1Ac", "archily/system/update")
	shell.run("pastebin", "get", "Mh9LTq2a", "startup")
	complete()
  end
end
function license() -- you also forgot to end this
  lic = "Archily"
end
print("Pls input license key")
write" "
input = read()
if input == lic then
print("starting installer...")
install()
  else
print("Something Bad!")
os.reboot()
end
license()