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

Made my program cleaner, now it's broken [solved - TY!]

Started by Drexl, 17 May 2012 - 05:39 PM
Drexl #1
Posted 17 May 2012 - 07:39 PM
So here are two simple password programs I made for testing purposes. The first one is rather messy, but works just fine. The second is much cleaner, but doesn't work at all and returns no errors. I see nothing wrong. :P/>/>

#1 http://pastebin.com/RasYYTbr
#2 http://pastebin.com/5YW4HLL6
MysticT #2
Posted 17 May 2012 - 07:49 PM
You never call login to start the program.
Also, you shouldn't call the function within itself (unless you have a reason to do it), it's better to use a loop:

while true do
  -- your code
end
This will repeat your code until the computer shuts down or you terminate the program (if it's not terminate-safe).
Drexl #3
Posted 17 May 2012 - 07:51 PM
derp! you're right of course. Thanks! :P/>/>