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

Dutch's ComputerCraft Programs

Started by Dutch, 05 April 2015 - 02:40 PM
Dutch #1
Posted 05 April 2015 - 04:40 PM
I have removed the content since I might be working on some new programs.
Edited on 20 April 2016 - 07:05 PM
CrazedProgrammer #2
Posted 05 April 2015 - 08:20 PM
Hello fellow dutchie! (stroopwafels ftw)
Cool programs, but a password manager is quite pointless in Computercraft, because there are so many ways to bypass it.
Also, using textutils.slowPrint is generally a bad practice. Use print() instead.
It would be better if the updater only updates when there is a newer version.
There are a few redundancies in your code, like == true and 2>1, but I can't fix them now :(/>
Dutch #3
Posted 06 April 2015 - 10:36 AM
Hello fellow dutchie! (stroopwafels ftw)
Cool programs, but a password manager is quite pointless in Computercraft, because there are so many ways to bypass it.
Also, using textutils.slowPrint is generally a bad practice. Use print() instead.
It would be better if the updater only updates when there is a newer version.
There are a few redundancies in your code, like == true and 2>1, but I can't fix them now :(/>

Yeah, I am still learning ComputerCraft, so I don't know a lot of things about it (I have watched some tutorials) I will fix it as soon as I have time.
CodeWafels #4
Posted 09 April 2015 - 10:25 PM
2 dutchies in the same place :D/> Whatabout 3 now x3

I must admit it's astonishing what u did at level 0.0.1 (pre-alpha not yet a developer/coder),
but some of the mistake you make are funny and, for example, the unnecesarry use of statements is also kind of a bit funny.
Golden tip: infinite loops can also be made without variables and only booleans; while true do.
Because while the while loop runs, the while loop is true and it will loop.

Doesn't matter anyways, as beginner.
Edited on 15 April 2015 - 08:06 AM
martmists #5
Posted 15 May 2015 - 09:15 PM
configured = true
this makes the whole program pointless as it tells the program it is configured at the start. try http://pastebin.com/pqxNBrrL and add it to the computercraft1.XX.jar in jar/assets/computercraft/autorun as there is no way to bypass that file
biggest yikes #6
Posted 15 May 2015 - 10:36 PM
configured =true
this makes the whole program pointless as it tells the program it is configured at the start. try http://pastebin.com/pqxNBrrL and add it to the computercraft1.XX.jar in jar/assets/computercraft/autorun as there is no way to bypass that file
There is no need to put it in autorun, just name the file "startup".
How does it make it pointless? Just change a few things and you're set.
Edited on 15 May 2015 - 08:36 PM
martmists #7
Posted 17 May 2015 - 11:38 AM
There is no need to put it in autorun, just name the file "startup".
if there is a disk drive attatched to it, it will run the startup program on the disk, NOT the computer.

How does it make it pointless? Just change a few things and you're set

first the program does:
set configured to true
then:
check if configured is true or false.
it is true, so the rest of the program is not executed.

code:

-- computer password protection with built-in password setup
local pullEvent = os.pullEvent -- stops people from using ctrl + t
os.pullEvent = os.pullEventRaw -- ..
local loop = true
local Tries = 3 -- after this amount of tries the computer shuts down
while loop do -- loop :)/>/>/>
term.clear()
term.setCursorPos(1,1)
if fs.exists("Password") then -- check if there is a password set already
  file = io.open("Password", "r")
  Password == file:read() -- get actual password
  textutils.slowPrint("Enter password: ")
  local Input = read("*")
  if Input == Password then -- compare actual password to user input
   textutils.slowPrint("Password correct.")
   loop = false
   os.pullEvent = pullEvent -- you can use ctrl + t if it crashed here
  else -- password wrong
   Tries = (Tries - 1) -- minus 1 try
   textutils.slowPrint("Password incorrect.")
   textutils.slowPrint("Tries left: ")
   textutils.slowPrint(Tries)
   if Tries == 0 then
	sleep(2)
	os.shutdown() -- reboot if tries = 0
   end
  end
else -- no password yet
  textutils.slowPrint("Please choose a password:")
  PasswordFile = read("*") -- type password
  textutils.slowPrint("Password chosen: "..Passwordfile)
  print("Do you want this password?") -- confirm
  PasswordOK = read()
  if PasswordOK == "Yes" then
   file = io.open("Password", "w")
   file:write(PasswordFile) -- store password
   file:close()
  end
end
end
Edited on 17 May 2015 - 10:35 AM