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

Autorun?

Started by Noodle, 09 April 2012 - 01:11 AM
Noodle #1
Posted 09 April 2012 - 03:11 AM
Is there anyway to put in a disk and for it to work without editing anything?
For example: some kid has a door locked, you want to hack it.
You plug in a floppy reader, and put in a floppy. It doesn't work.
How do you get it to be put in and then work automatically?
cant_delete_account #2
Posted 09 April 2012 - 05:16 AM
Edit a file called 'startup' on the floppy, add this hack code:

if fs.exists("//startup") then
fs.delete("//startup")
local hFile = fs.open("startup","w")
hFile.write("print("You've been hacked! :P/>/>")")
hFile.close()

else
hFileF = fs.open("startup","w")
hFileF.write("error()")
hFileF.close()
end
Then place a disk drive on the TOP of the persons computer, and insert that floppy into it, then open the terminal, and if it is already running then hold CTRL+R until it reboots. If its not on, then it'll just be instantly hacked. :)/>/>
Also, here's a less evil version (It makes a backup of startup):

if fs.exists("//startup") then
local hFileT = fs.open("startup","r")
local nTextDerp = hFileT.readAll()
nFileT.close()
local hFileH = fs.open("startupbackup","w")
hFileH.write(nTextDerp)
hFileH.close()
fs.delete("//startup")
local hFile = fs.open("startup","w")
hFile.write("print("You've been hacked! :D/>/>")")
hFile.close()
else
hFileF = fs.open("startup","w")
hFileF.write("error()")
hFileF.close()
end
kamnxt #3
Posted 09 April 2012 - 07:22 PM
Edit a file called 'startup' on the floppy, add this hack code:

if fs.exists("//startup") then
fs.delete("//startup")
local hFile = fs.open("startup","w")
hFile.write("print("You've been hacked! :P/>/>")")
hFile.close()

else
hFileF = fs.open("startup","w")
hFileF.write("error()")
hFileF.close()
end
…….
Use:

hFile.write("print("You've been hacked! :D/>/>")")
Noodle #4
Posted 25 May 2012 - 06:38 AM
hmm..
You edit disk/startup
shell.run("hello")
plug in a floppy drive then the floppy
CTRL + S to reboot
ComputerCraftFan11 #5
Posted 25 May 2012 - 08:12 AM
Edit a file called 'startup' on the floppy, add this hack code:

if fs.exists("//startup") then
fs.delete("//startup")
local hFile = fs.open("startup","w")
hFile.write("print("You've been hacked! :)/>/>")")
hFile.close()

else
hFileF = fs.open("startup","w")
hFileF.write("error()")
hFileF.close()
end
Then place a disk drive on the TOP of the persons computer, and insert that floppy into it, then open the terminal, and if it is already running then hold CTRL+R until it reboots. If its not on, then it'll just be instantly hacked. :D/>/>
Also, here's a less evil version (It makes a backup of startup):

if fs.exists("//startup") then
local hFileT = fs.open("startup","r")
local nTextDerp = hFileT.readAll()
nFileT.close()
local hFileH = fs.open("startupbackup","w")
hFileH.write(nTextDerp)
hFileH.close()
fs.delete("//startup")
local hFile = fs.open("startup","w")
hFile.write("print("You've been hacked! :)/>/>")")
hFile.close()
else
hFileF = fs.open("startup","w")
hFileF.write("error()")
hFileF.close()
end

Or

local hFile = fs.open("startup","w")
if fs.exists("//startup") then
fs.delete("//startup")
hFile.write('print("You've been hacked! :P/>/>")')
else
hFile.write("error()")
end

hFile.close()
Then place a disk drive on the TOP of the persons computer, and insert that floppy into it, then open the terminal, and if it is already running then hold CTRL+R until it reboots. If its not on, then it'll just be instantly hacked. :D/>/>
Also, here's a less evil version (It makes a backup of startup):



local hFile = fs.open("startup","w")
if fs.exists("//startup") then
shell.run("move","startup","startupbackup")
end

hFile.write("error()")
hFile.close()
end
Luanub #6
Posted 25 May 2012 - 08:17 AM
Its better to use fs.move() then shell.run("move")

so replace

shell.run("move","startup","startupbackup")


with

fs.move("startup", "startupbackup")
Cloudy #7
Posted 25 May 2012 - 11:56 AM
Why do people drag up old threads with nothing to add to it? No one who has posted today has added anything to the discussion at all.
Noodle #8
Posted 26 May 2012 - 12:20 AM
@Cloudy
I did because I wanted to see if there was anything here useful.