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

Error in code

Started by nikolay04, 02 February 2017 - 05:24 PM
nikolay04 #1
Posted 02 February 2017 - 06:24 PM
So i was bored today and wanted to make something. I just learnt the fs api. So i decided to make a program that writes viruses for you to practice the api. But when i was done with the first virus generator thing it gave me and error. viruscreator:5: attempt to call string

function virus1()
  hacked = "You have been hacked"
print("What kind of virus do you want. Please select one of them")
print("If you want a virus that replaces the startup file type 'normal'.")
input = read() --Line 5
if input == "normal" then
  f = fs.open("startup","w")
  f.write("os.pullEvent() = os.pullEventRaw()")
  f.write("print(hacked)")
  f.write("sleep(2)")
  f.write("os.shutDown()")
  f.close()
end
end
virus1()
Edited on 02 February 2017 - 05:26 PM
Lyqyd #2
Posted 02 February 2017 - 07:44 PM
Malicious code is not allowed on the forums, and we do not provide help with it.